Matrix Docker Ansible eploy
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 

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