Matrix Docker Ansible eploy
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 

3008 行
111 KiB

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