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

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