Matrix Docker Ansible eploy
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 

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