Matrix Docker Ansible eploy
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 

2976 righe
108 KiB

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