Matrix Docker Ansible eploy
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 

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