You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

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