Matrix Docker Ansible eploy
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 

2434 wiersze
87 KiB

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