Matrix Docker Ansible eploy
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 

2863 行
104 KiB

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