Matrix Docker Ansible eploy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

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