Matrix Docker Ansible eploy
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 

2442 řádky
87 KiB

  1. #jinja2: lstrip_blocks: "True"
  2. # Configuration file for Synapse.
  3. #
  4. # This is a YAML file: see [1] for a quick introduction. Note in particular
  5. # that *indentation is important*: all the elements of a list or dictionary
  6. # should have the same indentation.
  7. #
  8. # [1] https://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.html
  9. ## Server ##
  10. # The domain name of the server, with optional explicit port.
  11. # This is used by remote servers to connect to this server,
  12. # e.g. matrix.org, localhost:8080, etc.
  13. # This is also the last part of your UserID.
  14. #
  15. server_name: "{{ matrix_domain }}"
  16. # When running as a daemon, the file to store the pid in
  17. #
  18. pid_file: /homeserver.pid
  19. # The absolute URL to the web client which /_matrix/client will redirect
  20. # to if 'webclient' is configured under the 'listeners' configuration.
  21. #
  22. # This option can be also set to the filesystem path to the web client
  23. # which will be served at /_matrix/client/ if 'webclient' is configured
  24. # under the 'listeners' configuration, however this is a security risk:
  25. # https://github.com/matrix-org/synapse#security-note
  26. #
  27. #web_client_location: https://riot.example.com/
  28. # The public-facing base URL that clients use to access this HS
  29. # (not including _matrix/...). This is the same URL a user would
  30. # enter into the 'custom HS URL' field on their client. If you
  31. # use synapse with a reverse proxy, this should be the URL to reach
  32. # synapse via the proxy.
  33. #
  34. public_baseurl: https://{{ matrix_server_fqn_matrix }}/
  35. # Set the soft limit on the number of file descriptors synapse can use
  36. # Zero is used to indicate synapse should set the soft limit to the
  37. # hard limit.
  38. #
  39. #soft_file_limit: 0
  40. # Set to false to disable presence tracking on this homeserver.
  41. #
  42. use_presence: {{ matrix_synapse_use_presence|to_json }}
  43. # Whether to require authentication to retrieve profile data (avatars,
  44. # display names) of other users through the client API. Defaults to
  45. # 'false'. Note that profile data is also available via the federation
  46. # API, so this setting is of limited value if federation is enabled on
  47. # the server.
  48. #
  49. #require_auth_for_profile_requests: true
  50. # Uncomment to require a user to share a room with another user in order
  51. # to retrieve their profile information. Only checked on Client-Server
  52. # requests. Profile requests from other servers should be checked by the
  53. # requesting server. Defaults to 'false'.
  54. #
  55. #limit_profile_requests_to_users_who_share_rooms: true
  56. # If set to 'true', removes the need for authentication to access the server's
  57. # public rooms directory through the client API, meaning that anyone can
  58. # query the room directory. Defaults to 'false'.
  59. #
  60. allow_public_rooms_without_auth: {{ matrix_synapse_allow_public_rooms_without_auth|to_json }}
  61. # If set to 'true', allows any other homeserver to fetch the server's public
  62. # rooms directory via federation. Defaults to 'false'.
  63. #
  64. allow_public_rooms_over_federation: {{ matrix_synapse_allow_public_rooms_over_federation|to_json }}
  65. # The default room version for newly created rooms.
  66. #
  67. # Known room versions are listed here:
  68. # https://matrix.org/docs/spec/#complete-list-of-room-versions
  69. #
  70. # For example, for room version 1, default_room_version should be set
  71. # to "1".
  72. #
  73. default_room_version: {{ matrix_synapse_default_room_version|to_json }}
  74. # The GC threshold parameters to pass to `gc.set_threshold`, if defined
  75. #
  76. #gc_thresholds: [700, 10, 10]
  77. # Set the limit on the returned events in the timeline in the get
  78. # and sync operations. The default value is 100. -1 means no upper limit.
  79. #
  80. # Uncomment the following to increase the limit to 5000.
  81. #
  82. #filter_timeline_limit: 5000
  83. # Whether room invites to users on this server should be blocked
  84. # (except those sent by local server admins). The default is False.
  85. #
  86. #block_non_admin_invites: True
  87. # Room searching
  88. #
  89. # If disabled, new messages will not be indexed for searching and users
  90. # will receive errors when searching for messages. Defaults to enabled.
  91. #
  92. #enable_search: false
  93. # List of ports that Synapse should listen on, their purpose and their
  94. # configuration.
  95. #
  96. # Options for each listener include:
  97. #
  98. # port: the TCP port to bind to
  99. #
  100. # bind_addresses: a list of local addresses to listen on. The default is
  101. # 'all local interfaces'.
  102. #
  103. # type: the type of listener. Normally 'http', but other valid options are:
  104. # 'manhole' (see docs/manhole.md),
  105. # 'metrics' (see docs/metrics-howto.md),
  106. # 'replication' (see docs/workers.md).
  107. #
  108. # tls: set to true to enable TLS for this listener. Will use the TLS
  109. # key/cert specified in tls_private_key_path / tls_certificate_path.
  110. #
  111. # x_forwarded: Only valid for an 'http' listener. Set to true to use the
  112. # X-Forwarded-For header as the client IP. Useful when Synapse is
  113. # behind a reverse-proxy.
  114. #
  115. # resources: Only valid for an 'http' listener. A list of resources to host
  116. # on this port. Options for each resource are:
  117. #
  118. # names: a list of names of HTTP resources. See below for a list of
  119. # valid resource names.
  120. #
  121. # compress: set to true to enable HTTP compression for this resource.
  122. #
  123. # additional_resources: Only valid for an 'http' listener. A map of
  124. # additional endpoints which should be loaded via dynamic modules.
  125. #
  126. # Valid resource names are:
  127. #
  128. # client: the client-server API (/_matrix/client), and the synapse admin
  129. # API (/_synapse/admin). Also implies 'media' and 'static'.
  130. #
  131. # consent: user consent forms (/_matrix/consent). See
  132. # docs/consent_tracking.md.
  133. #
  134. # federation: the server-server API (/_matrix/federation). Also implies
  135. # 'media', 'keys', 'openid'
  136. #
  137. # keys: the key discovery API (/_matrix/keys).
  138. #
  139. # media: the media API (/_matrix/media).
  140. #
  141. # metrics: the metrics interface. See docs/metrics-howto.md.
  142. #
  143. # openid: OpenID authentication.
  144. #
  145. # replication: the HTTP replication API (/_synapse/replication). See
  146. # docs/workers.md.
  147. #
  148. # static: static resources under synapse/static (/_matrix/static). (Mostly
  149. # useful for 'fallback authentication'.)
  150. #
  151. # webclient: A web client. Requires web_client_location to be set.
  152. #
  153. listeners:
  154. {% if matrix_synapse_metrics_enabled %}
  155. - type: metrics
  156. port: {{ matrix_synapse_metrics_port }}
  157. bind_addresses:
  158. - '0.0.0.0'
  159. {% endif %}
  160. {% if matrix_synapse_federation_enabled and matrix_synapse_tls_federation_listener_enabled %}
  161. # TLS-enabled listener: for when matrix traffic is sent directly to synapse.
  162. - port: 8448
  163. tls: true
  164. bind_addresses: ['::']
  165. type: http
  166. x_forwarded: false
  167. resources:
  168. - names: [federation]
  169. compress: false
  170. {% endif %}
  171. # Unsecure HTTP listener (Client API): for when matrix traffic passes through a reverse proxy
  172. # that unwraps TLS.
  173. - port: 8008
  174. tls: false
  175. bind_addresses: ['::']
  176. type: http
  177. x_forwarded: true
  178. resources:
  179. - names: {{ matrix_synapse_http_listener_resource_names|to_json }}
  180. compress: false
  181. {% if matrix_synapse_federation_enabled %}
  182. # Unsecure HTTP listener (Federation API): for when matrix traffic passes through a reverse proxy
  183. # that unwraps TLS.
  184. - port: 8048
  185. tls: false
  186. bind_addresses: ['::']
  187. type: http
  188. x_forwarded: true
  189. resources:
  190. - names: [federation]
  191. compress: false
  192. {% endif %}
  193. {% if matrix_synapse_manhole_enabled %}
  194. # Turn on the twisted ssh manhole service on localhost on the given
  195. # port.
  196. - port: 9000
  197. bind_addresses: ['0.0.0.0']
  198. type: manhole
  199. {% endif %}
  200. # Forward extremities can build up in a room due to networking delays between
  201. # homeservers. Once this happens in a large room, calculation of the state of
  202. # that room can become quite expensive. To mitigate this, once the number of
  203. # forward extremities reaches a given threshold, Synapse will send an
  204. # org.matrix.dummy_event event, which will reduce the forward extremities
  205. # in the room.
  206. #
  207. # This setting defines the threshold (i.e. number of forward extremities in the
  208. # room) at which dummy events are sent. The default value is 10.
  209. #
  210. #dummy_events_threshold: 5
  211. ## Homeserver blocking ##
  212. # How to reach the server admin, used in ResourceLimitError
  213. #
  214. #admin_contact: 'mailto:admin@server.com'
  215. # Global blocking
  216. #
  217. #hs_disabled: False
  218. #hs_disabled_message: 'Human readable reason for why the HS is blocked'
  219. #hs_disabled_limit_type: 'error code(str), to help clients decode reason'
  220. # Monthly Active User Blocking
  221. #
  222. # Used in cases where the admin or server owner wants to limit to the
  223. # number of monthly active users.
  224. #
  225. # 'limit_usage_by_mau' disables/enables monthly active user blocking. When
  226. # enabled and a limit is reached the server returns a 'ResourceLimitError'
  227. # with error type Codes.RESOURCE_LIMIT_EXCEEDED
  228. #
  229. # 'max_mau_value' is the hard limit of monthly active users above which
  230. # the server will start blocking user actions.
  231. #
  232. # 'mau_trial_days' is a means to add a grace period for active users. It
  233. # means that users must be active for this number of days before they
  234. # can be considered active and guards against the case where lots of users
  235. # sign up in a short space of time never to return after their initial
  236. # session.
  237. #
  238. #limit_usage_by_mau: False
  239. #max_mau_value: 50
  240. #mau_trial_days: 2
  241. # If enabled, the metrics for the number of monthly active users will
  242. # be populated, however no one will be limited. If limit_usage_by_mau
  243. # is true, this is implied to be true.
  244. #
  245. #mau_stats_only: False
  246. # Sometimes the server admin will want to ensure certain accounts are
  247. # never blocked by mau checking. These accounts are specified here.
  248. #
  249. #mau_limit_reserved_threepids:
  250. # - medium: 'email'
  251. # address: 'reserved_user@example.com'
  252. # Used by phonehome stats to group together related servers.
  253. #server_context: context
  254. # Resource-constrained homeserver settings
  255. #
  256. # When this is enabled, the room "complexity" will be checked before a user
  257. # joins a new remote room. If it is above the complexity limit, the server will
  258. # disallow joining, or will instantly leave.
  259. #
  260. # Room complexity is an arbitrary measure based on factors such as the number of
  261. # users in the room.
  262. #
  263. limit_remote_rooms:
  264. # Uncomment to enable room complexity checking.
  265. #
  266. #enabled: true
  267. # the limit above which rooms cannot be joined. The default is 1.0.
  268. #
  269. #complexity: 0.5
  270. # override the error which is returned when the room is too complex.
  271. #
  272. #complexity_error: "This room is too complex."
  273. # allow server admins to join complex rooms. Default is false.
  274. #
  275. #admins_can_join: true
  276. # Whether to require a user to be in the room to add an alias to it.
  277. # Defaults to 'true'.
  278. #
  279. #require_membership_for_aliases: false
  280. # Whether to allow per-room membership profiles through the send of membership
  281. # events with profile information that differ from the target's global profile.
  282. # Defaults to 'true'.
  283. #
  284. #allow_per_room_profiles: false
  285. # How long to keep redacted events in unredacted form in the database. After
  286. # this period redacted events get replaced with their redacted form in the DB.
  287. #
  288. # Defaults to `7d`. Set to `null` to disable.
  289. #
  290. #redaction_retention_period: 28d
  291. redaction_retention_period: {{ matrix_synapse_redaction_retention_period }}
  292. # How long to track users' last seen time and IPs in the database.
  293. #
  294. # Defaults to `28d`. Set to `null` to disable clearing out of old rows.
  295. #
  296. #user_ips_max_age: 14d
  297. user_ips_max_age: {{ matrix_synapse_user_ips_max_age }}
  298. # Message retention policy at the server level.
  299. #
  300. # Room admins and mods can define a retention period for their rooms using the
  301. # 'm.room.retention' state event, and server admins can cap this period by setting
  302. # the 'allowed_lifetime_min' and 'allowed_lifetime_max' config options.
  303. #
  304. # If this feature is enabled, Synapse will regularly look for and purge events
  305. # which are older than the room's maximum retention period. Synapse will also
  306. # filter events received over federation so that events that should have been
  307. # purged are ignored and not stored again.
  308. #
  309. retention:
  310. # The message retention policies feature is disabled by default. Uncomment the
  311. # following line to enable it.
  312. #
  313. #enabled: true
  314. # Default retention policy. If set, Synapse will apply it to rooms that lack the
  315. # 'm.room.retention' state event. Currently, the value of 'min_lifetime' doesn't
  316. # matter much because Synapse doesn't take it into account yet.
  317. #
  318. #default_policy:
  319. # min_lifetime: 1d
  320. # max_lifetime: 1y
  321. # Retention policy limits. If set, a user won't be able to send a
  322. # 'm.room.retention' event which features a 'min_lifetime' or a 'max_lifetime'
  323. # that's not within this range. This is especially useful in closed federations,
  324. # in which server admins can make sure every federating server applies the same
  325. # rules.
  326. #
  327. #allowed_lifetime_min: 1d
  328. #allowed_lifetime_max: 1y
  329. # Server admins can define the settings of the background jobs purging the
  330. # events which lifetime has expired under the 'purge_jobs' section.
  331. #
  332. # If no configuration is provided, a single job will be set up to delete expired
  333. # events in every room daily.
  334. #
  335. # Each job's configuration defines which range of message lifetimes the job
  336. # takes care of. For example, if 'shortest_max_lifetime' is '2d' and
  337. # 'longest_max_lifetime' is '3d', the job will handle purging expired events in
  338. # rooms whose state defines a 'max_lifetime' that's both higher than 2 days, and
  339. # lower than or equal to 3 days. Both the minimum and the maximum value of a
  340. # range are optional, e.g. a job with no 'shortest_max_lifetime' and a
  341. # 'longest_max_lifetime' of '3d' will handle every room with a retention policy
  342. # which 'max_lifetime' is lower than or equal to three days.
  343. #
  344. # The rationale for this per-job configuration is that some rooms might have a
  345. # retention policy with a low 'max_lifetime', where history needs to be purged
  346. # of outdated messages on a more frequent basis than for the rest of the rooms
  347. # (e.g. every 12h), but not want that purge to be performed by a job that's
  348. # iterating over every room it knows, which could be heavy on the server.
  349. #
  350. #purge_jobs:
  351. # - shortest_max_lifetime: 1d
  352. # longest_max_lifetime: 3d
  353. # interval: 12h
  354. # - shortest_max_lifetime: 3d
  355. # longest_max_lifetime: 1y
  356. # interval: 1d
  357. # Inhibits the /requestToken endpoints from returning an error that might leak
  358. # information about whether an e-mail address is in use or not on this
  359. # homeserver.
  360. # Note that for some endpoints the error situation is the e-mail already being
  361. # used, and for others the error is entering the e-mail being unused.
  362. # If this option is enabled, instead of returning an error, these endpoints will
  363. # act as if no error happened and return a fake session ID ('sid') to clients.
  364. #
  365. #request_token_inhibit_3pid_errors: true
  366. ## TLS ##
  367. # PEM-encoded X509 certificate for TLS.
  368. # This certificate, as of Synapse 1.0, will need to be a valid and verifiable
  369. # certificate, signed by a recognised Certificate Authority.
  370. #
  371. # See 'ACME support' below to enable auto-provisioning this certificate via
  372. # Let's Encrypt.
  373. #
  374. # If supplying your own, be sure to use a `.pem` file that includes the
  375. # full certificate chain including any intermediate certificates (for
  376. # instance, if using certbot, use `fullchain.pem` as your certificate,
  377. # not `cert.pem`).
  378. #
  379. tls_certificate_path: {{ matrix_synapse_tls_certificate_path|to_json }}
  380. # PEM-encoded private key for TLS
  381. #
  382. tls_private_key_path: {{ matrix_synapse_tls_private_key_path|to_json }}
  383. # Whether to verify TLS server certificates for outbound federation requests.
  384. #
  385. # Defaults to `true`. To disable certificate verification, uncomment the
  386. # following line.
  387. #
  388. #federation_verify_certificates: false
  389. # The minimum TLS version that will be used for outbound federation requests.
  390. #
  391. # Defaults to `1`. Configurable to `1`, `1.1`, `1.2`, or `1.3`. Note
  392. # that setting this value higher than `1.2` will prevent federation to most
  393. # of the public Matrix network: only configure it to `1.3` if you have an
  394. # entirely private federation setup and you can ensure TLS 1.3 support.
  395. #
  396. #federation_client_minimum_tls_version: 1.2
  397. # Skip federation certificate verification on the following whitelist
  398. # of domains.
  399. #
  400. # This setting should only be used in very specific cases, such as
  401. # federation over Tor hidden services and similar. For private networks
  402. # of homeservers, you likely want to use a private CA instead.
  403. #
  404. # Only effective if federation_verify_certicates is `true`.
  405. #
  406. #federation_certificate_verification_whitelist:
  407. # - lon.example.com
  408. # - *.domain.com
  409. # - *.onion
  410. # List of custom certificate authorities for federation traffic.
  411. #
  412. # This setting should only normally be used within a private network of
  413. # homeservers.
  414. #
  415. # Note that this list will replace those that are provided by your
  416. # operating environment. Certificates must be in PEM format.
  417. #
  418. #federation_custom_ca_list:
  419. # - myCA1.pem
  420. # - myCA2.pem
  421. # - myCA3.pem
  422. # ACME support: This will configure Synapse to request a valid TLS certificate
  423. # for your configured `server_name` via Let's Encrypt.
  424. #
  425. # Note that ACME v1 is now deprecated, and Synapse currently doesn't support
  426. # ACME v2. This means that this feature currently won't work with installs set
  427. # up after November 2019. For more info, and alternative solutions, see
  428. # https://github.com/matrix-org/synapse/blob/master/docs/ACME.md#deprecation-of-acme-v1
  429. #
  430. # Note that provisioning a certificate in this way requires port 80 to be
  431. # routed to Synapse so that it can complete the http-01 ACME challenge.
  432. # By default, if you enable ACME support, Synapse will attempt to listen on
  433. # port 80 for incoming http-01 challenges - however, this will likely fail
  434. # with 'Permission denied' or a similar error.
  435. #
  436. # There are a couple of potential solutions to this:
  437. #
  438. # * If you already have an Apache, Nginx, or similar listening on port 80,
  439. # you can configure Synapse to use an alternate port, and have your web
  440. # server forward the requests. For example, assuming you set 'port: 8009'
  441. # below, on Apache, you would write:
  442. #
  443. # ProxyPass /.well-known/acme-challenge http://localhost:8009/.well-known/acme-challenge
  444. #
  445. # * Alternatively, you can use something like `authbind` to give Synapse
  446. # permission to listen on port 80.
  447. #
  448. acme:
  449. # ACME support is disabled by default. Uncomment the following line
  450. # (and tls_certificate_path and tls_private_key_path above) to enable it.
  451. #
  452. #enabled: true
  453. # Endpoint to use to request certificates. If you only want to test,
  454. # use Let's Encrypt's staging url:
  455. # https://acme-staging.api.letsencrypt.org/directory
  456. #
  457. #url: https://acme-v01.api.letsencrypt.org/directory
  458. # Port number to listen on for the HTTP-01 challenge. Change this if
  459. # you are forwarding connections through Apache/Nginx/etc.
  460. #
  461. #port: 80
  462. # Local addresses to listen on for incoming connections.
  463. # Again, you may want to change this if you are forwarding connections
  464. # through Apache/Nginx/etc.
  465. #
  466. #bind_addresses: ['::', '0.0.0.0']
  467. # How many days remaining on a certificate before it is renewed.
  468. #
  469. #reprovision_threshold: 30
  470. # The domain that the certificate should be for. Normally this
  471. # should be the same as your Matrix domain (i.e., 'server_name'), but,
  472. # by putting a file at 'https://<server_name>/.well-known/matrix/server',
  473. # you can delegate incoming traffic to another server. If you do that,
  474. # you should give the target of the delegation here.
  475. #
  476. # For example: if your 'server_name' is 'example.com', but
  477. # 'https://example.com/.well-known/matrix/server' delegates to
  478. # 'matrix.example.com', you should put 'matrix.example.com' here.
  479. #
  480. # If not set, defaults to your 'server_name'.
  481. #
  482. #domain: matrix.example.com
  483. # file to use for the account key. This will be generated if it doesn't
  484. # exist.
  485. #
  486. # If unspecified, we will use CONFDIR/client.key.
  487. #
  488. #account_key_file: /data/acme_account.key
  489. # List of allowed TLS fingerprints for this server to publish along
  490. # with the signing keys for this server. Other matrix servers that
  491. # make HTTPS requests to this server will check that the TLS
  492. # certificates returned by this server match one of the fingerprints.
  493. #
  494. # Synapse automatically adds the fingerprint of its own certificate
  495. # to the list. So if federation traffic is handled directly by synapse
  496. # then no modification to the list is required.
  497. #
  498. # If synapse is run behind a load balancer that handles the TLS then it
  499. # will be necessary to add the fingerprints of the certificates used by
  500. # the loadbalancers to this list if they are different to the one
  501. # synapse is using.
  502. #
  503. # Homeservers are permitted to cache the list of TLS fingerprints
  504. # returned in the key responses up to the "valid_until_ts" returned in
  505. # key. It may be necessary to publish the fingerprints of a new
  506. # certificate and wait until the "valid_until_ts" of the previous key
  507. # responses have passed before deploying it.
  508. #
  509. # You can calculate a fingerprint from a given TLS listener via:
  510. # openssl s_client -connect $host:$port < /dev/null 2> /dev/null |
  511. # openssl x509 -outform DER | openssl sha256 -binary | base64 | tr -d '='
  512. # or by checking matrix.org/federationtester/api/report?server_name=$host
  513. #
  514. #tls_fingerprints: [{"sha256": "<base64_encoded_sha256_fingerprint>"}]
  515. # Restrict federation to the following whitelist of domains.
  516. # N.B. we recommend also firewalling your federation listener to limit
  517. # inbound federation traffic as early as possible, rather than relying
  518. # purely on this application-layer restriction. If not specified, the
  519. # default is to whitelist everything.
  520. #
  521. #federation_domain_whitelist:
  522. # - lon.example.com
  523. # - nyc.example.com
  524. # - syd.example.com
  525. {% if matrix_synapse_federation_domain_whitelist is not none %}
  526. {# Cannot use `|to_nice_yaml` here, as an empty list does not get serialized properly by it. #}
  527. federation_domain_whitelist: {{ matrix_synapse_federation_domain_whitelist|to_json }}
  528. {% endif %}
  529. # Prevent federation requests from being sent to the following
  530. # blacklist IP address CIDR ranges. If this option is not specified, or
  531. # specified with an empty list, no ip range blacklist will be enforced.
  532. #
  533. # As of Synapse v1.4.0 this option also affects any outbound requests to identity
  534. # servers provided by user input.
  535. #
  536. # (0.0.0.0 and :: are always blacklisted, whether or not they are explicitly
  537. # listed here, since they correspond to unroutable addresses.)
  538. #
  539. federation_ip_range_blacklist:
  540. - '127.0.0.0/8'
  541. - '10.0.0.0/8'
  542. - '172.16.0.0/12'
  543. - '192.168.0.0/16'
  544. - '100.64.0.0/10'
  545. - '169.254.0.0/16'
  546. - '::1/128'
  547. - 'fe80::/64'
  548. - 'fc00::/7'
  549. ## Caching ##
  550. # Caching can be configured through the following options.
  551. #
  552. # A cache 'factor' is a multiplier that can be applied to each of
  553. # Synapse's caches in order to increase or decrease the maximum
  554. # number of entries that can be stored.
  555. # The number of events to cache in memory. Not affected by
  556. # caches.global_factor.
  557. #
  558. event_cache_size: "{{ matrix_synapse_event_cache_size }}"
  559. caches:
  560. # Controls the global cache factor, which is the default cache factor
  561. # for all caches if a specific factor for that cache is not otherwise
  562. # set.
  563. #
  564. # This can also be set by the "SYNAPSE_CACHE_FACTOR" environment
  565. # variable. Setting by environment variable takes priority over
  566. # setting through the config file.
  567. #
  568. # Defaults to 0.5, which will half the size of all caches.
  569. #
  570. global_factor: {{ matrix_synapse_caches_global_factor }}
  571. # A dictionary of cache name to cache factor for that individual
  572. # cache. Overrides the global cache factor for a given cache.
  573. #
  574. # These can also be set through environment variables comprised
  575. # of "SYNAPSE_CACHE_FACTOR_" + the name of the cache in capital
  576. # letters and underscores. Setting by environment variable
  577. # takes priority over setting through the config file.
  578. # Ex. SYNAPSE_CACHE_FACTOR_GET_USERS_WHO_SHARE_ROOM_WITH_USER=2.0
  579. #
  580. # Some caches have '*' and other characters that are not
  581. # alphanumeric or underscores. These caches can be named with or
  582. # without the special characters stripped. For example, to specify
  583. # the cache factor for `*stateGroupCache*` via an environment
  584. # variable would be `SYNAPSE_CACHE_FACTOR_STATEGROUPCACHE=2.0`.
  585. #
  586. per_cache_factors:
  587. #get_users_who_share_room_with_user: 2.0
  588. ## Database ##
  589. database:
  590. # The database engine name
  591. name: "psycopg2"
  592. args:
  593. user: {{ matrix_synapse_database_user|string|to_json }}
  594. password: {{ matrix_synapse_database_password|string|to_json }}
  595. database: "{{ matrix_synapse_database_database }}"
  596. host: "{{ matrix_synapse_database_host }}"
  597. cp_min: 5
  598. cp_max: 10
  599. ## Logging ##
  600. # A yaml python logging config file as described by
  601. # https://docs.python.org/3.7/library/logging.config.html#configuration-dictionary-schema
  602. #
  603. log_config: "/data/{{ matrix_server_fqn_matrix }}.log.config"
  604. ## Ratelimiting ##
  605. # Ratelimiting settings for client actions (registration, login, messaging).
  606. #
  607. # Each ratelimiting configuration is made of two parameters:
  608. # - per_second: number of requests a client can send per second.
  609. # - burst_count: number of requests a client can send before being throttled.
  610. #
  611. # Synapse currently uses the following configurations:
  612. # - one for messages that ratelimits sending based on the account the client
  613. # is using
  614. # - one for registration that ratelimits registration requests based on the
  615. # client's IP address.
  616. # - one for login that ratelimits login requests based on the client's IP
  617. # address.
  618. # - one for login that ratelimits login requests based on the account the
  619. # client is attempting to log into.
  620. # - one for login that ratelimits login requests based on the account the
  621. # client is attempting to log into, based on the amount of failed login
  622. # attempts for this account.
  623. # - one for ratelimiting redactions by room admins. If this is not explicitly
  624. # set then it uses the same ratelimiting as per rc_message. This is useful
  625. # to allow room admins to deal with abuse quickly.
  626. # - two for ratelimiting number of rooms a user can join, "local" for when
  627. # users are joining rooms the server is already in (this is cheap) vs
  628. # "remote" for when users are trying to join rooms not on the server (which
  629. # can be more expensive)
  630. #
  631. # The defaults are as shown below.
  632. #
  633. #rc_message:
  634. # per_second: 0.2
  635. # burst_count: 10
  636. rc_message: {{ matrix_synapse_rc_message|to_json }}
  637. #
  638. #rc_registration:
  639. # per_second: 0.17
  640. # burst_count: 3
  641. rc_registration: {{ matrix_synapse_rc_registration|to_json }}
  642. #
  643. #rc_login:
  644. # address:
  645. # per_second: 0.17
  646. # burst_count: 3
  647. # account:
  648. # per_second: 0.17
  649. # burst_count: 3
  650. # failed_attempts:
  651. # per_second: 0.17
  652. # burst_count: 3
  653. rc_login: {{ matrix_synapse_rc_login|to_json }}
  654. #
  655. #rc_admin_redaction:
  656. # per_second: 1
  657. # burst_count: 50
  658. #
  659. #rc_joins:
  660. # local:
  661. # per_second: 0.1
  662. # burst_count: 3
  663. # remote:
  664. # per_second: 0.01
  665. # burst_count: 3
  666. # Ratelimiting settings for incoming federation
  667. #
  668. # The rc_federation configuration is made up of the following settings:
  669. # - window_size: window size in milliseconds
  670. # - sleep_limit: number of federation requests from a single server in
  671. # a window before the server will delay processing the request.
  672. # - sleep_delay: duration in milliseconds to delay processing events
  673. # from remote servers by if they go over the sleep limit.
  674. # - reject_limit: maximum number of concurrent federation requests
  675. # allowed from a single server
  676. # - concurrent: number of federation requests to concurrently process
  677. # from a single server
  678. #
  679. # The defaults are as shown below.
  680. #
  681. #rc_federation:
  682. # window_size: 1000
  683. # sleep_limit: 10
  684. # sleep_delay: 500
  685. # reject_limit: 50
  686. # concurrent: 3
  687. rc_federation: {{ matrix_synapse_rc_federation|to_json }}
  688. # Target outgoing federation transaction frequency for sending read-receipts,
  689. # per-room.
  690. #
  691. # If we end up trying to send out more read-receipts, they will get buffered up
  692. # into fewer transactions.
  693. #
  694. #federation_rr_transactions_per_room_per_second: 50
  695. federation_rr_transactions_per_room_per_second: {{ matrix_synapse_federation_rr_transactions_per_room_per_second }}
  696. ## Media Store ##
  697. # Enable the media store service in the Synapse master. Uncomment the
  698. # following if you are using a separate media store worker.
  699. #
  700. #enable_media_repo: false
  701. # Directory where uploaded images and attachments are stored.
  702. #
  703. media_store_path: "/matrix-media-store-parent/{{ matrix_synapse_media_store_directory_name }}"
  704. # Media storage providers allow media to be stored in different
  705. # locations.
  706. #
  707. #media_storage_providers:
  708. # - module: file_system
  709. # # Whether to store newly uploaded local files
  710. # store_local: false
  711. # # Whether to store newly downloaded remote files
  712. # store_remote: false
  713. # # Whether to wait for successful storage for local uploads
  714. # store_synchronous: false
  715. # config:
  716. # directory: /mnt/some/other/directory
  717. # The largest allowed upload size in bytes
  718. #
  719. max_upload_size: "{{ matrix_synapse_max_upload_size_mb }}M"
  720. # Maximum number of pixels that will be thumbnailed
  721. #
  722. #max_image_pixels: 32M
  723. # Whether to generate new thumbnails on the fly to precisely match
  724. # the resolution requested by the client. If true then whenever
  725. # a new resolution is requested by the client the server will
  726. # generate a new thumbnail. If false the server will pick a thumbnail
  727. # from a precalculated list.
  728. #
  729. #dynamic_thumbnails: false
  730. # List of thumbnails to precalculate when an image is uploaded.
  731. #
  732. #thumbnail_sizes:
  733. # - width: 32
  734. # height: 32
  735. # method: crop
  736. # - width: 96
  737. # height: 96
  738. # method: crop
  739. # - width: 320
  740. # height: 240
  741. # method: scale
  742. # - width: 640
  743. # height: 480
  744. # method: scale
  745. # - width: 800
  746. # height: 600
  747. # method: scale
  748. # Is the preview URL API enabled?
  749. #
  750. # 'false' by default: uncomment the following to enable it (and specify a
  751. # url_preview_ip_range_blacklist blacklist).
  752. #
  753. url_preview_enabled: {{ matrix_synapse_url_preview_enabled|to_json }}
  754. # List of IP address CIDR ranges that the URL preview spider is denied
  755. # from accessing. There are no defaults: you must explicitly
  756. # specify a list for URL previewing to work. You should specify any
  757. # internal services in your network that you do not want synapse to try
  758. # to connect to, otherwise anyone in any Matrix room could cause your
  759. # synapse to issue arbitrary GET requests to your internal services,
  760. # causing serious security issues.
  761. #
  762. # (0.0.0.0 and :: are always blacklisted, whether or not they are explicitly
  763. # listed here, since they correspond to unroutable addresses.)
  764. #
  765. # This must be specified if url_preview_enabled is set. It is recommended that
  766. # you uncomment the following list as a starting point.
  767. #
  768. url_preview_ip_range_blacklist:
  769. - '127.0.0.0/8'
  770. - '10.0.0.0/8'
  771. - '172.16.0.0/12'
  772. - '192.168.0.0/16'
  773. - '100.64.0.0/10'
  774. - '169.254.0.0/16'
  775. - '::1/128'
  776. - 'fe80::/64'
  777. - 'fc00::/7'
  778. # List of IP address CIDR ranges that the URL preview spider is allowed
  779. # to access even if they are specified in url_preview_ip_range_blacklist.
  780. # This is useful for specifying exceptions to wide-ranging blacklisted
  781. # target IP ranges - e.g. for enabling URL previews for a specific private
  782. # website only visible in your network.
  783. #
  784. #url_preview_ip_range_whitelist:
  785. # - '192.168.1.1'
  786. # Optional list of URL matches that the URL preview spider is
  787. # denied from accessing. You should use url_preview_ip_range_blacklist
  788. # in preference to this, otherwise someone could define a public DNS
  789. # entry that points to a private IP address and circumvent the blacklist.
  790. # This is more useful if you know there is an entire shape of URL that
  791. # you know that will never want synapse to try to spider.
  792. #
  793. # Each list entry is a dictionary of url component attributes as returned
  794. # by urlparse.urlsplit as applied to the absolute form of the URL. See
  795. # https://docs.python.org/2/library/urlparse.html#urlparse.urlsplit
  796. # The values of the dictionary are treated as an filename match pattern
  797. # applied to that component of URLs, unless they start with a ^ in which
  798. # case they are treated as a regular expression match. If all the
  799. # specified component matches for a given list item succeed, the URL is
  800. # blacklisted.
  801. #
  802. #url_preview_url_blacklist:
  803. # # blacklist any URL with a username in its URI
  804. # - username: '*'
  805. #
  806. # # blacklist all *.google.com URLs
  807. # - netloc: 'google.com'
  808. # - netloc: '*.google.com'
  809. #
  810. # # blacklist all plain HTTP URLs
  811. # - scheme: 'http'
  812. #
  813. # # blacklist http(s)://www.acme.com/foo
  814. # - netloc: 'www.acme.com'
  815. # path: '/foo'
  816. #
  817. # # blacklist any URL with a literal IPv4 address
  818. # - netloc: '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$'
  819. # The largest allowed URL preview spidering size in bytes
  820. #
  821. max_spider_size: 10M
  822. # A list of values for the Accept-Language HTTP header used when
  823. # downloading webpages during URL preview generation. This allows
  824. # Synapse to specify the preferred languages that URL previews should
  825. # be in when communicating with remote servers.
  826. #
  827. # Each value is a IETF language tag; a 2-3 letter identifier for a
  828. # language, optionally followed by subtags separated by '-', specifying
  829. # a country or region variant.
  830. #
  831. # Multiple values can be provided, and a weight can be added to each by
  832. # using quality value syntax (;q=). '*' translates to any language.
  833. #
  834. # Defaults to "en".
  835. #
  836. # Example:
  837. #
  838. # url_preview_accept_language:
  839. # - en-UK
  840. # - en-US;q=0.9
  841. # - fr;q=0.8
  842. # - *;q=0.7
  843. #
  844. url_preview_accept_language:
  845. # - en
  846. ## Captcha ##
  847. # See docs/CAPTCHA_SETUP.md for full details of configuring this.
  848. # This homeserver's ReCAPTCHA public key. Must be specified if
  849. # enable_registration_captcha is enabled.
  850. #
  851. recaptcha_public_key: {{ matrix_synapse_recaptcha_public_key|to_json }}
  852. # This homeserver's ReCAPTCHA private key. Must be specified if
  853. # enable_registration_captcha is enabled.
  854. #
  855. recaptcha_private_key: {{ matrix_synapse_recaptcha_private_key|to_json }}
  856. # Uncomment to enable ReCaptcha checks when registering, preventing signup
  857. # unless a captcha is answered. Requires a valid ReCaptcha
  858. # public/private key. Defaults to 'false'.
  859. #
  860. enable_registration_captcha: {{ matrix_synapse_enable_registration_captcha|to_json }}
  861. # The API endpoint to use for verifying m.login.recaptcha responses.
  862. # Defaults to "https://www.recaptcha.net/recaptcha/api/siteverify".
  863. #
  864. #recaptcha_siteverify_api: "https://my.recaptcha.site"
  865. ## TURN ##
  866. # The public URIs of the TURN server to give to clients
  867. #
  868. turn_uris: {{ matrix_synapse_turn_uris|to_json }}
  869. # The shared secret used to compute passwords for the TURN server
  870. #
  871. turn_shared_secret: {{ matrix_synapse_turn_shared_secret|string|to_json }}
  872. # The Username and password if the TURN server needs them and
  873. # does not use a token
  874. #
  875. #turn_username: "TURNSERVER_USERNAME"
  876. #turn_password: "TURNSERVER_PASSWORD"
  877. # How long generated TURN credentials last
  878. #
  879. #turn_user_lifetime: 1h
  880. # Whether guests should be allowed to use the TURN server.
  881. # This defaults to True, otherwise VoIP will be unreliable for guests.
  882. # However, it does introduce a slight security risk as it allows users to
  883. # connect to arbitrary endpoints without having first signed up for a
  884. # valid account (e.g. by passing a CAPTCHA).
  885. #
  886. turn_allow_guests: {{ matrix_synapse_turn_allow_guests|to_json }}
  887. ## Registration ##
  888. #
  889. # Registration can be rate-limited using the parameters in the "Ratelimiting"
  890. # section of this file.
  891. # Enable registration for new users.
  892. #
  893. enable_registration: {{ matrix_synapse_enable_registration|to_json }}
  894. # Optional account validity configuration. This allows for accounts to be denied
  895. # any request after a given period.
  896. #
  897. # Once this feature is enabled, Synapse will look for registered users without an
  898. # expiration date at startup and will add one to every account it found using the
  899. # current settings at that time.
  900. # This means that, if a validity period is set, and Synapse is restarted (it will
  901. # then derive an expiration date from the current validity period), and some time
  902. # after that the validity period changes and Synapse is restarted, the users'
  903. # expiration dates won't be updated unless their account is manually renewed. This
  904. # date will be randomly selected within a range [now + period - d ; now + period],
  905. # where d is equal to 10% of the validity period.
  906. #
  907. account_validity:
  908. # The account validity feature is disabled by default. Uncomment the
  909. # following line to enable it.
  910. #
  911. #enabled: true
  912. # The period after which an account is valid after its registration. When
  913. # renewing the account, its validity period will be extended by this amount
  914. # of time. This parameter is required when using the account validity
  915. # feature.
  916. #
  917. #period: 6w
  918. # The amount of time before an account's expiry date at which Synapse will
  919. # send an email to the account's email address with a renewal link. By
  920. # default, no such emails are sent.
  921. #
  922. # If you enable this setting, you will also need to fill out the 'email' and
  923. # 'public_baseurl' configuration sections.
  924. #
  925. #renew_at: 1w
  926. # The subject of the email sent out with the renewal link. '%(app)s' can be
  927. # used as a placeholder for the 'app_name' parameter from the 'email'
  928. # section.
  929. #
  930. # Note that the placeholder must be written '%(app)s', including the
  931. # trailing 's'.
  932. #
  933. # If this is not set, a default value is used.
  934. #
  935. #renew_email_subject: "Renew your %(app)s account"
  936. # Directory in which Synapse will try to find templates for the HTML files to
  937. # serve to the user when trying to renew an account. If not set, default
  938. # templates from within the Synapse package will be used.
  939. #
  940. #template_dir: "res/templates"
  941. # File within 'template_dir' giving the HTML to be displayed to the user after
  942. # they successfully renewed their account. If not set, default text is used.
  943. #
  944. #account_renewed_html_path: "account_renewed.html"
  945. # File within 'template_dir' giving the HTML to be displayed when the user
  946. # tries to renew an account with an invalid renewal token. If not set,
  947. # default text is used.
  948. #
  949. #invalid_token_html_path: "invalid_token.html"
  950. # The user must provide all of the below types of 3PID when registering.
  951. #
  952. #registrations_require_3pid:
  953. # - email
  954. # - msisdn
  955. {% if matrix_synapse_registrations_require_3pid|length > 0 %}
  956. registrations_require_3pid: {{ matrix_synapse_registrations_require_3pid|to_json }}
  957. {% endif %}
  958. # Explicitly disable asking for MSISDNs from the registration
  959. # flow (overrides registrations_require_3pid if MSISDNs are set as required)
  960. #
  961. #disable_msisdn_registration: true
  962. # Mandate that users are only allowed to associate certain formats of
  963. # 3PIDs with accounts on this server.
  964. #
  965. #allowed_local_3pids:
  966. # - medium: email
  967. # pattern: '.*@matrix\.org'
  968. # - medium: email
  969. # pattern: '.*@vector\.im'
  970. # - medium: msisdn
  971. # pattern: '\+44'
  972. {% if matrix_synapse_allowed_local_3pids|length > 0 %}
  973. allowed_local_3pids: {{ matrix_synapse_allowed_local_3pids|to_json }}
  974. {% endif %}
  975. # Enable 3PIDs lookup requests to identity servers from this server.
  976. #
  977. #enable_3pid_lookup: true
  978. # If set, allows registration of standard or admin accounts by anyone who
  979. # has the shared secret, even if registration is otherwise disabled.
  980. #
  981. registration_shared_secret: {{ matrix_synapse_registration_shared_secret|string|to_json }}
  982. # Set the number of bcrypt rounds used to generate password hash.
  983. # Larger numbers increase the work factor needed to generate the hash.
  984. # The default number is 12 (which equates to 2^12 rounds).
  985. # N.B. that increasing this will exponentially increase the time required
  986. # to register or login - e.g. 24 => 2^24 rounds which will take >20 mins.
  987. #
  988. #bcrypt_rounds: 12
  989. # Allows users to register as guests without a password/email/etc, and
  990. # participate in rooms hosted on this server which have been made
  991. # accessible to anonymous users.
  992. #
  993. allow_guest_access: {{ matrix_synapse_allow_guest_access|to_json }}
  994. # The identity server which we suggest that clients should use when users log
  995. # in on this server.
  996. #
  997. # (By default, no suggestion is made, so it is left up to the client.
  998. # This setting is ignored unless public_baseurl is also set.)
  999. #
  1000. #default_identity_server: https://matrix.org
  1001. # Handle threepid (email/phone etc) registration and password resets through a set of
  1002. # *trusted* identity servers. Note that this allows the configured identity server to
  1003. # reset passwords for accounts!
  1004. #
  1005. # Be aware that if `email` is not set, and SMTP options have not been
  1006. # configured in the email config block, registration and user password resets via
  1007. # email will be globally disabled.
  1008. #
  1009. # Additionally, if `msisdn` is not set, registration and password resets via msisdn
  1010. # will be disabled regardless. This is due to Synapse currently not supporting any
  1011. # method of sending SMS messages on its own.
  1012. #
  1013. # To enable using an identity server for operations regarding a particular third-party
  1014. # identifier type, set the value to the URL of that identity server as shown in the
  1015. # examples below.
  1016. #
  1017. # Servers handling the these requests must answer the `/requestToken` endpoints defined
  1018. # by the Matrix Identity Service API specification:
  1019. # https://matrix.org/docs/spec/identity_service/latest
  1020. #
  1021. # If a delegate is specified, the config option public_baseurl must also be filled out.
  1022. #
  1023. account_threepid_delegates:
  1024. email: {{ matrix_synapse_account_threepid_delegates_email|to_json }}
  1025. msisdn: {{ matrix_synapse_account_threepid_delegates_msisdn|to_json }}
  1026. # Whether users are allowed to change their displayname after it has
  1027. # been initially set. Useful when provisioning users based on the
  1028. # contents of a third-party directory.
  1029. #
  1030. # Does not apply to server administrators. Defaults to 'true'
  1031. #
  1032. #enable_set_displayname: false
  1033. # Whether users are allowed to change their avatar after it has been
  1034. # initially set. Useful when provisioning users based on the contents
  1035. # of a third-party directory.
  1036. #
  1037. # Does not apply to server administrators. Defaults to 'true'
  1038. #
  1039. #enable_set_avatar_url: false
  1040. # Whether users can change the 3PIDs associated with their accounts
  1041. # (email address and msisdn).
  1042. #
  1043. # Defaults to 'true'
  1044. #
  1045. #enable_3pid_changes: false
  1046. # Users who register on this homeserver will automatically be joined
  1047. # to these rooms.
  1048. #
  1049. # By default, any room aliases included in this list will be created
  1050. # as a publicly joinable room when the first user registers for the
  1051. # homeserver. This behaviour can be customised with the settings below.
  1052. #
  1053. #auto_join_rooms:
  1054. # - "#example:example.com"
  1055. {% if matrix_synapse_auto_join_rooms|length > 0 %}
  1056. auto_join_rooms:
  1057. {{ matrix_synapse_auto_join_rooms|to_nice_yaml }}
  1058. {% endif %}
  1059. # Where auto_join_rooms are specified, setting this flag ensures that the
  1060. # the rooms exist by creating them when the first user on the
  1061. # homeserver registers.
  1062. #
  1063. # By default the auto-created rooms are publicly joinable from any federated
  1064. # server. Use the autocreate_auto_join_rooms_federated and
  1065. # autocreate_auto_join_room_preset settings below to customise this behaviour.
  1066. #
  1067. # Setting to false means that if the rooms are not manually created,
  1068. # users cannot be auto-joined since they do not exist.
  1069. #
  1070. # Defaults to true. Uncomment the following line to disable automatically
  1071. # creating auto-join rooms.
  1072. #
  1073. autocreate_auto_join_rooms: {{ matrix_synapse_autocreate_auto_join_rooms|to_json }}
  1074. # Whether the auto_join_rooms that are auto-created are available via
  1075. # federation. Only has an effect if autocreate_auto_join_rooms is true.
  1076. #
  1077. # Note that whether a room is federated cannot be modified after
  1078. # creation.
  1079. #
  1080. # Defaults to true: the room will be joinable from other servers.
  1081. # Uncomment the following to prevent users from other homeservers from
  1082. # joining these rooms.
  1083. #
  1084. #autocreate_auto_join_rooms_federated: false
  1085. # The room preset to use when auto-creating one of auto_join_rooms. Only has an
  1086. # effect if autocreate_auto_join_rooms is true.
  1087. #
  1088. # This can be one of "public_chat", "private_chat", or "trusted_private_chat".
  1089. # If a value of "private_chat" or "trusted_private_chat" is used then
  1090. # auto_join_mxid_localpart must also be configured.
  1091. #
  1092. # Defaults to "public_chat", meaning that the room is joinable by anyone, including
  1093. # federated servers if autocreate_auto_join_rooms_federated is true (the default).
  1094. # Uncomment the following to require an invitation to join these rooms.
  1095. #
  1096. #autocreate_auto_join_room_preset: private_chat
  1097. # The local part of the user id which is used to create auto_join_rooms if
  1098. # autocreate_auto_join_rooms is true. If this is not provided then the
  1099. # initial user account that registers will be used to create the rooms.
  1100. #
  1101. # The user id is also used to invite new users to any auto-join rooms which
  1102. # are set to invite-only.
  1103. #
  1104. # It *must* be configured if autocreate_auto_join_room_preset is set to
  1105. # "private_chat" or "trusted_private_chat".
  1106. #
  1107. # Note that this must be specified in order for new users to be correctly
  1108. # invited to any auto-join rooms which have been set to invite-only (either
  1109. # at the time of creation or subsequently).
  1110. #
  1111. # Note that, if the room already exists, this user must be joined and
  1112. # have the appropriate permissions to invite new members.
  1113. #
  1114. #auto_join_mxid_localpart: system
  1115. # When auto_join_rooms is specified, setting this flag to false prevents
  1116. # guest accounts from being automatically joined to the rooms.
  1117. #
  1118. # Defaults to true.
  1119. #
  1120. #auto_join_rooms_for_guests: false
  1121. ## Metrics ###
  1122. # Enable collection and rendering of performance metrics
  1123. #
  1124. enable_metrics: {{ matrix_synapse_metrics_enabled|to_json }}
  1125. # Enable sentry integration
  1126. # NOTE: While attempts are made to ensure that the logs don't contain
  1127. # any sensitive information, this cannot be guaranteed. By enabling
  1128. # this option the sentry server may therefore receive sensitive
  1129. # information, and it in turn may then diseminate sensitive information
  1130. # through insecure notification channels if so configured.
  1131. #
  1132. {% if matrix_synapse_sentry_dsn != "" %}
  1133. sentry:
  1134. dsn: {{ matrix_synapse_sentry_dsn|to_json }}
  1135. {% endif %}
  1136. # Flags to enable Prometheus metrics which are not suitable to be
  1137. # enabled by default, either for performance reasons or limited use.
  1138. #
  1139. metrics_flags:
  1140. # Publish synapse_federation_known_servers, a gauge of the number of
  1141. # servers this homeserver knows about, including itself. May cause
  1142. # performance problems on large homeservers.
  1143. #
  1144. #known_servers: true
  1145. # Whether or not to report anonymized homeserver usage statistics.
  1146. #
  1147. report_stats: {{ matrix_synapse_report_stats|to_json }}
  1148. # The endpoint to report the anonymized homeserver usage statistics to.
  1149. # Defaults to https://matrix.org/report-usage-stats/push
  1150. #
  1151. #report_stats_endpoint: https://example.com/report-usage-stats/push
  1152. ## API Configuration ##
  1153. # A list of event types that will be included in the room_invite_state
  1154. #
  1155. #room_invite_state_types:
  1156. # - "m.room.join_rules"
  1157. # - "m.room.canonical_alias"
  1158. # - "m.room.avatar"
  1159. # - "m.room.encryption"
  1160. # - "m.room.name"
  1161. # A list of application service config files to use
  1162. #
  1163. app_service_config_files: {{ matrix_synapse_app_service_config_files|to_json }}
  1164. # Uncomment to enable tracking of application service IP addresses. Implicitly
  1165. # enables MAU tracking for application service users.
  1166. #
  1167. #track_appservice_user_ips: True
  1168. # a secret which is used to sign access tokens. If none is specified,
  1169. # the registration_shared_secret is used, if one is given; otherwise,
  1170. # a secret key is derived from the signing key.
  1171. #
  1172. macaroon_secret_key: {{ matrix_synapse_macaroon_secret_key|string|to_json }}
  1173. # a secret which is used to calculate HMACs for form values, to stop
  1174. # falsification of values. Must be specified for the User Consent
  1175. # forms to work.
  1176. #
  1177. form_secret: {{ matrix_synapse_form_secret|string|to_json }}
  1178. ## Signing Keys ##
  1179. # Path to the signing key to sign messages with
  1180. #
  1181. signing_key_path: "/data/{{ matrix_server_fqn_matrix }}.signing.key"
  1182. # The keys that the server used to sign messages with but won't use
  1183. # to sign new messages.
  1184. #
  1185. old_signing_keys:
  1186. # For each key, `key` should be the base64-encoded public key, and
  1187. # `expired_ts`should be the time (in milliseconds since the unix epoch) that
  1188. # it was last used.
  1189. #
  1190. # It is possible to build an entry from an old signing.key file using the
  1191. # `export_signing_key` script which is provided with synapse.
  1192. #
  1193. # For example:
  1194. #
  1195. #"ed25519:id": { key: "base64string", expired_ts: 123456789123 }
  1196. # How long key response published by this server is valid for.
  1197. # Used to set the valid_until_ts in /key/v2 APIs.
  1198. # Determines how quickly servers will query to check which keys
  1199. # are still valid.
  1200. #
  1201. #key_refresh_interval: 1d
  1202. # The trusted servers to download signing keys from.
  1203. #
  1204. # When we need to fetch a signing key, each server is tried in parallel.
  1205. #
  1206. # Normally, the connection to the key server is validated via TLS certificates.
  1207. # Additional security can be provided by configuring a `verify key`, which
  1208. # will make synapse check that the response is signed by that key.
  1209. #
  1210. # This setting supercedes an older setting named `perspectives`. The old format
  1211. # is still supported for backwards-compatibility, but it is deprecated.
  1212. #
  1213. # 'trusted_key_servers' defaults to matrix.org, but using it will generate a
  1214. # warning on start-up. To suppress this warning, set
  1215. # 'suppress_key_server_warning' to true.
  1216. #
  1217. # Options for each entry in the list include:
  1218. #
  1219. # server_name: the name of the server. required.
  1220. #
  1221. # verify_keys: an optional map from key id to base64-encoded public key.
  1222. # If specified, we will check that the response is signed by at least
  1223. # one of the given keys.
  1224. #
  1225. # accept_keys_insecurely: a boolean. Normally, if `verify_keys` is unset,
  1226. # and federation_verify_certificates is not `true`, synapse will refuse
  1227. # to start, because this would allow anyone who can spoof DNS responses
  1228. # to masquerade as the trusted key server. If you know what you are doing
  1229. # and are sure that your network environment provides a secure connection
  1230. # to the key server, you can set this to `true` to override this
  1231. # behaviour.
  1232. #
  1233. # An example configuration might look like:
  1234. #
  1235. #trusted_key_servers:
  1236. # - server_name: "my_trusted_server.example.com"
  1237. # verify_keys:
  1238. # "ed25519:auto": "abcdefghijklmnopqrstuvwxyzabcdefghijklmopqr"
  1239. # - server_name: "my_other_trusted_server.example.com"
  1240. #
  1241. trusted_key_servers: {{ matrix_synapse_trusted_key_servers|to_json }}
  1242. # Uncomment the following to disable the warning that is emitted when the
  1243. # trusted_key_servers include 'matrix.org'. See above.
  1244. #
  1245. #suppress_key_server_warning: true
  1246. # The signing keys to use when acting as a trusted key server. If not specified
  1247. # defaults to the server signing key.
  1248. #
  1249. # Can contain multiple keys, one per line.
  1250. #
  1251. #key_server_signing_keys_path: "key_server_signing_keys.key"
  1252. ## Single sign-on integration ##
  1253. # Enable SAML2 for registration and login. Uses pysaml2.
  1254. #
  1255. # At least one of `sp_config` or `config_path` must be set in this section to
  1256. # enable SAML login.
  1257. #
  1258. # (You will probably also want to set the following options to `false` to
  1259. # disable the regular login/registration flows:
  1260. # * enable_registration
  1261. # * password_config.enabled
  1262. #
  1263. # Once SAML support is enabled, a metadata file will be exposed at
  1264. # https://<server>:<port>/_matrix/saml2/metadata.xml, which you may be able to
  1265. # use to configure your SAML IdP with. Alternatively, you can manually configure
  1266. # the IdP to use an ACS location of
  1267. # https://<server>:<port>/_matrix/saml2/authn_response.
  1268. #
  1269. saml2_config:
  1270. # `sp_config` is the configuration for the pysaml2 Service Provider.
  1271. # See pysaml2 docs for format of config.
  1272. #
  1273. # Default values will be used for the 'entityid' and 'service' settings,
  1274. # so it is not normally necessary to specify them unless you need to
  1275. # override them.
  1276. #
  1277. #sp_config:
  1278. # # point this to the IdP's metadata. You can use either a local file or
  1279. # # (preferably) a URL.
  1280. # metadata:
  1281. # #local: ["saml2/idp.xml"]
  1282. # remote:
  1283. # - url: https://our_idp/metadata.xml
  1284. #
  1285. # # By default, the user has to go to our login page first. If you'd like
  1286. # # to allow IdP-initiated login, set 'allow_unsolicited: true' in a
  1287. # # 'service.sp' section:
  1288. # #
  1289. # #service:
  1290. # # sp:
  1291. # # allow_unsolicited: true
  1292. #
  1293. # # The examples below are just used to generate our metadata xml, and you
  1294. # # may well not need them, depending on your setup. Alternatively you
  1295. # # may need a whole lot more detail - see the pysaml2 docs!
  1296. #
  1297. # description: ["My awesome SP", "en"]
  1298. # name: ["Test SP", "en"]
  1299. #
  1300. # organization:
  1301. # name: Example com
  1302. # display_name:
  1303. # - ["Example co", "en"]
  1304. # url: "http://example.com"
  1305. #
  1306. # contact_person:
  1307. # - given_name: Bob
  1308. # sur_name: "the Sysadmin"
  1309. # email_address": ["admin@example.com"]
  1310. # contact_type": technical
  1311. # Instead of putting the config inline as above, you can specify a
  1312. # separate pysaml2 configuration file:
  1313. #
  1314. #config_path: "/data/sp_conf.py"
  1315. # The lifetime of a SAML session. This defines how long a user has to
  1316. # complete the authentication process, if allow_unsolicited is unset.
  1317. # The default is 15 minutes.
  1318. #
  1319. #saml_session_lifetime: 5m
  1320. # An external module can be provided here as a custom solution to
  1321. # mapping attributes returned from a saml provider onto a matrix user.
  1322. #
  1323. user_mapping_provider:
  1324. # The custom module's class. Uncomment to use a custom module.
  1325. #
  1326. #module: mapping_provider.SamlMappingProvider
  1327. # Custom configuration values for the module. Below options are
  1328. # intended for the built-in provider, they should be changed if
  1329. # using a custom module. This section will be passed as a Python
  1330. # dictionary to the module's `parse_config` method.
  1331. #
  1332. config:
  1333. # The SAML attribute (after mapping via the attribute maps) to use
  1334. # to derive the Matrix ID from. 'uid' by default.
  1335. #
  1336. # Note: This used to be configured by the
  1337. # saml2_config.mxid_source_attribute option. If that is still
  1338. # defined, its value will be used instead.
  1339. #
  1340. #mxid_source_attribute: displayName
  1341. # The mapping system to use for mapping the saml attribute onto a
  1342. # matrix ID.
  1343. #
  1344. # Options include:
  1345. # * 'hexencode' (which maps unpermitted characters to '=xx')
  1346. # * 'dotreplace' (which replaces unpermitted characters with
  1347. # '.').
  1348. # The default is 'hexencode'.
  1349. #
  1350. # Note: This used to be configured by the
  1351. # saml2_config.mxid_mapping option. If that is still defined, its
  1352. # value will be used instead.
  1353. #
  1354. #mxid_mapping: dotreplace
  1355. # In previous versions of synapse, the mapping from SAML attribute to
  1356. # MXID was always calculated dynamically rather than stored in a
  1357. # table. For backwards- compatibility, we will look for user_ids
  1358. # matching such a pattern before creating a new account.
  1359. #
  1360. # This setting controls the SAML attribute which will be used for this
  1361. # backwards-compatibility lookup. Typically it should be 'uid', but if
  1362. # the attribute maps are changed, it may be necessary to change it.
  1363. #
  1364. # The default is 'uid'.
  1365. #
  1366. #grandfathered_mxid_source_attribute: upn
  1367. # It is possible to configure Synapse to only allow logins if SAML attributes
  1368. # match particular values. The requirements can be listed under
  1369. # `attribute_requirements` as shown below. All of the listed attributes must
  1370. # match for the login to be permitted.
  1371. #
  1372. #attribute_requirements:
  1373. # - attribute: userGroup
  1374. # value: "staff"
  1375. # - attribute: department
  1376. # value: "sales"
  1377. # Directory in which Synapse will try to find the template files below.
  1378. # If not set, default templates from within the Synapse package will be used.
  1379. #
  1380. # DO NOT UNCOMMENT THIS SETTING unless you want to customise the templates.
  1381. # If you *do* uncomment it, you will need to make sure that all the templates
  1382. # below are in the directory.
  1383. #
  1384. # Synapse will look for the following templates in this directory:
  1385. #
  1386. # * HTML page to display to users if something goes wrong during the
  1387. # authentication process: 'saml_error.html'.
  1388. #
  1389. # When rendering, this template is given the following variables:
  1390. # * code: an HTML error code corresponding to the error that is being
  1391. # returned (typically 400 or 500)
  1392. #
  1393. # * msg: a textual message describing the error.
  1394. #
  1395. # The variables will automatically be HTML-escaped.
  1396. #
  1397. # You can see the default templates at:
  1398. # https://github.com/matrix-org/synapse/tree/master/synapse/res/templates
  1399. #
  1400. #template_dir: "res/templates"
  1401. # OpenID Connect integration. The following settings can be used to make Synapse
  1402. # use an OpenID Connect Provider for authentication, instead of its internal
  1403. # password database.
  1404. #
  1405. # See https://github.com/matrix-org/synapse/blob/master/docs/openid.md.
  1406. #
  1407. oidc_config:
  1408. # Uncomment the following to enable authorization against an OpenID Connect
  1409. # server. Defaults to false.
  1410. #
  1411. #enabled: true
  1412. # Uncomment the following to disable use of the OIDC discovery mechanism to
  1413. # discover endpoints. Defaults to true.
  1414. #
  1415. #discover: false
  1416. # the OIDC issuer. Used to validate tokens and (if discovery is enabled) to
  1417. # discover the provider's endpoints.
  1418. #
  1419. # Required if 'enabled' is true.
  1420. #
  1421. #issuer: "https://accounts.example.com/"
  1422. # oauth2 client id to use.
  1423. #
  1424. # Required if 'enabled' is true.
  1425. #
  1426. #client_id: "provided-by-your-issuer"
  1427. # oauth2 client secret to use.
  1428. #
  1429. # Required if 'enabled' is true.
  1430. #
  1431. #client_secret: "provided-by-your-issuer"
  1432. # auth method to use when exchanging the token.
  1433. # Valid values are 'client_secret_basic' (default), 'client_secret_post' and
  1434. # 'none'.
  1435. #
  1436. #client_auth_method: client_secret_post
  1437. # list of scopes to request. This should normally include the "openid" scope.
  1438. # Defaults to ["openid"].
  1439. #
  1440. #scopes: ["openid", "profile"]
  1441. # the oauth2 authorization endpoint. Required if provider discovery is disabled.
  1442. #
  1443. #authorization_endpoint: "https://accounts.example.com/oauth2/auth"
  1444. # the oauth2 token endpoint. Required if provider discovery is disabled.
  1445. #
  1446. #token_endpoint: "https://accounts.example.com/oauth2/token"
  1447. # the OIDC userinfo endpoint. Required if discovery is disabled and the
  1448. # "openid" scope is not requested.
  1449. #
  1450. #userinfo_endpoint: "https://accounts.example.com/userinfo"
  1451. # URI where to fetch the JWKS. Required if discovery is disabled and the
  1452. # "openid" scope is used.
  1453. #
  1454. #jwks_uri: "https://accounts.example.com/.well-known/jwks.json"
  1455. # Uncomment to skip metadata verification. Defaults to false.
  1456. #
  1457. # Use this if you are connecting to a provider that is not OpenID Connect
  1458. # compliant.
  1459. # Avoid this in production.
  1460. #
  1461. #skip_verification: true
  1462. # An external module can be provided here as a custom solution to mapping
  1463. # attributes returned from a OIDC provider onto a matrix user.
  1464. #
  1465. user_mapping_provider:
  1466. # The custom module's class. Uncomment to use a custom module.
  1467. # Default is 'synapse.handlers.oidc_handler.JinjaOidcMappingProvider'.
  1468. #
  1469. # See https://github.com/matrix-org/synapse/blob/master/docs/sso_mapping_providers.md#openid-mapping-providers
  1470. # for information on implementing a custom mapping provider.
  1471. #
  1472. #module: mapping_provider.OidcMappingProvider
  1473. # Custom configuration values for the module. This section will be passed as
  1474. # a Python dictionary to the user mapping provider module's `parse_config`
  1475. # method.
  1476. #
  1477. # The examples below are intended for the default provider: they should be
  1478. # changed if using a custom provider.
  1479. #
  1480. config:
  1481. # name of the claim containing a unique identifier for the user.
  1482. # Defaults to `sub`, which OpenID Connect compliant providers should provide.
  1483. #
  1484. #subject_claim: "sub"
  1485. # Jinja2 template for the localpart of the MXID.
  1486. #
  1487. # When rendering, this template is given the following variables:
  1488. # * user: The claims returned by the UserInfo Endpoint and/or in the ID
  1489. # Token
  1490. #
  1491. # This must be configured if using the default mapping provider.
  1492. #
  1493. localpart_template: "{% raw %}{{ user.preferred_username }}{% endraw %}"
  1494. # Jinja2 template for the display name to set on first login.
  1495. #
  1496. # If unset, no displayname will be set.
  1497. #
  1498. #display_name_template: "{% raw %}{{ user.given_name }} {{ user.last_name }}{% endraw %}"
  1499. # Enable CAS for registration and login.
  1500. #
  1501. #cas_config:
  1502. # enabled: true
  1503. # server_url: "https://cas-server.com"
  1504. # service_url: "https://homeserver.domain.com:8448"
  1505. # #displayname_attribute: name
  1506. # #required_attributes:
  1507. # # name: value
  1508. # Additional settings to use with single-sign on systems such as OpenID Connect,
  1509. # SAML2 and CAS.
  1510. #
  1511. sso:
  1512. # A list of client URLs which are whitelisted so that the user does not
  1513. # have to confirm giving access to their account to the URL. Any client
  1514. # whose URL starts with an entry in the following list will not be subject
  1515. # to an additional confirmation step after the SSO login is completed.
  1516. #
  1517. # WARNING: An entry such as "https://my.client" is insecure, because it
  1518. # will also match "https://my.client.evil.site", exposing your users to
  1519. # phishing attacks from evil.site. To avoid this, include a slash after the
  1520. # hostname: "https://my.client/".
  1521. #
  1522. # If public_baseurl is set, then the login fallback page (used by clients
  1523. # that don't natively support the required login flows) is whitelisted in
  1524. # addition to any URLs in this list.
  1525. #
  1526. # By default, this list is empty.
  1527. #
  1528. #client_whitelist:
  1529. # - https://riot.im/develop
  1530. # - https://my.custom.client/
  1531. # Directory in which Synapse will try to find the template files below.
  1532. # If not set, default templates from within the Synapse package will be used.
  1533. #
  1534. # DO NOT UNCOMMENT THIS SETTING unless you want to customise the templates.
  1535. # If you *do* uncomment it, you will need to make sure that all the templates
  1536. # below are in the directory.
  1537. #
  1538. # Synapse will look for the following templates in this directory:
  1539. #
  1540. # * HTML page for a confirmation step before redirecting back to the client
  1541. # with the login token: 'sso_redirect_confirm.html'.
  1542. #
  1543. # When rendering, this template is given three variables:
  1544. # * redirect_url: the URL the user is about to be redirected to. Needs
  1545. # manual escaping (see
  1546. # https://jinja.palletsprojects.com/en/2.11.x/templates/#html-escaping).
  1547. #
  1548. # * display_url: the same as `redirect_url`, but with the query
  1549. # parameters stripped. The intention is to have a
  1550. # human-readable URL to show to users, not to use it as
  1551. # the final address to redirect to. Needs manual escaping
  1552. # (see https://jinja.palletsprojects.com/en/2.11.x/templates/#html-escaping).
  1553. #
  1554. # * server_name: the homeserver's name.
  1555. #
  1556. # * HTML page which notifies the user that they are authenticating to confirm
  1557. # an operation on their account during the user interactive authentication
  1558. # process: 'sso_auth_confirm.html'.
  1559. #
  1560. # When rendering, this template is given the following variables:
  1561. # * redirect_url: the URL the user is about to be redirected to. Needs
  1562. # manual escaping (see
  1563. # https://jinja.palletsprojects.com/en/2.11.x/templates/#html-escaping).
  1564. #
  1565. # * description: the operation which the user is being asked to confirm
  1566. #
  1567. # * HTML page shown after a successful user interactive authentication session:
  1568. # 'sso_auth_success.html'.
  1569. #
  1570. # Note that this page must include the JavaScript which notifies of a successful authentication
  1571. # (see https://matrix.org/docs/spec/client_server/r0.6.0#fallback).
  1572. #
  1573. # This template has no additional variables.
  1574. #
  1575. # * HTML page shown during single sign-on if a deactivated user (according to Synapse's database)
  1576. # attempts to login: 'sso_account_deactivated.html'.
  1577. #
  1578. # This template has no additional variables.
  1579. #
  1580. # * HTML page to display to users if something goes wrong during the
  1581. # OpenID Connect authentication process: 'sso_error.html'.
  1582. #
  1583. # When rendering, this template is given two variables:
  1584. # * error: the technical name of the error
  1585. # * error_description: a human-readable message for the error
  1586. #
  1587. # You can see the default templates at:
  1588. # https://github.com/matrix-org/synapse/tree/master/synapse/res/templates
  1589. #
  1590. #template_dir: "res/templates"
  1591. # JSON web token integration. The following settings can be used to make
  1592. # Synapse JSON web tokens for authentication, instead of its internal
  1593. # password database.
  1594. #
  1595. # Each JSON Web Token needs to contain a "sub" (subject) claim, which is
  1596. # used as the localpart of the mxid.
  1597. #
  1598. # Additionally, the expiration time ("exp"), not before time ("nbf"),
  1599. # and issued at ("iat") claims are validated if present.
  1600. #
  1601. # Note that this is a non-standard login type and client support is
  1602. # expected to be non-existant.
  1603. #
  1604. # See https://github.com/matrix-org/synapse/blob/master/docs/jwt.md.
  1605. #
  1606. #jwt_config:
  1607. # Uncomment the following to enable authorization using JSON web
  1608. # tokens. Defaults to false.
  1609. #
  1610. #enabled: true
  1611. # This is either the private shared secret or the public key used to
  1612. # decode the contents of the JSON web token.
  1613. #
  1614. # Required if 'enabled' is true.
  1615. #
  1616. #secret: "provided-by-your-issuer"
  1617. # The algorithm used to sign the JSON web token.
  1618. #
  1619. # Supported algorithms are listed at
  1620. # https://pyjwt.readthedocs.io/en/latest/algorithms.html
  1621. #
  1622. # Required if 'enabled' is true.
  1623. #
  1624. #algorithm: "provided-by-your-issuer"
  1625. password_config:
  1626. # Uncomment to disable password login
  1627. #
  1628. #enabled: false
  1629. # Uncomment to disable authentication against the local password
  1630. # database. This is ignored if `enabled` is false, and is only useful
  1631. # if you have other password_providers.
  1632. #
  1633. localdb_enabled: {{ matrix_synapse_password_config_localdb_enabled|to_json }}
  1634. # Uncomment and change to a secret random string for extra security.
  1635. # DO NOT CHANGE THIS AFTER INITIAL SETUP!
  1636. #
  1637. pepper: {{ matrix_synapse_password_config_pepper|string|to_json }}
  1638. {% if matrix_synapse_email_enabled %}
  1639. # Configuration for sending emails from Synapse.
  1640. #
  1641. email:
  1642. # The hostname of the outgoing SMTP server to use. Defaults to 'localhost'.
  1643. #
  1644. #smtp_host: mail.server
  1645. smtp_host: {{ matrix_synapse_email_smtp_host|string|to_json }}
  1646. # The port on the mail server for outgoing SMTP. Defaults to 25.
  1647. #
  1648. #smtp_port: 587
  1649. smtp_port: {{ matrix_synapse_email_smtp_port|to_json }}
  1650. # Username/password for authentication to the SMTP server. By default, no
  1651. # authentication is attempted.
  1652. #
  1653. #smtp_user: "exampleusername"
  1654. #smtp_pass: "examplepassword"
  1655. # Uncomment the following to require TLS transport security for SMTP.
  1656. # By default, Synapse will connect over plain text, and will then switch to
  1657. # TLS via STARTTLS *if the SMTP server supports it*. If this option is set,
  1658. # Synapse will refuse to connect unless the server supports STARTTLS.
  1659. #
  1660. #require_transport_security: true
  1661. require_transport_security: {{ matrix_synapse_email_smtp_require_transport_security|to_json }}
  1662. # Enable sending emails for messages that the user has missed
  1663. #
  1664. #enable_notifs: false
  1665. enable_notifs: true
  1666. # notif_from defines the "From" address to use when sending emails.
  1667. # It must be set if email sending is enabled.
  1668. #
  1669. # The placeholder '%(app)s' will be replaced by the application name,
  1670. # which is normally 'app_name' (below), but may be overridden by the
  1671. # Matrix client application.
  1672. #
  1673. # Note that the placeholder must be written '%(app)s', including the
  1674. # trailing 's'.
  1675. #
  1676. #notif_from: "Your Friendly %(app)s homeserver <noreply@example.com>"
  1677. notif_from: {{ matrix_synapse_email_notif_from|string|to_json }}
  1678. # app_name defines the default value for '%(app)s' in notif_from and email
  1679. # subjects. It defaults to 'Matrix'.
  1680. #
  1681. #app_name: my_branded_matrix_server
  1682. app_name: Matrix
  1683. # Uncomment the following to disable automatic subscription to email
  1684. # notifications for new users. Enabled by default.
  1685. #
  1686. #notif_for_new_users: false
  1687. notif_for_new_users: True
  1688. # Custom URL for client links within the email notifications. By default
  1689. # links will be based on "https://matrix.to".
  1690. #
  1691. # (This setting used to be called riot_base_url; the old name is still
  1692. # supported for backwards-compatibility but is now deprecated.)
  1693. #
  1694. #client_base_url: "http://localhost/riot"
  1695. client_base_url: {{ matrix_synapse_email_client_base_url|string|to_json }}
  1696. # Configure the time that a validation email will expire after sending.
  1697. # Defaults to 1h.
  1698. #
  1699. #validation_token_lifetime: 15m
  1700. # Directory in which Synapse will try to find the template files below.
  1701. # If not set, default templates from within the Synapse package will be used.
  1702. #
  1703. # DO NOT UNCOMMENT THIS SETTING unless you want to customise the templates.
  1704. # If you *do* uncomment it, you will need to make sure that all the templates
  1705. # below are in the directory.
  1706. #
  1707. # Synapse will look for the following templates in this directory:
  1708. #
  1709. # * The contents of email notifications of missed events: 'notif_mail.html' and
  1710. # 'notif_mail.txt'.
  1711. #
  1712. # * The contents of account expiry notice emails: 'notice_expiry.html' and
  1713. # 'notice_expiry.txt'.
  1714. #
  1715. # * The contents of password reset emails sent by the homeserver:
  1716. # 'password_reset.html' and 'password_reset.txt'
  1717. #
  1718. # * HTML pages for success and failure that a user will see when they follow
  1719. # the link in the password reset email: 'password_reset_success.html' and
  1720. # 'password_reset_failure.html'
  1721. #
  1722. # * The contents of address verification emails sent during registration:
  1723. # 'registration.html' and 'registration.txt'
  1724. #
  1725. # * HTML pages for success and failure that a user will see when they follow
  1726. # the link in an address verification email sent during registration:
  1727. # 'registration_success.html' and 'registration_failure.html'
  1728. #
  1729. # * The contents of address verification emails sent when an address is added
  1730. # to a Matrix account: 'add_threepid.html' and 'add_threepid.txt'
  1731. #
  1732. # * HTML pages for success and failure that a user will see when they follow
  1733. # the link in an address verification email sent when an address is added
  1734. # to a Matrix account: 'add_threepid_success.html' and
  1735. # 'add_threepid_failure.html'
  1736. #
  1737. # You can see the default templates at:
  1738. # https://github.com/matrix-org/synapse/tree/master/synapse/res/templates
  1739. #
  1740. #template_dir: "res/templates"
  1741. # Subjects to use when sending emails from Synapse.
  1742. #
  1743. # The placeholder '%(app)s' will be replaced with the value of the 'app_name'
  1744. # setting above, or by a value dictated by the Matrix client application.
  1745. #
  1746. # If a subject isn't overridden in this configuration file, the value used as
  1747. # its example will be used.
  1748. #
  1749. #subjects:
  1750. # Subjects for notification emails.
  1751. #
  1752. # On top of the '%(app)s' placeholder, these can use the following
  1753. # placeholders:
  1754. #
  1755. # * '%(person)s', which will be replaced by the display name of the user(s)
  1756. # that sent the message(s), e.g. "Alice and Bob".
  1757. # * '%(room)s', which will be replaced by the name of the room the
  1758. # message(s) have been sent to, e.g. "My super room".
  1759. #
  1760. # See the example provided for each setting to see which placeholder can be
  1761. # used and how to use them.
  1762. #
  1763. # Subject to use to notify about one message from one or more user(s) in a
  1764. # room which has a name.
  1765. #message_from_person_in_room: "[%(app)s] You have a message on %(app)s from %(person)s in the %(room)s room..."
  1766. #
  1767. # Subject to use to notify about one message from one or more user(s) in a
  1768. # room which doesn't have a name.
  1769. #message_from_person: "[%(app)s] You have a message on %(app)s from %(person)s..."
  1770. #
  1771. # Subject to use to notify about multiple messages from one or more users in
  1772. # a room which doesn't have a name.
  1773. #messages_from_person: "[%(app)s] You have messages on %(app)s from %(person)s..."
  1774. #
  1775. # Subject to use to notify about multiple messages in a room which has a
  1776. # name.
  1777. #messages_in_room: "[%(app)s] You have messages on %(app)s in the %(room)s room..."
  1778. #
  1779. # Subject to use to notify about multiple messages in multiple rooms.
  1780. #messages_in_room_and_others: "[%(app)s] You have messages on %(app)s in the %(room)s room and others..."
  1781. #
  1782. # Subject to use to notify about multiple messages from multiple persons in
  1783. # multiple rooms. This is similar to the setting above except it's used when
  1784. # the room in which the notification was triggered has no name.
  1785. #messages_from_person_and_others: "[%(app)s] You have messages on %(app)s from %(person)s and others..."
  1786. #
  1787. # Subject to use to notify about an invite to a room which has a name.
  1788. #invite_from_person_to_room: "[%(app)s] %(person)s has invited you to join the %(room)s room on %(app)s..."
  1789. #
  1790. # Subject to use to notify about an invite to a room which doesn't have a
  1791. # name.
  1792. #invite_from_person: "[%(app)s] %(person)s has invited you to chat on %(app)s..."
  1793. # Subject for emails related to account administration.
  1794. #
  1795. # On top of the '%(app)s' placeholder, these one can use the
  1796. # '%(server_name)s' placeholder, which will be replaced by the value of the
  1797. # 'server_name' setting in your Synapse configuration.
  1798. #
  1799. # Subject to use when sending a password reset email.
  1800. #password_reset: "[%(server_name)s] Password reset"
  1801. #
  1802. # Subject to use when sending a verification email to assert an address's
  1803. # ownership.
  1804. #email_validation: "[%(server_name)s] Validate your email"
  1805. {% endif %}
  1806. # Password providers allow homeserver administrators to integrate
  1807. # their Synapse installation with existing authentication methods
  1808. # ex. LDAP, external tokens, etc.
  1809. #
  1810. # For more information and known implementations, please see
  1811. # https://github.com/matrix-org/synapse/blob/master/docs/password_auth_providers.md
  1812. #
  1813. # Note: instances wishing to use SAML or CAS authentication should
  1814. # instead use the `saml2_config` or `cas_config` options,
  1815. # respectively.
  1816. #
  1817. # password_providers:
  1818. # # Example config for an LDAP auth provider
  1819. # - module: "ldap_auth_provider.LdapAuthProvider"
  1820. # config:
  1821. # enabled: true
  1822. # uri: "ldap://ldap.example.com:389"
  1823. # start_tls: true
  1824. # base: "ou=users,dc=example,dc=com"
  1825. # attributes:
  1826. # uid: "cn"
  1827. # mail: "email"
  1828. # name: "givenName"
  1829. # #bind_dn:
  1830. # #bind_password:
  1831. # #filter: "(objectClass=posixAccount)"
  1832. {% if matrix_synapse_password_providers_enabled %}
  1833. password_providers:
  1834. {% if matrix_synapse_ext_password_provider_shared_secret_auth_enabled %}
  1835. - module: "shared_secret_authenticator.SharedSecretAuthenticator"
  1836. config:
  1837. sharedSecret: {{ matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret|string|to_json }}
  1838. {% endif %}
  1839. {% if matrix_synapse_ext_password_provider_rest_auth_enabled %}
  1840. - module: "rest_auth_provider.RestAuthProvider"
  1841. config:
  1842. endpoint: {{ matrix_synapse_ext_password_provider_rest_auth_endpoint|string|to_json }}
  1843. policy:
  1844. registration:
  1845. username:
  1846. enforceLowercase: {{ matrix_synapse_ext_password_provider_rest_auth_registration_enforce_lowercase }}
  1847. profile:
  1848. name: {{ matrix_synapse_ext_password_provider_rest_auth_registration_profile_name_autofill }}
  1849. login:
  1850. profile:
  1851. name: {{ matrix_synapse_ext_password_provider_rest_auth_login_profile_name_autofill }}
  1852. {% endif %}
  1853. {% if matrix_synapse_ext_password_provider_ldap_enabled %}
  1854. - module: "ldap_auth_provider.LdapAuthProvider"
  1855. config:
  1856. enabled: true
  1857. uri: {{ matrix_synapse_ext_password_provider_ldap_uri|string|to_json }}
  1858. start_tls: {{ matrix_synapse_ext_password_provider_ldap_start_tls|to_json }}
  1859. base: {{ matrix_synapse_ext_password_provider_ldap_base|string|to_json }}
  1860. attributes:
  1861. uid: {{ matrix_synapse_ext_password_provider_ldap_attributes_uid|string|to_json }}
  1862. mail: {{ matrix_synapse_ext_password_provider_ldap_attributes_mail|string|to_json }}
  1863. name: {{ matrix_synapse_ext_password_provider_ldap_attributes_name|string|to_json }}
  1864. bind_dn: {{ matrix_synapse_ext_password_provider_ldap_bind_dn|string|to_json }}
  1865. bind_password: {{ matrix_synapse_ext_password_provider_ldap_bind_password|string|to_json }}
  1866. filter: {{ matrix_synapse_ext_password_provider_ldap_filter|string|to_json }}
  1867. {% endif %}
  1868. {% endif %}
  1869. # Clients requesting push notifications can either have the body of
  1870. # the message sent in the notification poke along with other details
  1871. # like the sender, or just the event ID and room ID (`event_id_only`).
  1872. # If clients choose the former, this option controls whether the
  1873. # notification request includes the content of the event (other details
  1874. # like the sender are still included). For `event_id_only` push, it
  1875. # has no effect.
  1876. #
  1877. # For modern android devices the notification content will still appear
  1878. # because it is loaded by the app. iPhone, however will send a
  1879. # notification saying only that a message arrived and who it came from.
  1880. #
  1881. push:
  1882. include_content: {{ matrix_synapse_push_include_content|to_json }}
  1883. # Spam checkers are third-party modules that can block specific actions
  1884. # of local users, such as creating rooms and registering undesirable
  1885. # usernames, as well as remote users by redacting incoming events.
  1886. #
  1887. # spam_checker:
  1888. #- module: "my_custom_project.SuperSpamChecker"
  1889. # config:
  1890. # example_option: 'things'
  1891. #- module: "some_other_project.BadEventStopper"
  1892. # config:
  1893. # example_stop_events_from: ['@bad:example.com']
  1894. spam_checker: {{ matrix_synapse_spam_checker|to_json }}
  1895. ## Rooms ##
  1896. # Controls whether locally-created rooms should be end-to-end encrypted by
  1897. # default.
  1898. #
  1899. # Possible options are "all", "invite", and "off". They are defined as:
  1900. #
  1901. # * "all": any locally-created room
  1902. # * "invite": any room created with the "private_chat" or "trusted_private_chat"
  1903. # room creation presets
  1904. # * "off": this option will take no effect
  1905. #
  1906. # The default value is "off".
  1907. #
  1908. # Note that this option will only affect rooms created after it is set. It
  1909. # will also not affect rooms created by other servers.
  1910. #
  1911. #encryption_enabled_by_default_for_room_type: invite
  1912. # Uncomment to allow non-server-admin users to create groups on this server
  1913. #
  1914. enable_group_creation: {{ matrix_synapse_enable_group_creation|to_json }}
  1915. # If enabled, non server admins can only create groups with local parts
  1916. # starting with this prefix
  1917. #
  1918. #group_creation_prefix: "unofficial/"
  1919. # User Directory configuration
  1920. #
  1921. # 'enabled' defines whether users can search the user directory. If
  1922. # false then empty responses are returned to all queries. Defaults to
  1923. # true.
  1924. #
  1925. # 'search_all_users' defines whether to search all users visible to your HS
  1926. # when searching the user directory, rather than limiting to users visible
  1927. # in public rooms. Defaults to false. If you set it True, you'll have to
  1928. # rebuild the user_directory search indexes, see
  1929. # https://github.com/matrix-org/synapse/blob/master/docs/user_directory.md
  1930. #
  1931. #user_directory:
  1932. # enabled: true
  1933. # search_all_users: false
  1934. # User Consent configuration
  1935. #
  1936. # for detailed instructions, see
  1937. # https://github.com/matrix-org/synapse/blob/master/docs/consent_tracking.md
  1938. #
  1939. # Parts of this section are required if enabling the 'consent' resource under
  1940. # 'listeners', in particular 'template_dir' and 'version'.
  1941. #
  1942. # 'template_dir' gives the location of the templates for the HTML forms.
  1943. # This directory should contain one subdirectory per language (eg, 'en', 'fr'),
  1944. # and each language directory should contain the policy document (named as
  1945. # '<version>.html') and a success page (success.html).
  1946. #
  1947. # 'version' specifies the 'current' version of the policy document. It defines
  1948. # the version to be served by the consent resource if there is no 'v'
  1949. # parameter.
  1950. #
  1951. # 'server_notice_content', if enabled, will send a user a "Server Notice"
  1952. # asking them to consent to the privacy policy. The 'server_notices' section
  1953. # must also be configured for this to work. Notices will *not* be sent to
  1954. # guest users unless 'send_server_notice_to_guests' is set to true.
  1955. #
  1956. # 'block_events_error', if set, will block any attempts to send events
  1957. # until the user consents to the privacy policy. The value of the setting is
  1958. # used as the text of the error.
  1959. #
  1960. # 'require_at_registration', if enabled, will add a step to the registration
  1961. # process, similar to how captcha works. Users will be required to accept the
  1962. # policy before their account is created.
  1963. #
  1964. # 'policy_name' is the display name of the policy users will see when registering
  1965. # for an account. Has no effect unless `require_at_registration` is enabled.
  1966. # Defaults to "Privacy Policy".
  1967. #
  1968. #user_consent:
  1969. # template_dir: res/templates/privacy
  1970. # version: 1.0
  1971. # server_notice_content:
  1972. # msgtype: m.text
  1973. # body: >-
  1974. # To continue using this homeserver you must review and agree to the
  1975. # terms and conditions at %(consent_uri)s
  1976. # send_server_notice_to_guests: True
  1977. # block_events_error: >-
  1978. # To continue using this homeserver you must review and agree to the
  1979. # terms and conditions at %(consent_uri)s
  1980. # require_at_registration: False
  1981. # policy_name: Privacy Policy
  1982. #
  1983. # Local statistics collection. Used in populating the room directory.
  1984. #
  1985. # 'bucket_size' controls how large each statistics timeslice is. It can
  1986. # be defined in a human readable short form -- e.g. "1d", "1y".
  1987. #
  1988. # 'retention' controls how long historical statistics will be kept for.
  1989. # It can be defined in a human readable short form -- e.g. "1d", "1y".
  1990. #
  1991. #
  1992. #stats:
  1993. # enabled: true
  1994. # bucket_size: 1d
  1995. # retention: 1y
  1996. # Server Notices room configuration
  1997. #
  1998. # Uncomment this section to enable a room which can be used to send notices
  1999. # from the server to users. It is a special room which cannot be left; notices
  2000. # come from a special "notices" user id.
  2001. #
  2002. # If you uncomment this section, you *must* define the system_mxid_localpart
  2003. # setting, which defines the id of the user which will be used to send the
  2004. # notices.
  2005. #
  2006. # It's also possible to override the room name, the display name of the
  2007. # "notices" user, and the avatar for the user.
  2008. #
  2009. #server_notices:
  2010. # system_mxid_localpart: notices
  2011. # system_mxid_display_name: "Server Notices"
  2012. # system_mxid_avatar_url: "mxc://server.com/oumMVlgDnLYFaPVkExemNVVZ"
  2013. # room_name: "Server Notices"
  2014. # Uncomment to disable searching the public room list. When disabled
  2015. # blocks searching local and remote room lists for local and remote
  2016. # users by always returning an empty list for all queries.
  2017. #
  2018. #enable_room_list_search: false
  2019. enable_room_list_search: {{ matrix_synapse_enable_room_list_search|to_json }}
  2020. # The `alias_creation` option controls who's allowed to create aliases
  2021. # on this server.
  2022. #
  2023. # The format of this option is a list of rules that contain globs that
  2024. # match against user_id, room_id and the new alias (fully qualified with
  2025. # server name). The action in the first rule that matches is taken,
  2026. # which can currently either be "allow" or "deny".
  2027. #
  2028. # Missing user_id/room_id/alias fields default to "*".
  2029. #
  2030. # If no rules match the request is denied. An empty list means no one
  2031. # can create aliases.
  2032. #
  2033. # Options for the rules include:
  2034. #
  2035. # user_id: Matches against the creator of the alias
  2036. # alias: Matches against the alias being created
  2037. # room_id: Matches against the room ID the alias is being pointed at
  2038. # action: Whether to "allow" or "deny" the request if the rule matches
  2039. #
  2040. # The default is:
  2041. #
  2042. #alias_creation_rules:
  2043. # - user_id: "*"
  2044. # alias: "*"
  2045. # room_id: "*"
  2046. # action: allow
  2047. alias_creation_rules: {{ matrix_synapse_alias_creation_rules|to_json }}
  2048. # The `room_list_publication_rules` option controls who can publish and
  2049. # which rooms can be published in the public room list.
  2050. #
  2051. # The format of this option is the same as that for
  2052. # `alias_creation_rules`.
  2053. #
  2054. # If the room has one or more aliases associated with it, only one of
  2055. # the aliases needs to match the alias rule. If there are no aliases
  2056. # then only rules with `alias: *` match.
  2057. #
  2058. # If no rules match the request is denied. An empty list means no one
  2059. # can publish rooms.
  2060. #
  2061. # Options for the rules include:
  2062. #
  2063. # user_id: Matches agaisnt the creator of the alias
  2064. # room_id: Matches against the room ID being published
  2065. # alias: Matches against any current local or canonical aliases
  2066. # associated with the room
  2067. # action: Whether to "allow" or "deny" the request if the rule matches
  2068. #
  2069. # The default is:
  2070. #
  2071. #room_list_publication_rules:
  2072. # - user_id: "*"
  2073. # alias: "*"
  2074. # room_id: "*"
  2075. # action: allow
  2076. room_list_publication_rules: {{ matrix_synapse_room_list_publication_rules|to_json }}
  2077. # Server admins can define a Python module that implements extra rules for
  2078. # allowing or denying incoming events. In order to work, this module needs to
  2079. # override the methods defined in synapse/events/third_party_rules.py.
  2080. #
  2081. # This feature is designed to be used in closed federations only, where each
  2082. # participating server enforces the same rules.
  2083. #
  2084. #third_party_event_rules:
  2085. # module: "my_custom_project.SuperRulesSet"
  2086. # config:
  2087. # example_option: 'things'
  2088. ## Opentracing ##
  2089. # These settings enable opentracing, which implements distributed tracing.
  2090. # This allows you to observe the causal chains of events across servers
  2091. # including requests, key lookups etc., across any server running
  2092. # synapse or any other other services which supports opentracing
  2093. # (specifically those implemented with Jaeger).
  2094. #
  2095. opentracing:
  2096. # tracing is disabled by default. Uncomment the following line to enable it.
  2097. #
  2098. #enabled: true
  2099. # The list of homeservers we wish to send and receive span contexts and span baggage.
  2100. # See docs/opentracing.rst
  2101. # This is a list of regexes which are matched against the server_name of the
  2102. # homeserver.
  2103. #
  2104. # By defult, it is empty, so no servers are matched.
  2105. #
  2106. #homeserver_whitelist:
  2107. # - ".*"
  2108. # Jaeger can be configured to sample traces at different rates.
  2109. # All configuration options provided by Jaeger can be set here.
  2110. # Jaeger's configuration mostly related to trace sampling which
  2111. # is documented here:
  2112. # https://www.jaegertracing.io/docs/1.13/sampling/.
  2113. #
  2114. #jaeger_config:
  2115. # sampler:
  2116. # type: const
  2117. # param: 1
  2118. # Logging whether spans were started and reported
  2119. #
  2120. # logging:
  2121. # false
  2122. ## Workers ##
  2123. # Disables sending of outbound federation transactions on the main process.
  2124. # Uncomment if using a federation sender worker.
  2125. #
  2126. #send_federation: false
  2127. # It is possible to run multiple federation sender workers, in which case the
  2128. # work is balanced across them.
  2129. #
  2130. # This configuration must be shared between all federation sender workers, and if
  2131. # changed all federation sender workers must be stopped at the same time and then
  2132. # started, to ensure that all instances are running with the same config (otherwise
  2133. # events may be dropped).
  2134. #
  2135. #federation_sender_instances:
  2136. # - federation_sender1
  2137. # When using workers this should be a map from `worker_name` to the
  2138. # HTTP replication listener of the worker, if configured.
  2139. #
  2140. #instance_map:
  2141. # worker1:
  2142. # host: localhost
  2143. # port: 8034
  2144. # Experimental: When using workers you can define which workers should
  2145. # handle event persistence and typing notifications. Any worker
  2146. # specified here must also be in the `instance_map`.
  2147. #
  2148. #stream_writers:
  2149. # events: worker1
  2150. # typing: worker1
  2151. # Configuration for Redis when using workers. This *must* be enabled when
  2152. # using workers (unless using old style direct TCP configuration).
  2153. #
  2154. redis:
  2155. # Uncomment the below to enable Redis support.
  2156. #
  2157. #enabled: true
  2158. # Optional host and port to use to connect to redis. Defaults to
  2159. # localhost and 6379
  2160. #
  2161. #host: localhost
  2162. #port: 6379
  2163. # Optional password if configured on the Redis instance
  2164. #
  2165. #password: <secret_password>
  2166. # vim:ft=yaml