Matrix Docker Ansible eploy
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

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