Matrix Docker Ansible eploy
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 

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