Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 
 
 

622 rader
19 KiB

  1. # vim:ft=yaml
  2. # PEM encoded X509 certificate for TLS.
  3. # You can replace the self-signed certificate that synapse
  4. # autogenerates on launch with your own SSL certificate + key pair
  5. # if you like. Any required intermediary certificates can be
  6. # appended after the primary certificate in hierarchical order.
  7. tls_certificate_path: "/etc/matrix-synapse/homeserver.tls.crt"
  8. # PEM encoded private key for TLS
  9. tls_private_key_path: "/etc/matrix-synapse/homeserver.tls.key"
  10. # PEM dh parameters for ephemeral keys
  11. tls_dh_params_path: "/etc/matrix-synapse/homeserver.tls.dh"
  12. # Don't bind to the https port
  13. no_tls: False
  14. # List of allowed TLS fingerprints for this server to publish along
  15. # with the signing keys for this server. Other matrix servers that
  16. # make HTTPS requests to this server will check that the TLS
  17. # certificates returned by this server match one of the fingerprints.
  18. #
  19. # Synapse automatically adds the fingerprint of its own certificate
  20. # to the list. So if federation traffic is handled directly by synapse
  21. # then no modification to the list is required.
  22. #
  23. # If synapse is run behind a load balancer that handles the TLS then it
  24. # will be necessary to add the fingerprints of the certificates used by
  25. # the loadbalancers to this list if they are different to the one
  26. # synapse is using.
  27. #
  28. # Homeservers are permitted to cache the list of TLS fingerprints
  29. # returned in the key responses up to the "valid_until_ts" returned in
  30. # key. It may be necessary to publish the fingerprints of a new
  31. # certificate and wait until the "valid_until_ts" of the previous key
  32. # responses have passed before deploying it.
  33. #
  34. # You can calculate a fingerprint from a given TLS listener via:
  35. # openssl s_client -connect $host:$port < /dev/null 2> /dev/null |
  36. # openssl x509 -outform DER | openssl sha256 -binary | base64 | tr -d '='
  37. # or by checking matrix.org/federationtester/api/report?server_name=$host
  38. #
  39. tls_fingerprints: []
  40. # tls_fingerprints: [{"sha256": "<base64_encoded_sha256_fingerprint>"}]
  41. ## Server ##
  42. # When running as a daemon, the file to store the pid in
  43. pid_file: "/var/run/matrix-synapse.pid"
  44. # CPU affinity mask. Setting this restricts the CPUs on which the
  45. # process will be scheduled. It is represented as a bitmask, with the
  46. # lowest order bit corresponding to the first logical CPU and the
  47. # highest order bit corresponding to the last logical CPU. Not all CPUs
  48. # may exist on a given system but a mask may specify more CPUs than are
  49. # present.
  50. #
  51. # For example:
  52. # 0x00000001 is processor #0,
  53. # 0x00000003 is processors #0 and #1,
  54. # 0xFFFFFFFF is all processors (#0 through #31).
  55. #
  56. # Pinning a Python process to a single CPU is desirable, because Python
  57. # is inherently single-threaded due to the GIL, and can suffer a
  58. # 30-40% slowdown due to cache blow-out and thread context switching
  59. # if the scheduler happens to schedule the underlying threads across
  60. # different cores. See
  61. # https://www.mirantis.com/blog/improve-performance-python-programs-restricting-single-cpu/.
  62. #
  63. # cpu_affinity: 0xFFFFFFFF
  64. # Whether to serve a web client from the HTTP/HTTPS root resource.
  65. web_client: False
  66. # The root directory to server for the above web client.
  67. # If left undefined, synapse will serve the matrix-angular-sdk web client.
  68. # Make sure matrix-angular-sdk is installed with pip if web_client is True
  69. # and web_client_location is undefined
  70. # web_client_location: "/path/to/web/root"
  71. # The public-facing base URL for the client API (not including _matrix/...)
  72. # public_baseurl: https://example.com:8448/
  73. # Set the soft limit on the number of file descriptors synapse can use
  74. # Zero is used to indicate synapse should set the soft limit to the
  75. # hard limit.
  76. soft_file_limit: 0
  77. # The GC threshold parameters to pass to `gc.set_threshold`, if defined
  78. # gc_thresholds: [700, 10, 10]
  79. # Set the limit on the returned events in the timeline in the get
  80. # and sync operations. The default value is -1, means no upper limit.
  81. # filter_timeline_limit: 5000
  82. # Whether room invites to users on this server should be blocked
  83. # (except those sent by local server admins). The default is False.
  84. # block_non_admin_invites: True
  85. # Restrict federation to the following whitelist of domains.
  86. # N.B. we recommend also firewalling your federation listener to limit
  87. # inbound federation traffic as early as possible, rather than relying
  88. # purely on this application-layer restriction. If not specified, the
  89. # default is to whitelist everything.
  90. #
  91. # federation_domain_whitelist:
  92. # - lon.example.com
  93. # - nyc.example.com
  94. # - syd.example.com
  95. # List of ports that Synapse should listen on, their purpose and their
  96. # configuration.
  97. listeners:
  98. # Main HTTPS listener
  99. # For when matrix traffic is sent directly to synapse.
  100. -
  101. # The port to listen for HTTPS requests on.
  102. port: 8448
  103. # Local addresses to listen on.
  104. # On Linux and Mac OS, `::` will listen on all IPv4 and IPv6
  105. # addresses by default. For most other OSes, this will only listen
  106. # on IPv6.
  107. bind_addresses:
  108. - '::'
  109. - '0.0.0.0'
  110. # This is a 'http' listener, allows us to specify 'resources'.
  111. type: http
  112. tls: true
  113. # Use the X-Forwarded-For (XFF) header as the client IP and not the
  114. # actual client IP.
  115. x_forwarded: false
  116. # List of HTTP resources to serve on this listener.
  117. resources:
  118. -
  119. # List of resources to host on this listener.
  120. names:
  121. - client # The client-server APIs, both v1 and v2
  122. - webclient # The bundled webclient.
  123. # Should synapse compress HTTP responses to clients that support it?
  124. # This should be disabled if running synapse behind a load balancer
  125. # that can do automatic compression.
  126. compress: true
  127. - names: [federation] # Federation APIs
  128. compress: false
  129. # optional list of additional endpoints which can be loaded via
  130. # dynamic modules
  131. # additional_resources:
  132. # "/_matrix/my/custom/endpoint":
  133. # module: my_module.CustomRequestHandler
  134. # config: {}
  135. # Unsecure HTTP listener,
  136. # For when matrix traffic passes through loadbalancer that unwraps TLS.
  137. - port: 8008
  138. tls: false
  139. bind_addresses: ['::', '0.0.0.0']
  140. type: http
  141. x_forwarded: false
  142. resources:
  143. - names: [client, webclient]
  144. compress: true
  145. - names: [federation]
  146. compress: false
  147. # Turn on the twisted ssh manhole service on localhost on the given
  148. # port.
  149. # - port: 9000
  150. # bind_addresses: ['::1', '127.0.0.1']
  151. # type: manhole
  152. # Database configuration
  153. database:
  154. # The database engine name
  155. name: "sqlite3"
  156. # Arguments to pass to the engine
  157. args:
  158. # Path to the database
  159. database: "/var/lib/matrix-synapse/homeserver.db"
  160. # Number of events to cache in memory.
  161. event_cache_size: "10K"
  162. # A yaml python logging config file
  163. log_config: "/etc/matrix-synapse/log.yaml"
  164. ## Ratelimiting ##
  165. # Number of messages a client can send per second
  166. rc_messages_per_second: 0.2
  167. # Number of message a client can send before being throttled
  168. rc_message_burst_count: 10.0
  169. # The federation window size in milliseconds
  170. federation_rc_window_size: 1000
  171. # The number of federation requests from a single server in a window
  172. # before the server will delay processing the request.
  173. federation_rc_sleep_limit: 10
  174. # The duration in milliseconds to delay processing events from
  175. # remote servers by if they go over the sleep limit.
  176. federation_rc_sleep_delay: 500
  177. # The maximum number of concurrent federation requests allowed
  178. # from a single server
  179. federation_rc_reject_limit: 50
  180. # The number of federation requests to concurrently process from a
  181. # single server
  182. federation_rc_concurrent: 3
  183. # Directory where uploaded images and attachments are stored.
  184. media_store_path: "/var/lib/matrix-synapse/media"
  185. # Media storage providers allow media to be stored in different
  186. # locations.
  187. # media_storage_providers:
  188. # - module: file_system
  189. # # Whether to write new local files.
  190. # store_local: false
  191. # # Whether to write new remote media
  192. # store_remote: false
  193. # # Whether to block upload requests waiting for write to this
  194. # # provider to complete
  195. # store_synchronous: false
  196. # config:
  197. # directory: /mnt/some/other/directory
  198. # Directory where in-progress uploads are stored.
  199. uploads_path: "/var/lib/matrix-synapse/uploads"
  200. # The largest allowed upload size in bytes
  201. max_upload_size: "10M"
  202. # Maximum number of pixels that will be thumbnailed
  203. max_image_pixels: "32M"
  204. # Whether to generate new thumbnails on the fly to precisely match
  205. # the resolution requested by the client. If true then whenever
  206. # a new resolution is requested by the client the server will
  207. # generate a new thumbnail. If false the server will pick a thumbnail
  208. # from a precalculated list.
  209. dynamic_thumbnails: false
  210. # List of thumbnail to precalculate when an image is uploaded.
  211. thumbnail_sizes:
  212. - width: 32
  213. height: 32
  214. method: crop
  215. - width: 96
  216. height: 96
  217. method: crop
  218. - width: 320
  219. height: 240
  220. method: scale
  221. - width: 640
  222. height: 480
  223. method: scale
  224. - width: 800
  225. height: 600
  226. method: scale
  227. # Is the preview URL API enabled? If enabled, you *must* specify
  228. # an explicit url_preview_ip_range_blacklist of IPs that the spider is
  229. # denied from accessing.
  230. url_preview_enabled: False
  231. # List of IP address CIDR ranges that the URL preview spider is denied
  232. # from accessing. There are no defaults: you must explicitly
  233. # specify a list for URL previewing to work. You should specify any
  234. # internal services in your network that you do not want synapse to try
  235. # to connect to, otherwise anyone in any Matrix room could cause your
  236. # synapse to issue arbitrary GET requests to your internal services,
  237. # causing serious security issues.
  238. #
  239. # url_preview_ip_range_blacklist:
  240. # - '127.0.0.0/8'
  241. # - '10.0.0.0/8'
  242. # - '172.16.0.0/12'
  243. # - '192.168.0.0/16'
  244. # - '100.64.0.0/10'
  245. # - '169.254.0.0/16'
  246. #
  247. # List of IP address CIDR ranges that the URL preview spider is allowed
  248. # to access even if they are specified in url_preview_ip_range_blacklist.
  249. # This is useful for specifying exceptions to wide-ranging blacklisted
  250. # target IP ranges - e.g. for enabling URL previews for a specific private
  251. # website only visible in your network.
  252. #
  253. # url_preview_ip_range_whitelist:
  254. # - '192.168.1.1'
  255. # Optional list of URL matches that the URL preview spider is
  256. # denied from accessing. You should use url_preview_ip_range_blacklist
  257. # in preference to this, otherwise someone could define a public DNS
  258. # entry that points to a private IP address and circumvent the blacklist.
  259. # This is more useful if you know there is an entire shape of URL that
  260. # you know that will never want synapse to try to spider.
  261. #
  262. # Each list entry is a dictionary of url component attributes as returned
  263. # by urlparse.urlsplit as applied to the absolute form of the URL. See
  264. # https://docs.python.org/2/library/urlparse.html#urlparse.urlsplit
  265. # The values of the dictionary are treated as an filename match pattern
  266. # applied to that component of URLs, unless they start with a ^ in which
  267. # case they are treated as a regular expression match. If all the
  268. # specified component matches for a given list item succeed, the URL is
  269. # blacklisted.
  270. #
  271. # url_preview_url_blacklist:
  272. # # blacklist any URL with a username in its URI
  273. # - username: '*'
  274. #
  275. # # blacklist all *.google.com URLs
  276. # - netloc: 'google.com'
  277. # - netloc: '*.google.com'
  278. #
  279. # # blacklist all plain HTTP URLs
  280. # - scheme: 'http'
  281. #
  282. # # blacklist http(s)://www.acme.com/foo
  283. # - netloc: 'www.acme.com'
  284. # path: '/foo'
  285. #
  286. # # blacklist any URL with a literal IPv4 address
  287. # - netloc: '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$'
  288. # The largest allowed URL preview spidering size in bytes
  289. max_spider_size: "10M"
  290. ## Captcha ##
  291. # See docs/CAPTCHA_SETUP for full details of configuring this.
  292. # This Home Server's ReCAPTCHA public key.
  293. recaptcha_public_key: "YOUR_PUBLIC_KEY"
  294. # This Home Server's ReCAPTCHA private key.
  295. recaptcha_private_key: "YOUR_PRIVATE_KEY"
  296. # Enables ReCaptcha checks when registering, preventing signup
  297. # unless a captcha is answered. Requires a valid ReCaptcha
  298. # public/private key.
  299. enable_registration_captcha: False
  300. # A secret key used to bypass the captcha test entirely.
  301. #captcha_bypass_secret: "YOUR_SECRET_HERE"
  302. # The API endpoint to use for verifying m.login.recaptcha responses.
  303. recaptcha_siteverify_api: "https://www.google.com/recaptcha/api/siteverify"
  304. ## Turn ##
  305. # The public URIs of the TURN server to give to clients
  306. turn_uris: []
  307. # The shared secret used to compute passwords for the TURN server
  308. turn_shared_secret: "YOUR_SHARED_SECRET"
  309. # The Username and password if the TURN server needs them and
  310. # does not use a token
  311. #turn_username: "TURNSERVER_USERNAME"
  312. #turn_password: "TURNSERVER_PASSWORD"
  313. # How long generated TURN credentials last
  314. turn_user_lifetime: "1h"
  315. # Whether guests should be allowed to use the TURN server.
  316. # This defaults to True, otherwise VoIP will be unreliable for guests.
  317. # However, it does introduce a slight security risk as it allows users to
  318. # connect to arbitrary endpoints without having first signed up for a
  319. # valid account (e.g. by passing a CAPTCHA).
  320. turn_allow_guests: False
  321. ## Registration ##
  322. # Enable registration for new users.
  323. enable_registration: False
  324. # The user must provide all of the below types of 3PID when registering.
  325. #
  326. # registrations_require_3pid:
  327. # - email
  328. # - msisdn
  329. # Mandate that users are only allowed to associate certain formats of
  330. # 3PIDs with accounts on this server.
  331. #
  332. # allowed_local_3pids:
  333. # - medium: email
  334. # pattern: ".*@matrix\.org"
  335. # - medium: email
  336. # pattern: ".*@vector\.im"
  337. # - medium: msisdn
  338. # pattern: "\+44"
  339. # If set, allows registration by anyone who also has the shared
  340. # secret, even if registration is otherwise disabled.
  341. # registration_shared_secret: <PRIVATE STRING>
  342. # Set the number of bcrypt rounds used to generate password hash.
  343. # Larger numbers increase the work factor needed to generate the hash.
  344. # The default number is 12 (which equates to 2^12 rounds).
  345. # N.B. that increasing this will exponentially increase the time required
  346. # to register or login - e.g. 24 => 2^24 rounds which will take >20 mins.
  347. bcrypt_rounds: 12
  348. # Allows users to register as guests without a password/email/etc, and
  349. # participate in rooms hosted on this server which have been made
  350. # accessible to anonymous users.
  351. allow_guest_access: False
  352. # The list of identity servers trusted to verify third party
  353. # identifiers by this server.
  354. trusted_third_party_id_servers:
  355. - matrix.org
  356. - vector.im
  357. - riot.im
  358. # Users who register on this homeserver will automatically be joined
  359. # to these rooms
  360. #auto_join_rooms:
  361. # - "#example:example.com"
  362. ## Metrics ###
  363. # Enable collection and rendering of performance metrics
  364. enable_metrics: False
  365. ## API Configuration ##
  366. # A list of event types that will be included in the room_invite_state
  367. room_invite_state_types:
  368. - "m.room.join_rules"
  369. - "m.room.canonical_alias"
  370. - "m.room.avatar"
  371. - "m.room.name"
  372. # A list of application service config file to use
  373. app_service_config_files: []
  374. # macaroon_secret_key: <PRIVATE STRING>
  375. # Used to enable access token expiration.
  376. expire_access_token: False
  377. ## Signing Keys ##
  378. # Path to the signing key to sign messages with
  379. signing_key_path: "/etc/matrix-synapse/homeserver.signing.key"
  380. # The keys that the server used to sign messages with but won't use
  381. # to sign new messages. E.g. it has lost its private key
  382. old_signing_keys: {}
  383. # "ed25519:auto":
  384. # # Base64 encoded public key
  385. # key: "The public part of your old signing key."
  386. # # Millisecond POSIX timestamp when the key expired.
  387. # expired_ts: 123456789123
  388. # How long key response published by this server is valid for.
  389. # Used to set the valid_until_ts in /key/v2 APIs.
  390. # Determines how quickly servers will query to check which keys
  391. # are still valid.
  392. key_refresh_interval: "1d" # 1 Day.
  393. # The trusted servers to download signing keys from.
  394. perspectives:
  395. servers:
  396. "matrix.org":
  397. verify_keys:
  398. "ed25519:auto":
  399. key: "Noi6WqcDj0QmPxCNQqgezwTlBKrfqehY1u2FyWP9uYw"
  400. # Enable SAML2 for registration and login. Uses pysaml2
  401. # config_path: Path to the sp_conf.py configuration file
  402. # idp_redirect_url: Identity provider URL which will redirect
  403. # the user back to /login/saml2 with proper info.
  404. # See pysaml2 docs for format of config.
  405. #saml2_config:
  406. # enabled: true
  407. # config_path: "/home/erikj/git/synapse/sp_conf.py"
  408. # idp_redirect_url: "http://test/idp"
  409. # Enable CAS for registration and login.
  410. #cas_config:
  411. # enabled: true
  412. # server_url: "https://cas-server.com"
  413. # service_url: "https://homeserver.domain.com:8448"
  414. # #required_attributes:
  415. # # name: value
  416. # The JWT needs to contain a globally unique "sub" (subject) claim.
  417. #
  418. # jwt_config:
  419. # enabled: true
  420. # secret: "a secret"
  421. # algorithm: "HS256"
  422. # Enable password for login.
  423. password_config:
  424. enabled: true
  425. # Uncomment and change to a secret random string for extra security.
  426. # DO NOT CHANGE THIS AFTER INITIAL SETUP!
  427. #pepper: ""
  428. # Enable sending emails for notification events
  429. # Defining a custom URL for Riot is only needed if email notifications
  430. # should contain links to a self-hosted installation of Riot; when set
  431. # the "app_name" setting is ignored.
  432. #
  433. # If your SMTP server requires authentication, the optional smtp_user &
  434. # smtp_pass variables should be used
  435. #
  436. #email:
  437. # enable_notifs: false
  438. # smtp_host: "localhost"
  439. # smtp_port: 25
  440. # smtp_user: "exampleusername"
  441. # smtp_pass: "examplepassword"
  442. # require_transport_security: False
  443. # notif_from: "Your Friendly %(app)s Home Server <noreply@example.com>"
  444. # app_name: Matrix
  445. # template_dir: res/templates
  446. # notif_template_html: notif_mail.html
  447. # notif_template_text: notif_mail.txt
  448. # notif_for_new_users: True
  449. # riot_base_url: "http://localhost/riot"
  450. # password_providers:
  451. # - module: "ldap_auth_provider.LdapAuthProvider"
  452. # config:
  453. # enabled: true
  454. # uri: "ldap://ldap.example.com:389"
  455. # start_tls: true
  456. # base: "ou=users,dc=example,dc=com"
  457. # attributes:
  458. # uid: "cn"
  459. # mail: "email"
  460. # name: "givenName"
  461. # #bind_dn:
  462. # #bind_password:
  463. # #filter: "(objectClass=posixAccount)"
  464. # Clients requesting push notifications can either have the body of
  465. # the message sent in the notification poke along with other details
  466. # like the sender, or just the event ID and room ID (`event_id_only`).
  467. # If clients choose the former, this option controls whether the
  468. # notification request includes the content of the event (other details
  469. # like the sender are still included). For `event_id_only` push, it
  470. # has no effect.
  471. # For modern android devices the notification content will still appear
  472. # because it is loaded by the app. iPhone, however will send a
  473. # notification saying only that a message arrived and who it came from.
  474. #
  475. #push:
  476. # include_content: true
  477. # spam_checker:
  478. # module: "my_custom_project.SuperSpamChecker"
  479. # config:
  480. # example_option: 'things'
  481. # Whether to allow non server admins to create groups on this server
  482. enable_group_creation: false
  483. # If enabled, non server admins can only create groups with local parts
  484. # starting with this prefix
  485. # group_creation_prefix: "unofficial/"
  486. # User Directory configuration
  487. #
  488. # 'search_all_users' defines whether to search all users visible to your HS
  489. # when searching the user directory, rather than limiting to users visible
  490. # in public rooms. Defaults to false. If you set it True, you'll have to run
  491. # UPDATE user_directory_stream_pos SET stream_id = NULL;
  492. # on your database to tell it to rebuild the user_directory search indexes.
  493. #
  494. #user_directory:
  495. # search_all_users: false