Matrix Docker Ansible eploy
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 

3017 satır
109 KiB

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