Matrix Docker Ansible eploy
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 

2835 рядки
103 KiB

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