Matrix Docker Ansible eploy
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 

1890 linhas
66 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 path to the web client which will be served at /_matrix/client/
  20. # if 'webclient' is configured under the 'listeners' configuration.
  21. #
  22. #web_client_location: "/path/to/web/root"
  23. # The public-facing base URL that clients use to access this HS
  24. # (not including _matrix/...). This is the same URL a user would
  25. # enter into the 'custom HS URL' field on their client. If you
  26. # use synapse with a reverse proxy, this should be the URL to reach
  27. # synapse via the proxy.
  28. #
  29. public_baseurl: https://{{ matrix_server_fqn_matrix }}/
  30. # Set the soft limit on the number of file descriptors synapse can use
  31. # Zero is used to indicate synapse should set the soft limit to the
  32. # hard limit.
  33. #
  34. #soft_file_limit: 0
  35. # Set to false to disable presence tracking on this homeserver.
  36. #
  37. use_presence: {{ matrix_synapse_use_presence|to_json }}
  38. # Whether to require authentication to retrieve profile data (avatars,
  39. # display names) of other users through the client API. Defaults to
  40. # 'false'. Note that profile data is also available via the federation
  41. # API, so this setting is of limited value if federation is enabled on
  42. # the server.
  43. #
  44. #require_auth_for_profile_requests: true
  45. # Uncomment to require a user to share a room with another user in order
  46. # to retrieve their profile information. Only checked on Client-Server
  47. # requests. Profile requests from other servers should be checked by the
  48. # requesting server. Defaults to 'false'.
  49. #
  50. #limit_profile_requests_to_users_who_share_rooms: true
  51. # If set to 'true', removes the need for authentication to access the server's
  52. # public rooms directory through the client API, meaning that anyone can
  53. # query the room directory. Defaults to 'false'.
  54. #
  55. allow_public_rooms_without_auth: {{ matrix_synapse_allow_public_rooms_without_auth|to_json }}
  56. # If set to 'true', allows any other homeserver to fetch the server's public
  57. # rooms directory via federation. Defaults to 'false'.
  58. #
  59. allow_public_rooms_over_federation: {{ matrix_synapse_allow_public_rooms_over_federation|to_json }}
  60. # The default room version for newly created rooms.
  61. #
  62. # Known room versions are listed here:
  63. # https://matrix.org/docs/spec/#complete-list-of-room-versions
  64. #
  65. # For example, for room version 1, default_room_version should be set
  66. # to "1".
  67. #
  68. default_room_version: {{ matrix_synapse_default_room_version|to_json }}
  69. # The GC threshold parameters to pass to `gc.set_threshold`, if defined
  70. #
  71. #gc_thresholds: [700, 10, 10]
  72. # Set the limit on the returned events in the timeline in the get
  73. # and sync operations. The default value is -1, means no upper limit.
  74. #
  75. #filter_timeline_limit: 5000
  76. # Whether room invites to users on this server should be blocked
  77. # (except those sent by local server admins). The default is False.
  78. #
  79. #block_non_admin_invites: True
  80. # Room searching
  81. #
  82. # If disabled, new messages will not be indexed for searching and users
  83. # will receive errors when searching for messages. Defaults to enabled.
  84. #
  85. #enable_search: false
  86. # Restrict federation to the following whitelist of domains.
  87. # N.B. we recommend also firewalling your federation listener to limit
  88. # inbound federation traffic as early as possible, rather than relying
  89. # purely on this application-layer restriction. If not specified, the
  90. # default is to whitelist everything.
  91. #
  92. #federation_domain_whitelist:
  93. # - lon.example.com
  94. # - nyc.example.com
  95. # - syd.example.com
  96. {% if matrix_synapse_federation_domain_whitelist is not none %}
  97. {# Cannot use `|to_nice_yaml` here, as an empty list does not get serialized properly by it. #}
  98. federation_domain_whitelist: {{ matrix_synapse_federation_domain_whitelist|to_json }}
  99. {% endif %}
  100. # Prevent federation requests from being sent to the following
  101. # blacklist IP address CIDR ranges. If this option is not specified, or
  102. # specified with an empty list, no ip range blacklist will be enforced.
  103. #
  104. # As of Synapse v1.4.0 this option also affects any outbound requests to identity
  105. # servers provided by user input.
  106. #
  107. # (0.0.0.0 and :: are always blacklisted, whether or not they are explicitly
  108. # listed here, since they correspond to unroutable addresses.)
  109. #
  110. federation_ip_range_blacklist:
  111. - '127.0.0.0/8'
  112. - '10.0.0.0/8'
  113. - '172.16.0.0/12'
  114. - '192.168.0.0/16'
  115. - '100.64.0.0/10'
  116. - '169.254.0.0/16'
  117. - '::1/128'
  118. - 'fe80::/64'
  119. - 'fc00::/7'
  120. # List of ports that Synapse should listen on, their purpose and their
  121. # configuration.
  122. #
  123. # Options for each listener include:
  124. #
  125. # port: the TCP port to bind to
  126. #
  127. # bind_addresses: a list of local addresses to listen on. The default is
  128. # 'all local interfaces'.
  129. #
  130. # type: the type of listener. Normally 'http', but other valid options are:
  131. # 'manhole' (see docs/manhole.md),
  132. # 'metrics' (see docs/metrics-howto.md),
  133. # 'replication' (see docs/workers.md).
  134. #
  135. # tls: set to true to enable TLS for this listener. Will use the TLS
  136. # key/cert specified in tls_private_key_path / tls_certificate_path.
  137. #
  138. # x_forwarded: Only valid for an 'http' listener. Set to true to use the
  139. # X-Forwarded-For header as the client IP. Useful when Synapse is
  140. # behind a reverse-proxy.
  141. #
  142. # resources: Only valid for an 'http' listener. A list of resources to host
  143. # on this port. Options for each resource are:
  144. #
  145. # names: a list of names of HTTP resources. See below for a list of
  146. # valid resource names.
  147. #
  148. # compress: set to true to enable HTTP comression for this resource.
  149. #
  150. # additional_resources: Only valid for an 'http' listener. A map of
  151. # additional endpoints which should be loaded via dynamic modules.
  152. #
  153. # Valid resource names are:
  154. #
  155. # client: the client-server API (/_matrix/client), and the synapse admin
  156. # API (/_synapse/admin). Also implies 'media' and 'static'.
  157. #
  158. # consent: user consent forms (/_matrix/consent). See
  159. # docs/consent_tracking.md.
  160. #
  161. # federation: the server-server API (/_matrix/federation). Also implies
  162. # 'media', 'keys', 'openid'
  163. #
  164. # keys: the key discovery API (/_matrix/keys).
  165. #
  166. # media: the media API (/_matrix/media).
  167. #
  168. # metrics: the metrics interface. See docs/metrics-howto.md.
  169. #
  170. # openid: OpenID authentication.
  171. #
  172. # replication: the HTTP replication API (/_synapse/replication). See
  173. # docs/workers.md.
  174. #
  175. # static: static resources under synapse/static (/_matrix/static). (Mostly
  176. # useful for 'fallback authentication'.)
  177. #
  178. # webclient: A web client. Requires web_client_location to be set.
  179. #
  180. listeners:
  181. {% if matrix_synapse_metrics_enabled %}
  182. - type: metrics
  183. port: {{ matrix_synapse_metrics_port }}
  184. bind_addresses:
  185. - '0.0.0.0'
  186. {% endif %}
  187. {% if matrix_synapse_federation_enabled and matrix_synapse_tls_federation_listener_enabled %}
  188. # TLS-enabled listener: for when matrix traffic is sent directly to synapse.
  189. - port: 8448
  190. tls: true
  191. bind_addresses: ['::']
  192. type: http
  193. x_forwarded: false
  194. resources:
  195. - names: [federation]
  196. compress: false
  197. {% endif %}
  198. # Unsecure HTTP listener (Client API): for when matrix traffic passes through a reverse proxy
  199. # that unwraps TLS.
  200. - port: 8008
  201. tls: false
  202. bind_addresses: ['::']
  203. type: http
  204. x_forwarded: true
  205. resources:
  206. - names: [client]
  207. compress: false
  208. {% if matrix_synapse_federation_enabled %}
  209. # Unsecure HTTP listener (Federation API): for when matrix traffic passes through a reverse proxy
  210. # that unwraps TLS.
  211. - port: 8048
  212. tls: false
  213. bind_addresses: ['::']
  214. type: http
  215. x_forwarded: true
  216. resources:
  217. - names: [federation]
  218. compress: false
  219. {% endif %}
  220. {% if matrix_synapse_manhole_enabled %}
  221. # Turn on the twisted ssh manhole service on localhost on the given
  222. # port.
  223. - port: 9000
  224. bind_addresses: ['0.0.0.0']
  225. type: manhole
  226. {% endif %}
  227. {% if matrix_synapse_workers_enabled %}
  228. # c.f. https://github.com/matrix-org/synapse/tree/master/docs/workers.md
  229. # TCP replication: streaming data from the master to the workers
  230. - port: {{ matrix_synapse_replication_tcp_port }}
  231. bind_addresses: ['0.0.0.0']
  232. type: replication
  233. # HTTP replication: for the workers to send data to the main synapse process
  234. - port: {{ matrix_synapse_replication_http_port }}
  235. bind_addresses: ['0.0.0.0']
  236. type: http
  237. resources:
  238. - names: [replication]
  239. # c.f. https://github.com/matrix-org/synapse/tree/master/contrib/systemd-with-workers/README.md
  240. worker_app: synapse.app.homeserver
  241. # thx https://oznetnerd.com/2017/04/18/jinja2-selectattr-filter/
  242. # reduce the main worker's offerings to core homeserver business
  243. {% if matrix_synapse_workers_enabled_list|selectattr('worker', 'equalto', 'appservice')|list %}
  244. notify_appservices: false
  245. {% endif %}
  246. {% if matrix_synapse_workers_enabled_list|selectattr('worker', 'equalto', 'federation_sender')|list %}
  247. send_federation: false
  248. {% endif %}
  249. {% if matrix_synapse_workers_enabled_list|selectattr('worker', 'equalto', 'media_repository')|list %}
  250. enable_media_repo: false
  251. {% endif %}
  252. {% if matrix_synapse_workers_enabled_list|selectattr('worker', 'equalto', 'pusher')|list %}
  253. start_pushers: false
  254. {% endif %}
  255. {% if matrix_synapse_workers_enabled_list|selectattr('worker', 'equalto', 'user_dir')|list %}
  256. update_user_directory: false
  257. {% endif %}
  258. # rather let systemd handle the forking
  259. daemonize: false
  260. {% endif %}
  261. ## Homeserver blocking ##
  262. # How to reach the server admin, used in ResourceLimitError
  263. #
  264. #admin_contact: 'mailto:admin@server.com'
  265. # Global blocking
  266. #
  267. #hs_disabled: False
  268. #hs_disabled_message: 'Human readable reason for why the HS is blocked'
  269. #hs_disabled_limit_type: 'error code(str), to help clients decode reason'
  270. # Monthly Active User Blocking
  271. #
  272. # Used in cases where the admin or server owner wants to limit to the
  273. # number of monthly active users.
  274. #
  275. # 'limit_usage_by_mau' disables/enables monthly active user blocking. When
  276. # anabled and a limit is reached the server returns a 'ResourceLimitError'
  277. # with error type Codes.RESOURCE_LIMIT_EXCEEDED
  278. #
  279. # 'max_mau_value' is the hard limit of monthly active users above which
  280. # the server will start blocking user actions.
  281. #
  282. # 'mau_trial_days' is a means to add a grace period for active users. It
  283. # means that users must be active for this number of days before they
  284. # can be considered active and guards against the case where lots of users
  285. # sign up in a short space of time never to return after their initial
  286. # session.
  287. #
  288. #limit_usage_by_mau: False
  289. #max_mau_value: 50
  290. #mau_trial_days: 2
  291. # If enabled, the metrics for the number of monthly active users will
  292. # be populated, however no one will be limited. If limit_usage_by_mau
  293. # is true, this is implied to be true.
  294. #
  295. #mau_stats_only: False
  296. # Sometimes the server admin will want to ensure certain accounts are
  297. # never blocked by mau checking. These accounts are specified here.
  298. #
  299. #mau_limit_reserved_threepids:
  300. # - medium: 'email'
  301. # address: 'reserved_user@example.com'
  302. # Used by phonehome stats to group together related servers.
  303. #server_context: context
  304. # Resource-constrained homeserver Settings
  305. #
  306. # If limit_remote_rooms.enabled is True, the room complexity will be
  307. # checked before a user joins a new remote room. If it is above
  308. # limit_remote_rooms.complexity, it will disallow joining or
  309. # instantly leave.
  310. #
  311. # limit_remote_rooms.complexity_error can be set to customise the text
  312. # displayed to the user when a room above the complexity threshold has
  313. # its join cancelled.
  314. #
  315. # Uncomment the below lines to enable:
  316. #limit_remote_rooms:
  317. # enabled: True
  318. # complexity: 1.0
  319. # complexity_error: "This room is too complex."
  320. # Whether to require a user to be in the room to add an alias to it.
  321. # Defaults to 'true'.
  322. #
  323. #require_membership_for_aliases: false
  324. # Whether to allow per-room membership profiles through the send of membership
  325. # events with profile information that differ from the target's global profile.
  326. # Defaults to 'true'.
  327. #
  328. #allow_per_room_profiles: false
  329. # How long to keep redacted events in unredacted form in the database. After
  330. # this period redacted events get replaced with their redacted form in the DB.
  331. #
  332. # Defaults to `7d`. Set to `null` to disable.
  333. #
  334. #redaction_retention_period: 28d
  335. redaction_retention_period: {{ matrix_synapse_redaction_retention_period }}
  336. # How long to track users' last seen time and IPs in the database.
  337. #
  338. # Defaults to `28d`. Set to `null` to disable clearing out of old rows.
  339. #
  340. #user_ips_max_age: 14d
  341. user_ips_max_age: {{ matrix_synapse_user_ips_max_age }}
  342. # Message retention policy at the server level.
  343. #
  344. # Room admins and mods can define a retention period for their rooms using the
  345. # 'm.room.retention' state event, and server admins can cap this period by setting
  346. # the 'allowed_lifetime_min' and 'allowed_lifetime_max' config options.
  347. #
  348. # If this feature is enabled, Synapse will regularly look for and purge events
  349. # which are older than the room's maximum retention period. Synapse will also
  350. # filter events received over federation so that events that should have been
  351. # purged are ignored and not stored again.
  352. #
  353. retention:
  354. # The message retention policies feature is disabled by default. Uncomment the
  355. # following line to enable it.
  356. #
  357. #enabled: true
  358. # Default retention policy. If set, Synapse will apply it to rooms that lack the
  359. # 'm.room.retention' state event. Currently, the value of 'min_lifetime' doesn't
  360. # matter much because Synapse doesn't take it into account yet.
  361. #
  362. #default_policy:
  363. # min_lifetime: 1d
  364. # max_lifetime: 1y
  365. # Retention policy limits. If set, a user won't be able to send a
  366. # 'm.room.retention' event which features a 'min_lifetime' or a 'max_lifetime'
  367. # that's not within this range. This is especially useful in closed federations,
  368. # in which server admins can make sure every federating server applies the same
  369. # rules.
  370. #
  371. #allowed_lifetime_min: 1d
  372. #allowed_lifetime_max: 1y
  373. # Server admins can define the settings of the background jobs purging the
  374. # events which lifetime has expired under the 'purge_jobs' section.
  375. #
  376. # If no configuration is provided, a single job will be set up to delete expired
  377. # events in every room daily.
  378. #
  379. # Each job's configuration defines which range of message lifetimes the job
  380. # takes care of. For example, if 'shortest_max_lifetime' is '2d' and
  381. # 'longest_max_lifetime' is '3d', the job will handle purging expired events in
  382. # rooms whose state defines a 'max_lifetime' that's both higher than 2 days, and
  383. # lower than or equal to 3 days. Both the minimum and the maximum value of a
  384. # range are optional, e.g. a job with no 'shortest_max_lifetime' and a
  385. # 'longest_max_lifetime' of '3d' will handle every room with a retention policy
  386. # which 'max_lifetime' is lower than or equal to three days.
  387. #
  388. # The rationale for this per-job configuration is that some rooms might have a
  389. # retention policy with a low 'max_lifetime', where history needs to be purged
  390. # of outdated messages on a more frequent basis than for the rest of the rooms
  391. # (e.g. every 12h), but not want that purge to be performed by a job that's
  392. # iterating over every room it knows, which could be heavy on the server.
  393. #
  394. #purge_jobs:
  395. # - shortest_max_lifetime: 1d
  396. # longest_max_lifetime: 3d
  397. # interval: 12h
  398. # - shortest_max_lifetime: 3d
  399. # longest_max_lifetime: 1y
  400. # interval: 1d
  401. ## TLS ##
  402. # PEM-encoded X509 certificate for TLS.
  403. # This certificate, as of Synapse 1.0, will need to be a valid and verifiable
  404. # certificate, signed by a recognised Certificate Authority.
  405. #
  406. # See 'ACME support' below to enable auto-provisioning this certificate via
  407. # Let's Encrypt.
  408. #
  409. # If supplying your own, be sure to use a `.pem` file that includes the
  410. # full certificate chain including any intermediate certificates (for
  411. # instance, if using certbot, use `fullchain.pem` as your certificate,
  412. # not `cert.pem`).
  413. #
  414. tls_certificate_path: {{ matrix_synapse_tls_certificate_path|to_json }}
  415. # PEM-encoded private key for TLS
  416. #
  417. tls_private_key_path: {{ matrix_synapse_tls_private_key_path|to_json }}
  418. # Whether to verify TLS server certificates for outbound federation requests.
  419. #
  420. # Defaults to `true`. To disable certificate verification, uncomment the
  421. # following line.
  422. #
  423. #federation_verify_certificates: false
  424. # The minimum TLS version that will be used for outbound federation requests.
  425. #
  426. # Defaults to `1`. Configurable to `1`, `1.1`, `1.2`, or `1.3`. Note
  427. # that setting this value higher than `1.2` will prevent federation to most
  428. # of the public Matrix network: only configure it to `1.3` if you have an
  429. # entirely private federation setup and you can ensure TLS 1.3 support.
  430. #
  431. #federation_client_minimum_tls_version: 1.2
  432. # Skip federation certificate verification on the following whitelist
  433. # of domains.
  434. #
  435. # This setting should only be used in very specific cases, such as
  436. # federation over Tor hidden services and similar. For private networks
  437. # of homeservers, you likely want to use a private CA instead.
  438. #
  439. # Only effective if federation_verify_certicates is `true`.
  440. #
  441. #federation_certificate_verification_whitelist:
  442. # - lon.example.com
  443. # - *.domain.com
  444. # - *.onion
  445. # List of custom certificate authorities for federation traffic.
  446. #
  447. # This setting should only normally be used within a private network of
  448. # homeservers.
  449. #
  450. # Note that this list will replace those that are provided by your
  451. # operating environment. Certificates must be in PEM format.
  452. #
  453. #federation_custom_ca_list:
  454. # - myCA1.pem
  455. # - myCA2.pem
  456. # - myCA3.pem
  457. # ACME support: This will configure Synapse to request a valid TLS certificate
  458. # for your configured `server_name` via Let's Encrypt.
  459. #
  460. # Note that ACME v1 is now deprecated, and Synapse currently doesn't support
  461. # ACME v2. This means that this feature currently won't work with installs set
  462. # up after November 2019. For more info, and alternative solutions, see
  463. # https://github.com/matrix-org/synapse/blob/master/docs/ACME.md#deprecation-of-acme-v1
  464. #
  465. # Note that provisioning a certificate in this way requires port 80 to be
  466. # routed to Synapse so that it can complete the http-01 ACME challenge.
  467. # By default, if you enable ACME support, Synapse will attempt to listen on
  468. # port 80 for incoming http-01 challenges - however, this will likely fail
  469. # with 'Permission denied' or a similar error.
  470. #
  471. # There are a couple of potential solutions to this:
  472. #
  473. # * If you already have an Apache, Nginx, or similar listening on port 80,
  474. # you can configure Synapse to use an alternate port, and have your web
  475. # server forward the requests. For example, assuming you set 'port: 8009'
  476. # below, on Apache, you would write:
  477. #
  478. # ProxyPass /.well-known/acme-challenge http://localhost:8009/.well-known/acme-challenge
  479. #
  480. # * Alternatively, you can use something like `authbind` to give Synapse
  481. # permission to listen on port 80.
  482. #
  483. acme:
  484. # ACME support is disabled by default. Uncomment the following line
  485. # (and tls_certificate_path and tls_private_key_path above) to enable it.
  486. #
  487. #enabled: true
  488. # Endpoint to use to request certificates. If you only want to test,
  489. # use Let's Encrypt's staging url:
  490. # https://acme-staging.api.letsencrypt.org/directory
  491. #
  492. #url: https://acme-v01.api.letsencrypt.org/directory
  493. # Port number to listen on for the HTTP-01 challenge. Change this if
  494. # you are forwarding connections through Apache/Nginx/etc.
  495. #
  496. #port: 80
  497. # Local addresses to listen on for incoming connections.
  498. # Again, you may want to change this if you are forwarding connections
  499. # through Apache/Nginx/etc.
  500. #
  501. #bind_addresses: ['::', '0.0.0.0']
  502. # How many days remaining on a certificate before it is renewed.
  503. #
  504. #reprovision_threshold: 30
  505. # The domain that the certificate should be for. Normally this
  506. # should be the same as your Matrix domain (i.e., 'server_name'), but,
  507. # by putting a file at 'https://<server_name>/.well-known/matrix/server',
  508. # you can delegate incoming traffic to another server. If you do that,
  509. # you should give the target of the delegation here.
  510. #
  511. # For example: if your 'server_name' is 'example.com', but
  512. # 'https://example.com/.well-known/matrix/server' delegates to
  513. # 'matrix.example.com', you should put 'matrix.example.com' here.
  514. #
  515. # If not set, defaults to your 'server_name'.
  516. #
  517. #domain: matrix.example.com
  518. # file to use for the account key. This will be generated if it doesn't
  519. # exist.
  520. #
  521. # If unspecified, we will use CONFDIR/client.key.
  522. #
  523. #account_key_file: /data/acme_account.key
  524. # List of allowed TLS fingerprints for this server to publish along
  525. # with the signing keys for this server. Other matrix servers that
  526. # make HTTPS requests to this server will check that the TLS
  527. # certificates returned by this server match one of the fingerprints.
  528. #
  529. # Synapse automatically adds the fingerprint of its own certificate
  530. # to the list. So if federation traffic is handled directly by synapse
  531. # then no modification to the list is required.
  532. #
  533. # If synapse is run behind a load balancer that handles the TLS then it
  534. # will be necessary to add the fingerprints of the certificates used by
  535. # the loadbalancers to this list if they are different to the one
  536. # synapse is using.
  537. #
  538. # Homeservers are permitted to cache the list of TLS fingerprints
  539. # returned in the key responses up to the "valid_until_ts" returned in
  540. # key. It may be necessary to publish the fingerprints of a new
  541. # certificate and wait until the "valid_until_ts" of the previous key
  542. # responses have passed before deploying it.
  543. #
  544. # You can calculate a fingerprint from a given TLS listener via:
  545. # openssl s_client -connect $host:$port < /dev/null 2> /dev/null |
  546. # openssl x509 -outform DER | openssl sha256 -binary | base64 | tr -d '='
  547. # or by checking matrix.org/federationtester/api/report?server_name=$host
  548. #
  549. #tls_fingerprints: [{"sha256": "<base64_encoded_sha256_fingerprint>"}]
  550. ## Database ##
  551. database:
  552. # The database engine name
  553. name: "psycopg2"
  554. args:
  555. user: {{ matrix_synapse_database_user|string|to_json }}
  556. password: {{ matrix_synapse_database_password|string|to_json }}
  557. database: "{{ matrix_synapse_database_database }}"
  558. host: "{{ matrix_synapse_database_host }}"
  559. cp_min: 5
  560. cp_max: 10
  561. # Number of events to cache in memory.
  562. #
  563. event_cache_size: "{{ matrix_synapse_event_cache_size }}"
  564. ## Logging ##
  565. # A yaml python logging config file as described by
  566. # https://docs.python.org/3.7/library/logging.config.html#configuration-dictionary-schema
  567. #
  568. log_config: "/data/{{ matrix_server_fqn_matrix }}.log.config"
  569. ## Ratelimiting ##
  570. # Ratelimiting settings for client actions (registration, login, messaging).
  571. #
  572. # Each ratelimiting configuration is made of two parameters:
  573. # - per_second: number of requests a client can send per second.
  574. # - burst_count: number of requests a client can send before being throttled.
  575. #
  576. # Synapse currently uses the following configurations:
  577. # - one for messages that ratelimits sending based on the account the client
  578. # is using
  579. # - one for registration that ratelimits registration requests based on the
  580. # client's IP address.
  581. # - one for login that ratelimits login requests based on the client's IP
  582. # address.
  583. # - one for login that ratelimits login requests based on the account the
  584. # client is attempting to log into.
  585. # - one for login that ratelimits login requests based on the account the
  586. # client is attempting to log into, based on the amount of failed login
  587. # attempts for this account.
  588. # - one for ratelimiting redactions by room admins. If this is not explicitly
  589. # set then it uses the same ratelimiting as per rc_message. This is useful
  590. # to allow room admins to deal with abuse quickly.
  591. #
  592. # The defaults are as shown below.
  593. #
  594. #rc_message:
  595. # per_second: 0.2
  596. # burst_count: 10
  597. rc_message: {{ matrix_synapse_rc_message|to_json }}
  598. #
  599. #rc_registration:
  600. # per_second: 0.17
  601. # burst_count: 3
  602. rc_registration: {{ matrix_synapse_rc_registration|to_json }}
  603. #
  604. #rc_login:
  605. # address:
  606. # per_second: 0.17
  607. # burst_count: 3
  608. # account:
  609. # per_second: 0.17
  610. # burst_count: 3
  611. # failed_attempts:
  612. # per_second: 0.17
  613. # burst_count: 3
  614. rc_login: {{ matrix_synapse_rc_login|to_json }}
  615. #
  616. #rc_admin_redaction:
  617. # per_second: 1
  618. # burst_count: 50
  619. # Ratelimiting settings for incoming federation
  620. #
  621. # The rc_federation configuration is made up of the following settings:
  622. # - window_size: window size in milliseconds
  623. # - sleep_limit: number of federation requests from a single server in
  624. # a window before the server will delay processing the request.
  625. # - sleep_delay: duration in milliseconds to delay processing events
  626. # from remote servers by if they go over the sleep limit.
  627. # - reject_limit: maximum number of concurrent federation requests
  628. # allowed from a single server
  629. # - concurrent: number of federation requests to concurrently process
  630. # from a single server
  631. #
  632. # The defaults are as shown below.
  633. #
  634. #rc_federation:
  635. # window_size: 1000
  636. # sleep_limit: 10
  637. # sleep_delay: 500
  638. # reject_limit: 50
  639. # concurrent: 3
  640. rc_federation: {{ matrix_synapse_rc_federation|to_json }}
  641. # Target outgoing federation transaction frequency for sending read-receipts,
  642. # per-room.
  643. #
  644. # If we end up trying to send out more read-receipts, they will get buffered up
  645. # into fewer transactions.
  646. #
  647. #federation_rr_transactions_per_room_per_second: 50
  648. federation_rr_transactions_per_room_per_second: {{ matrix_synapse_federation_rr_transactions_per_room_per_second }}
  649. ## Media Store ##
  650. # Enable the media store service in the Synapse master. Uncomment the
  651. # following if you are using a separate media store worker.
  652. #
  653. #enable_media_repo: false
  654. # Directory where uploaded images and attachments are stored.
  655. #
  656. media_store_path: "/matrix-media-store-parent/{{ matrix_synapse_media_store_directory_name }}"
  657. # Media storage providers allow media to be stored in different
  658. # locations.
  659. #
  660. #media_storage_providers:
  661. # - module: file_system
  662. # # Whether to write new local files.
  663. # store_local: false
  664. # # Whether to write new remote media
  665. # store_remote: false
  666. # # Whether to block upload requests waiting for write to this
  667. # # provider to complete
  668. # store_synchronous: false
  669. # config:
  670. # directory: /mnt/some/other/directory
  671. # Directory where in-progress uploads are stored.
  672. #
  673. uploads_path: "/matrix-run/uploads"
  674. # The largest allowed upload size in bytes
  675. #
  676. max_upload_size: "{{ matrix_synapse_max_upload_size_mb }}M"
  677. # Maximum number of pixels that will be thumbnailed
  678. #
  679. #max_image_pixels: 32M
  680. # Whether to generate new thumbnails on the fly to precisely match
  681. # the resolution requested by the client. If true then whenever
  682. # a new resolution is requested by the client the server will
  683. # generate a new thumbnail. If false the server will pick a thumbnail
  684. # from a precalculated list.
  685. #
  686. #dynamic_thumbnails: false
  687. # List of thumbnails to precalculate when an image is uploaded.
  688. #
  689. #thumbnail_sizes:
  690. # - width: 32
  691. # height: 32
  692. # method: crop
  693. # - width: 96
  694. # height: 96
  695. # method: crop
  696. # - width: 320
  697. # height: 240
  698. # method: scale
  699. # - width: 640
  700. # height: 480
  701. # method: scale
  702. # - width: 800
  703. # height: 600
  704. # method: scale
  705. # Is the preview URL API enabled?
  706. #
  707. # 'false' by default: uncomment the following to enable it (and specify a
  708. # url_preview_ip_range_blacklist blacklist).
  709. #
  710. url_preview_enabled: {{ matrix_synapse_url_preview_enabled|to_json }}
  711. # List of IP address CIDR ranges that the URL preview spider is denied
  712. # from accessing. There are no defaults: you must explicitly
  713. # specify a list for URL previewing to work. You should specify any
  714. # internal services in your network that you do not want synapse to try
  715. # to connect to, otherwise anyone in any Matrix room could cause your
  716. # synapse to issue arbitrary GET requests to your internal services,
  717. # causing serious security issues.
  718. #
  719. # (0.0.0.0 and :: are always blacklisted, whether or not they are explicitly
  720. # listed here, since they correspond to unroutable addresses.)
  721. #
  722. # This must be specified if url_preview_enabled is set. It is recommended that
  723. # you uncomment the following list as a starting point.
  724. #
  725. url_preview_ip_range_blacklist:
  726. - '127.0.0.0/8'
  727. - '10.0.0.0/8'
  728. - '172.16.0.0/12'
  729. - '192.168.0.0/16'
  730. - '100.64.0.0/10'
  731. - '169.254.0.0/16'
  732. - '::1/128'
  733. - 'fe80::/64'
  734. - 'fc00::/7'
  735. # List of IP address CIDR ranges that the URL preview spider is allowed
  736. # to access even if they are specified in url_preview_ip_range_blacklist.
  737. # This is useful for specifying exceptions to wide-ranging blacklisted
  738. # target IP ranges - e.g. for enabling URL previews for a specific private
  739. # website only visible in your network.
  740. #
  741. #url_preview_ip_range_whitelist:
  742. # - '192.168.1.1'
  743. # Optional list of URL matches that the URL preview spider is
  744. # denied from accessing. You should use url_preview_ip_range_blacklist
  745. # in preference to this, otherwise someone could define a public DNS
  746. # entry that points to a private IP address and circumvent the blacklist.
  747. # This is more useful if you know there is an entire shape of URL that
  748. # you know that will never want synapse to try to spider.
  749. #
  750. # Each list entry is a dictionary of url component attributes as returned
  751. # by urlparse.urlsplit as applied to the absolute form of the URL. See
  752. # https://docs.python.org/2/library/urlparse.html#urlparse.urlsplit
  753. # The values of the dictionary are treated as an filename match pattern
  754. # applied to that component of URLs, unless they start with a ^ in which
  755. # case they are treated as a regular expression match. If all the
  756. # specified component matches for a given list item succeed, the URL is
  757. # blacklisted.
  758. #
  759. #url_preview_url_blacklist:
  760. # # blacklist any URL with a username in its URI
  761. # - username: '*'
  762. #
  763. # # blacklist all *.google.com URLs
  764. # - netloc: 'google.com'
  765. # - netloc: '*.google.com'
  766. #
  767. # # blacklist all plain HTTP URLs
  768. # - scheme: 'http'
  769. #
  770. # # blacklist http(s)://www.acme.com/foo
  771. # - netloc: 'www.acme.com'
  772. # path: '/foo'
  773. #
  774. # # blacklist any URL with a literal IPv4 address
  775. # - netloc: '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$'
  776. # The largest allowed URL preview spidering size in bytes
  777. #
  778. max_spider_size: 10M
  779. ## Captcha ##
  780. # See docs/CAPTCHA_SETUP for full details of configuring this.
  781. # This homeserver's ReCAPTCHA public key.
  782. #
  783. #recaptcha_public_key: "YOUR_PUBLIC_KEY"
  784. # This homeserver's ReCAPTCHA private key.
  785. #
  786. #recaptcha_private_key: "YOUR_PRIVATE_KEY"
  787. # Enables ReCaptcha checks when registering, preventing signup
  788. # unless a captcha is answered. Requires a valid ReCaptcha
  789. # public/private key.
  790. #
  791. #enable_registration_captcha: false
  792. # A secret key used to bypass the captcha test entirely.
  793. #
  794. #captcha_bypass_secret: "YOUR_SECRET_HERE"
  795. # The API endpoint to use for verifying m.login.recaptcha responses.
  796. #
  797. #recaptcha_siteverify_api: "https://www.recaptcha.net/recaptcha/api/siteverify"
  798. ## TURN ##
  799. # The public URIs of the TURN server to give to clients
  800. #
  801. turn_uris: {{ matrix_synapse_turn_uris|to_json }}
  802. # The shared secret used to compute passwords for the TURN server
  803. #
  804. turn_shared_secret: {{ matrix_synapse_turn_shared_secret|string|to_json }}
  805. # The Username and password if the TURN server needs them and
  806. # does not use a token
  807. #
  808. #turn_username: "TURNSERVER_USERNAME"
  809. #turn_password: "TURNSERVER_PASSWORD"
  810. # How long generated TURN credentials last
  811. #
  812. #turn_user_lifetime: 1h
  813. # Whether guests should be allowed to use the TURN server.
  814. # This defaults to True, otherwise VoIP will be unreliable for guests.
  815. # However, it does introduce a slight security risk as it allows users to
  816. # connect to arbitrary endpoints without having first signed up for a
  817. # valid account (e.g. by passing a CAPTCHA).
  818. #
  819. turn_allow_guests: {{ matrix_synapse_turn_allow_guests|to_json }}
  820. ## Registration ##
  821. #
  822. # Registration can be rate-limited using the parameters in the "Ratelimiting"
  823. # section of this file.
  824. # Enable registration for new users.
  825. #
  826. enable_registration: {{ matrix_synapse_enable_registration|to_json }}
  827. # Optional account validity configuration. This allows for accounts to be denied
  828. # any request after a given period.
  829. #
  830. # Once this feature is enabled, Synapse will look for registered users without an
  831. # expiration date at startup and will add one to every account it found using the
  832. # current settings at that time.
  833. # This means that, if a validity period is set, and Synapse is restarted (it will
  834. # then derive an expiration date from the current validity period), and some time
  835. # after that the validity period changes and Synapse is restarted, the users'
  836. # expiration dates won't be updated unless their account is manually renewed. This
  837. # date will be randomly selected within a range [now + period - d ; now + period],
  838. # where d is equal to 10% of the validity period.
  839. #
  840. account_validity:
  841. # The account validity feature is disabled by default. Uncomment the
  842. # following line to enable it.
  843. #
  844. #enabled: true
  845. # The period after which an account is valid after its registration. When
  846. # renewing the account, its validity period will be extended by this amount
  847. # of time. This parameter is required when using the account validity
  848. # feature.
  849. #
  850. #period: 6w
  851. # The amount of time before an account's expiry date at which Synapse will
  852. # send an email to the account's email address with a renewal link. By
  853. # default, no such emails are sent.
  854. #
  855. # If you enable this setting, you will also need to fill out the 'email' and
  856. # 'public_baseurl' configuration sections.
  857. #
  858. #renew_at: 1w
  859. # The subject of the email sent out with the renewal link. '%(app)s' can be
  860. # used as a placeholder for the 'app_name' parameter from the 'email'
  861. # section.
  862. #
  863. # Note that the placeholder must be written '%(app)s', including the
  864. # trailing 's'.
  865. #
  866. # If this is not set, a default value is used.
  867. #
  868. #renew_email_subject: "Renew your %(app)s account"
  869. # Directory in which Synapse will try to find templates for the HTML files to
  870. # serve to the user when trying to renew an account. If not set, default
  871. # templates from within the Synapse package will be used.
  872. #
  873. #template_dir: "res/templates"
  874. # File within 'template_dir' giving the HTML to be displayed to the user after
  875. # they successfully renewed their account. If not set, default text is used.
  876. #
  877. #account_renewed_html_path: "account_renewed.html"
  878. # File within 'template_dir' giving the HTML to be displayed when the user
  879. # tries to renew an account with an invalid renewal token. If not set,
  880. # default text is used.
  881. #
  882. #invalid_token_html_path: "invalid_token.html"
  883. # The user must provide all of the below types of 3PID when registering.
  884. #
  885. #registrations_require_3pid:
  886. # - email
  887. # - msisdn
  888. {% if matrix_synapse_registrations_require_3pid|length > 0 %}
  889. registrations_require_3pid: {{ matrix_synapse_registrations_require_3pid|to_json }}
  890. {% endif %}
  891. # Explicitly disable asking for MSISDNs from the registration
  892. # flow (overrides registrations_require_3pid if MSISDNs are set as required)
  893. #
  894. #disable_msisdn_registration: true
  895. # Mandate that users are only allowed to associate certain formats of
  896. # 3PIDs with accounts on this server.
  897. #
  898. #allowed_local_3pids:
  899. # - medium: email
  900. # pattern: '.*@matrix\.org'
  901. # - medium: email
  902. # pattern: '.*@vector\.im'
  903. # - medium: msisdn
  904. # pattern: '\+44'
  905. {% if matrix_synapse_allowed_local_3pids|length > 0 %}
  906. allowed_local_3pids: {{ matrix_synapse_allowed_local_3pids|to_json }}
  907. {% endif %}
  908. # Enable 3PIDs lookup requests to identity servers from this server.
  909. #
  910. #enable_3pid_lookup: true
  911. # If set, allows registration of standard or admin accounts by anyone who
  912. # has the shared secret, even if registration is otherwise disabled.
  913. #
  914. registration_shared_secret: {{ matrix_synapse_registration_shared_secret|string|to_json }}
  915. # Set the number of bcrypt rounds used to generate password hash.
  916. # Larger numbers increase the work factor needed to generate the hash.
  917. # The default number is 12 (which equates to 2^12 rounds).
  918. # N.B. that increasing this will exponentially increase the time required
  919. # to register or login - e.g. 24 => 2^24 rounds which will take >20 mins.
  920. #
  921. #bcrypt_rounds: 12
  922. # Allows users to register as guests without a password/email/etc, and
  923. # participate in rooms hosted on this server which have been made
  924. # accessible to anonymous users.
  925. #
  926. allow_guest_access: {{ matrix_synapse_allow_guest_access|to_json }}
  927. # The identity server which we suggest that clients should use when users log
  928. # in on this server.
  929. #
  930. # (By default, no suggestion is made, so it is left up to the client.
  931. # This setting is ignored unless public_baseurl is also set.)
  932. #
  933. #default_identity_server: https://matrix.org
  934. # The list of identity servers trusted to verify third party
  935. # identifiers by this server.
  936. #
  937. # Also defines the ID server which will be called when an account is
  938. # deactivated (one will be picked arbitrarily).
  939. #
  940. # Note: This option is deprecated. Since v0.99.4, Synapse has tracked which identity
  941. # server a 3PID has been bound to. For 3PIDs bound before then, Synapse runs a
  942. # background migration script, informing itself that the identity server all of its
  943. # 3PIDs have been bound to is likely one of the below.
  944. #
  945. # As of Synapse v1.4.0, all other functionality of this option has been deprecated, and
  946. # it is now solely used for the purposes of the background migration script, and can be
  947. # removed once it has run.
  948. {% if matrix_synapse_trusted_third_party_id_servers|length > 0 %}
  949. trusted_third_party_id_servers:
  950. {{ matrix_synapse_trusted_third_party_id_servers|to_nice_yaml }}
  951. {% endif %}
  952. # Handle threepid (email/phone etc) registration and password resets through a set of
  953. # *trusted* identity servers. Note that this allows the configured identity server to
  954. # reset passwords for accounts!
  955. #
  956. # Be aware that if `email` is not set, and SMTP options have not been
  957. # configured in the email config block, registration and user password resets via
  958. # email will be globally disabled.
  959. #
  960. # Additionally, if `msisdn` is not set, registration and password resets via msisdn
  961. # will be disabled regardless. This is due to Synapse currently not supporting any
  962. # method of sending SMS messages on its own.
  963. #
  964. # To enable using an identity server for operations regarding a particular third-party
  965. # identifier type, set the value to the URL of that identity server as shown in the
  966. # examples below.
  967. #
  968. # Servers handling the these requests must answer the `/requestToken` endpoints defined
  969. # by the Matrix Identity Service API specification:
  970. # https://matrix.org/docs/spec/identity_service/latest
  971. #
  972. # If a delegate is specified, the config option public_baseurl must also be filled out.
  973. #
  974. account_threepid_delegates:
  975. email: {{ matrix_synapse_account_threepid_delegates_email|to_json }}
  976. msisdn: {{ matrix_synapse_account_threepid_delegates_msisdn|to_json }}
  977. # Users who register on this homeserver will automatically be joined
  978. # to these rooms
  979. #
  980. #auto_join_rooms:
  981. # - "#example:example.com"
  982. {% if matrix_synapse_auto_join_rooms|length > 0 %}
  983. auto_join_rooms:
  984. {{ matrix_synapse_auto_join_rooms|to_nice_yaml }}
  985. {% endif %}
  986. # Where auto_join_rooms are specified, setting this flag ensures that the
  987. # the rooms exist by creating them when the first user on the
  988. # homeserver registers.
  989. # Setting to false means that if the rooms are not manually created,
  990. # users cannot be auto-joined since they do not exist.
  991. #
  992. autocreate_auto_join_rooms: {{ matrix_synapse_autocreate_auto_join_rooms|to_json }}
  993. ## Metrics ###
  994. # Enable collection and rendering of performance metrics
  995. #
  996. enable_metrics: {{ matrix_synapse_metrics_enabled|to_json }}
  997. # Enable sentry integration
  998. # NOTE: While attempts are made to ensure that the logs don't contain
  999. # any sensitive information, this cannot be guaranteed. By enabling
  1000. # this option the sentry server may therefore receive sensitive
  1001. # information, and it in turn may then diseminate sensitive information
  1002. # through insecure notification channels if so configured.
  1003. #
  1004. {% if matrix_synapse_sentry_dsn != "" %}
  1005. sentry:
  1006. dsn: {{ matrix_synapse_sentry_dsn|to_json }}
  1007. {% endif %}
  1008. # Flags to enable Prometheus metrics which are not suitable to be
  1009. # enabled by default, either for performance reasons or limited use.
  1010. #
  1011. metrics_flags:
  1012. # Publish synapse_federation_known_servers, a g auge of the number of
  1013. # servers this homeserver knows about, including itself. May cause
  1014. # performance problems on large homeservers.
  1015. #
  1016. #known_servers: true
  1017. # Whether or not to report anonymized homeserver usage statistics.
  1018. report_stats: {{ matrix_synapse_report_stats|to_json }}
  1019. # The endpoint to report the anonymized homeserver usage statistics to.
  1020. # Defaults to https://matrix.org/report-usage-stats/push
  1021. #
  1022. #report_stats_endpoint: https://example.com/report-usage-stats/push
  1023. ## API Configuration ##
  1024. # A list of event types that will be included in the room_invite_state
  1025. #
  1026. #room_invite_state_types:
  1027. # - "m.room.join_rules"
  1028. # - "m.room.canonical_alias"
  1029. # - "m.room.avatar"
  1030. # - "m.room.encryption"
  1031. # - "m.room.name"
  1032. # A list of application service config files to use
  1033. #
  1034. app_service_config_files: {{ matrix_synapse_app_service_config_files|to_json }}
  1035. # Uncomment to enable tracking of application service IP addresses. Implicitly
  1036. # enables MAU tracking for application service users.
  1037. #
  1038. #track_appservice_user_ips: True
  1039. # a secret which is used to sign access tokens. If none is specified,
  1040. # the registration_shared_secret is used, if one is given; otherwise,
  1041. # a secret key is derived from the signing key.
  1042. #
  1043. macaroon_secret_key: {{ matrix_synapse_macaroon_secret_key|string|to_json }}
  1044. # a secret which is used to calculate HMACs for form values, to stop
  1045. # falsification of values. Must be specified for the User Consent
  1046. # forms to work.
  1047. #
  1048. form_secret: {{ matrix_synapse_form_secret|string|to_json }}
  1049. ## Signing Keys ##
  1050. # Path to the signing key to sign messages with
  1051. #
  1052. signing_key_path: "/data/{{ matrix_server_fqn_matrix }}.signing.key"
  1053. # The keys that the server used to sign messages with but won't use
  1054. # to sign new messages.
  1055. #
  1056. old_signing_keys:
  1057. # For each key, `key` should be the base64-encoded public key, and
  1058. # `expired_ts`should be the time (in milliseconds since the unix epoch) that
  1059. # it was last used.
  1060. #
  1061. # It is possible to build an entry from an old signing.key file using the
  1062. # `export_signing_key` script which is provided with synapse.
  1063. #
  1064. # For example:
  1065. #
  1066. #"ed25519:id": { key: "base64string", expired_ts: 123456789123 }
  1067. # How long key response published by this server is valid for.
  1068. # Used to set the valid_until_ts in /key/v2 APIs.
  1069. # Determines how quickly servers will query to check which keys
  1070. # are still valid.
  1071. #
  1072. #key_refresh_interval: 1d
  1073. # The trusted servers to download signing keys from.
  1074. #
  1075. # When we need to fetch a signing key, each server is tried in parallel.
  1076. #
  1077. # Normally, the connection to the key server is validated via TLS certificates.
  1078. # Additional security can be provided by configuring a `verify key`, which
  1079. # will make synapse check that the response is signed by that key.
  1080. #
  1081. # This setting supercedes an older setting named `perspectives`. The old format
  1082. # is still supported for backwards-compatibility, but it is deprecated.
  1083. #
  1084. # 'trusted_key_servers' defaults to matrix.org, but using it will generate a
  1085. # warning on start-up. To suppress this warning, set
  1086. # 'suppress_key_server_warning' to true.
  1087. #
  1088. # Options for each entry in the list include:
  1089. #
  1090. # server_name: the name of the server. required.
  1091. #
  1092. # verify_keys: an optional map from key id to base64-encoded public key.
  1093. # If specified, we will check that the response is signed by at least
  1094. # one of the given keys.
  1095. #
  1096. # accept_keys_insecurely: a boolean. Normally, if `verify_keys` is unset,
  1097. # and federation_verify_certificates is not `true`, synapse will refuse
  1098. # to start, because this would allow anyone who can spoof DNS responses
  1099. # to masquerade as the trusted key server. If you know what you are doing
  1100. # and are sure that your network environment provides a secure connection
  1101. # to the key server, you can set this to `true` to override this
  1102. # behaviour.
  1103. #
  1104. # An example configuration might look like:
  1105. #
  1106. #trusted_key_servers:
  1107. # - server_name: "my_trusted_server.example.com"
  1108. # verify_keys:
  1109. # "ed25519:auto": "abcdefghijklmnopqrstuvwxyzabcdefghijklmopqr"
  1110. # - server_name: "my_other_trusted_server.example.com"
  1111. #
  1112. trusted_key_servers: {{ matrix_synapse_trusted_key_servers|to_json }}
  1113. # Uncomment the following to disable the warning that is emitted when the
  1114. # trusted_key_servers include 'matrix.org'. See above.
  1115. #
  1116. #suppress_key_server_warning: true
  1117. # The signing keys to use when acting as a trusted key server. If not specified
  1118. # defaults to the server signing key.
  1119. #
  1120. # Can contain multiple keys, one per line.
  1121. #
  1122. #key_server_signing_keys_path: "key_server_signing_keys.key"
  1123. # Enable SAML2 for registration and login. Uses pysaml2.
  1124. #
  1125. # At least one of `sp_config` or `config_path` must be set in this section to
  1126. # enable SAML login.
  1127. #
  1128. # (You will probably also want to set the following options to `false` to
  1129. # disable the regular login/registration flows:
  1130. # * enable_registration
  1131. # * password_config.enabled
  1132. #
  1133. # Once SAML support is enabled, a metadata file will be exposed at
  1134. # https://<server>:<port>/_matrix/saml2/metadata.xml, which you may be able to
  1135. # use to configure your SAML IdP with. Alternatively, you can manually configure
  1136. # the IdP to use an ACS location of
  1137. # https://<server>:<port>/_matrix/saml2/authn_response.
  1138. #
  1139. saml2_config:
  1140. # `sp_config` is the configuration for the pysaml2 Service Provider.
  1141. # See pysaml2 docs for format of config.
  1142. #
  1143. # Default values will be used for the 'entityid' and 'service' settings,
  1144. # so it is not normally necessary to specify them unless you need to
  1145. # override them.
  1146. #
  1147. #sp_config:
  1148. # # point this to the IdP's metadata. You can use either a local file or
  1149. # # (preferably) a URL.
  1150. # metadata:
  1151. # #local: ["saml2/idp.xml"]
  1152. # remote:
  1153. # - url: https://our_idp/metadata.xml
  1154. #
  1155. # # By default, the user has to go to our login page first. If you'd like
  1156. # # to allow IdP-initiated login, set 'allow_unsolicited: true' in a
  1157. # # 'service.sp' section:
  1158. # #
  1159. # #service:
  1160. # # sp:
  1161. # # allow_unsolicited: true
  1162. #
  1163. # # The examples below are just used to generate our metadata xml, and you
  1164. # # may well not need them, depending on your setup. Alternatively you
  1165. # # may need a whole lot more detail - see the pysaml2 docs!
  1166. #
  1167. # description: ["My awesome SP", "en"]
  1168. # name: ["Test SP", "en"]
  1169. #
  1170. # organization:
  1171. # name: Example com
  1172. # display_name:
  1173. # - ["Example co", "en"]
  1174. # url: "http://example.com"
  1175. #
  1176. # contact_person:
  1177. # - given_name: Bob
  1178. # sur_name: "the Sysadmin"
  1179. # email_address": ["admin@example.com"]
  1180. # contact_type": technical
  1181. # Instead of putting the config inline as above, you can specify a
  1182. # separate pysaml2 configuration file:
  1183. #
  1184. #config_path: "/data/sp_conf.py"
  1185. # The lifetime of a SAML session. This defines how long a user has to
  1186. # complete the authentication process, if allow_unsolicited is unset.
  1187. # The default is 5 minutes.
  1188. #
  1189. #saml_session_lifetime: 5m
  1190. # An external module can be provided here as a custom solution to
  1191. # mapping attributes returned from a saml provider onto a matrix user.
  1192. #
  1193. user_mapping_provider:
  1194. # The custom module's class. Uncomment to use a custom module.
  1195. #
  1196. #module: mapping_provider.SamlMappingProvider
  1197. # Custom configuration values for the module. Below options are
  1198. # intended for the built-in provider, they should be changed if
  1199. # using a custom module. This section will be passed as a Python
  1200. # dictionary to the module's `parse_config` method.
  1201. #
  1202. config:
  1203. # The SAML attribute (after mapping via the attribute maps) to use
  1204. # to derive the Matrix ID from. 'uid' by default.
  1205. #
  1206. # Note: This used to be configured by the
  1207. # saml2_config.mxid_source_attribute option. If that is still
  1208. # defined, its value will be used instead.
  1209. #
  1210. #mxid_source_attribute: displayName
  1211. # The mapping system to use for mapping the saml attribute onto a
  1212. # matrix ID.
  1213. #
  1214. # Options include:
  1215. # * 'hexencode' (which maps unpermitted characters to '=xx')
  1216. # * 'dotreplace' (which replaces unpermitted characters with
  1217. # '.').
  1218. # The default is 'hexencode'.
  1219. #
  1220. # Note: This used to be configured by the
  1221. # saml2_config.mxid_mapping option. If that is still defined, its
  1222. # value will be used instead.
  1223. #
  1224. #mxid_mapping: dotreplace
  1225. # In previous versions of synapse, the mapping from SAML attribute to
  1226. # MXID was always calculated dynamically rather than stored in a
  1227. # table. For backwards- compatibility, we will look for user_ids
  1228. # matching such a pattern before creating a new account.
  1229. #
  1230. # This setting controls the SAML attribute which will be used for this
  1231. # backwards-compatibility lookup. Typically it should be 'uid', but if
  1232. # the attribute maps are changed, it may be necessary to change it.
  1233. #
  1234. # The default is 'uid'.
  1235. #
  1236. #grandfathered_mxid_source_attribute: upn
  1237. # Directory in which Synapse will try to find the template files below.
  1238. # If not set, default templates from within the Synapse package will be used.
  1239. #
  1240. # DO NOT UNCOMMENT THIS SETTING unless you want to customise the templates.
  1241. # If you *do* uncomment it, you will need to make sure that all the templates
  1242. # below are in the directory.
  1243. #
  1244. # Synapse will look for the following templates in this directory:
  1245. #
  1246. # * HTML page to display to users if something goes wrong during the
  1247. # authentication process: 'saml_error.html'.
  1248. #
  1249. # This template doesn't currently need any variable to render.
  1250. #
  1251. # You can see the default templates at:
  1252. # https://github.com/matrix-org/synapse/tree/master/synapse/res/templates
  1253. #
  1254. #template_dir: "res/templates"
  1255. # Enable CAS for registration and login.
  1256. #
  1257. #cas_config:
  1258. # enabled: true
  1259. # server_url: "https://cas-server.com"
  1260. # service_url: "https://homeserver.domain.com:8448"
  1261. # #required_attributes:
  1262. # # name: value
  1263. # The JWT needs to contain a globally unique "sub" (subject) claim.
  1264. #
  1265. #jwt_config:
  1266. # enabled: true
  1267. # secret: "a secret"
  1268. # algorithm: "HS256"
  1269. password_config:
  1270. # Uncomment to disable password login
  1271. #
  1272. #enabled: false
  1273. # Uncomment to disable authentication against the local password
  1274. # database. This is ignored if `enabled` is false, and is only useful
  1275. # if you have other password_providers.
  1276. #
  1277. localdb_enabled: {{ matrix_synapse_password_config_localdb_enabled|to_json }}
  1278. # Uncomment and change to a secret random string for extra security.
  1279. # DO NOT CHANGE THIS AFTER INITIAL SETUP!
  1280. #
  1281. pepper: {{ matrix_synapse_password_config_pepper|string|to_json }}
  1282. {% if matrix_synapse_email_enabled %}
  1283. # Configuration for sending emails from Synapse.
  1284. #
  1285. email:
  1286. # The hostname of the outgoing SMTP server to use. Defaults to 'localhost'.
  1287. #
  1288. #smtp_host: mail.server
  1289. smtp_host: {{ matrix_synapse_email_smtp_host|string|to_json }}
  1290. # The port on the mail server for outgoing SMTP. Defaults to 25.
  1291. #
  1292. #smtp_port: 587
  1293. smtp_port: {{ matrix_synapse_email_smtp_port|to_json }}
  1294. # Username/password for authentication to the SMTP server. By default, no
  1295. # authentication is attempted.
  1296. #
  1297. # smtp_user: "exampleusername"
  1298. # smtp_pass: "examplepassword"
  1299. # Uncomment the following to require TLS transport security for SMTP.
  1300. # By default, Synapse will connect over plain text, and will then switch to
  1301. # TLS via STARTTLS *if the SMTP server supports it*. If this option is set,
  1302. # Synapse will refuse to connect unless the server supports STARTTLS.
  1303. #
  1304. #require_transport_security: true
  1305. require_transport_security: {{ matrix_synapse_email_smtp_require_transport_security|to_json }}
  1306. # Enable sending emails for messages that the user has missed
  1307. #
  1308. #enable_notifs: false
  1309. enable_notifs: true
  1310. # notif_from defines the "From" address to use when sending emails.
  1311. # It must be set if email sending is enabled.
  1312. #
  1313. # The placeholder '%(app)s' will be replaced by the application name,
  1314. # which is normally 'app_name' (below), but may be overridden by the
  1315. # Matrix client application.
  1316. #
  1317. # Note that the placeholder must be written '%(app)s', including the
  1318. # trailing 's'.
  1319. #
  1320. #notif_from: "Your Friendly %(app)s homeserver <noreply@example.com>"
  1321. notif_from: {{ matrix_synapse_email_notif_from|string|to_json }}
  1322. # app_name defines the default value for '%(app)s' in notif_from. It
  1323. # defaults to 'Matrix'.
  1324. #
  1325. #app_name: my_branded_matrix_server
  1326. app_name: Matrix
  1327. # Uncomment the following to disable automatic subscription to email
  1328. # notifications for new users. Enabled by default.
  1329. #
  1330. #notif_for_new_users: false
  1331. notif_for_new_users: True
  1332. # Custom URL for client links within the email notifications. By default
  1333. # links will be based on "https://matrix.to".
  1334. #
  1335. # (This setting used to be called riot_base_url; the old name is still
  1336. # supported for backwards-compatibility but is now deprecated.)
  1337. #
  1338. #client_base_url: "http://localhost/riot"
  1339. client_base_url: {{ matrix_synapse_email_client_base_url|string|to_json }}
  1340. # Configure the time that a validation email will expire after sending.
  1341. # Defaults to 1h.
  1342. #
  1343. #validation_token_lifetime: 15m
  1344. # Directory in which Synapse will try to find the template files below.
  1345. # If not set, default templates from within the Synapse package will be used.
  1346. #
  1347. # DO NOT UNCOMMENT THIS SETTING unless you want to customise the templates.
  1348. # If you *do* uncomment it, you will need to make sure that all the templates
  1349. # below are in the directory.
  1350. #
  1351. # Synapse will look for the following templates in this directory:
  1352. #
  1353. # * The contents of email notifications of missed events: 'notif_mail.html' and
  1354. # 'notif_mail.txt'.
  1355. #
  1356. # * The contents of account expiry notice emails: 'notice_expiry.html' and
  1357. # 'notice_expiry.txt'.
  1358. #
  1359. # * The contents of password reset emails sent by the homeserver:
  1360. # 'password_reset.html' and 'password_reset.txt'
  1361. #
  1362. # * HTML pages for success and failure that a user will see when they follow
  1363. # the link in the password reset email: 'password_reset_success.html' and
  1364. # 'password_reset_failure.html'
  1365. #
  1366. # * The contents of address verification emails sent during registration:
  1367. # 'registration.html' and 'registration.txt'
  1368. #
  1369. # * HTML pages for success and failure that a user will see when they follow
  1370. # the link in an address verification email sent during registration:
  1371. # 'registration_success.html' and 'registration_failure.html'
  1372. #
  1373. # * The contents of address verification emails sent when an address is added
  1374. # to a Matrix account: 'add_threepid.html' and 'add_threepid.txt'
  1375. #
  1376. # * HTML pages for success and failure that a user will see when they follow
  1377. # the link in an address verification email sent when an address is added
  1378. # to a Matrix account: 'add_threepid_success.html' and
  1379. # 'add_threepid_failure.html'
  1380. #
  1381. # You can see the default templates at:
  1382. # https://github.com/matrix-org/synapse/tree/master/synapse/res/templates
  1383. #
  1384. #template_dir: "res/templates"
  1385. {% endif %}
  1386. #password_providers:
  1387. # - module: "ldap_auth_provider.LdapAuthProvider"
  1388. # config:
  1389. # enabled: true
  1390. # uri: "ldap://ldap.example.com:389"
  1391. # start_tls: true
  1392. # base: "ou=users,dc=example,dc=com"
  1393. # attributes:
  1394. # uid: "cn"
  1395. # mail: "email"
  1396. # name: "givenName"
  1397. # #bind_dn:
  1398. # #bind_password:
  1399. # #filter: "(objectClass=posixAccount)"
  1400. {% if matrix_synapse_password_providers_enabled %}
  1401. password_providers:
  1402. {% if matrix_synapse_ext_password_provider_shared_secret_auth_enabled %}
  1403. - module: "shared_secret_authenticator.SharedSecretAuthenticator"
  1404. config:
  1405. sharedSecret: {{ matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret|string|to_json }}
  1406. {% endif %}
  1407. {% if matrix_synapse_ext_password_provider_rest_auth_enabled %}
  1408. - module: "rest_auth_provider.RestAuthProvider"
  1409. config:
  1410. endpoint: {{ matrix_synapse_ext_password_provider_rest_auth_endpoint|string|to_json }}
  1411. policy:
  1412. registration:
  1413. username:
  1414. enforceLowercase: {{ matrix_synapse_ext_password_provider_rest_auth_registration_enforce_lowercase }}
  1415. profile:
  1416. name: {{ matrix_synapse_ext_password_provider_rest_auth_registration_profile_name_autofill }}
  1417. login:
  1418. profile:
  1419. name: {{ matrix_synapse_ext_password_provider_rest_auth_login_profile_name_autofill }}
  1420. {% endif %}
  1421. {% if matrix_synapse_ext_password_provider_ldap_enabled %}
  1422. - module: "ldap_auth_provider.LdapAuthProvider"
  1423. config:
  1424. enabled: true
  1425. uri: {{ matrix_synapse_ext_password_provider_ldap_uri|string|to_json }}
  1426. start_tls: {{ matrix_synapse_ext_password_provider_ldap_start_tls|to_json }}
  1427. base: {{ matrix_synapse_ext_password_provider_ldap_base|string|to_json }}
  1428. attributes:
  1429. uid: {{ matrix_synapse_ext_password_provider_ldap_attributes_uid|string|to_json }}
  1430. mail: {{ matrix_synapse_ext_password_provider_ldap_attributes_mail|string|to_json }}
  1431. name: {{ matrix_synapse_ext_password_provider_ldap_attributes_name|string|to_json }}
  1432. bind_dn: {{ matrix_synapse_ext_password_provider_ldap_bind_dn|string|to_json }}
  1433. bind_password: {{ matrix_synapse_ext_password_provider_ldap_bind_password|string|to_json }}
  1434. filter: {{ matrix_synapse_ext_password_provider_ldap_filter|string|to_json }}
  1435. {% endif %}
  1436. {% endif %}
  1437. # Clients requesting push notifications can either have the body of
  1438. # the message sent in the notification poke along with other details
  1439. # like the sender, or just the event ID and room ID (`event_id_only`).
  1440. # If clients choose the former, this option controls whether the
  1441. # notification request includes the content of the event (other details
  1442. # like the sender are still included). For `event_id_only` push, it
  1443. # has no effect.
  1444. #
  1445. # For modern android devices the notification content will still appear
  1446. # because it is loaded by the app. iPhone, however will send a
  1447. # notification saying only that a message arrived and who it came from.
  1448. #
  1449. push:
  1450. include_content: {{ matrix_synapse_push_include_content|to_json }}
  1451. #spam_checker:
  1452. # module: "my_custom_project.SuperSpamChecker"
  1453. # config:
  1454. # example_option: 'things'
  1455. spam_checker: {{ matrix_synapse_spam_checker|to_json }}
  1456. # Uncomment to allow non-server-admin users to create groups on this server
  1457. #
  1458. enable_group_creation: {{ matrix_synapse_enable_group_creation|to_json }}
  1459. # If enabled, non server admins can only create groups with local parts
  1460. # starting with this prefix
  1461. #
  1462. #group_creation_prefix: "unofficial/"
  1463. # User Directory configuration
  1464. #
  1465. # 'enabled' defines whether users can search the user directory. If
  1466. # false then empty responses are returned to all queries. Defaults to
  1467. # true.
  1468. #
  1469. # 'search_all_users' defines whether to search all users visible to your HS
  1470. # when searching the user directory, rather than limiting to users visible
  1471. # in public rooms. Defaults to false. If you set it True, you'll have to
  1472. # rebuild the user_directory search indexes, see
  1473. # https://github.com/matrix-org/synapse/blob/master/docs/user_directory.md
  1474. #
  1475. #user_directory:
  1476. # enabled: true
  1477. # search_all_users: false
  1478. # User Consent configuration
  1479. #
  1480. # for detailed instructions, see
  1481. # https://github.com/matrix-org/synapse/blob/master/docs/consent_tracking.md
  1482. #
  1483. # Parts of this section are required if enabling the 'consent' resource under
  1484. # 'listeners', in particular 'template_dir' and 'version'.
  1485. #
  1486. # 'template_dir' gives the location of the templates for the HTML forms.
  1487. # This directory should contain one subdirectory per language (eg, 'en', 'fr'),
  1488. # and each language directory should contain the policy document (named as
  1489. # '<version>.html') and a success page (success.html).
  1490. #
  1491. # 'version' specifies the 'current' version of the policy document. It defines
  1492. # the version to be served by the consent resource if there is no 'v'
  1493. # parameter.
  1494. #
  1495. # 'server_notice_content', if enabled, will send a user a "Server Notice"
  1496. # asking them to consent to the privacy policy. The 'server_notices' section
  1497. # must also be configured for this to work. Notices will *not* be sent to
  1498. # guest users unless 'send_server_notice_to_guests' is set to true.
  1499. #
  1500. # 'block_events_error', if set, will block any attempts to send events
  1501. # until the user consents to the privacy policy. The value of the setting is
  1502. # used as the text of the error.
  1503. #
  1504. # 'require_at_registration', if enabled, will add a step to the registration
  1505. # process, similar to how captcha works. Users will be required to accept the
  1506. # policy before their account is created.
  1507. #
  1508. # 'policy_name' is the display name of the policy users will see when registering
  1509. # for an account. Has no effect unless `require_at_registration` is enabled.
  1510. # Defaults to "Privacy Policy".
  1511. #
  1512. #user_consent:
  1513. # template_dir: res/templates/privacy
  1514. # version: 1.0
  1515. # server_notice_content:
  1516. # msgtype: m.text
  1517. # body: >-
  1518. # To continue using this homeserver you must review and agree to the
  1519. # terms and conditions at %(consent_uri)s
  1520. # send_server_notice_to_guests: True
  1521. # block_events_error: >-
  1522. # To continue using this homeserver you must review and agree to the
  1523. # terms and conditions at %(consent_uri)s
  1524. # require_at_registration: False
  1525. # policy_name: Privacy Policy
  1526. #
  1527. # Local statistics collection. Used in populating the room directory.
  1528. #
  1529. # 'bucket_size' controls how large each statistics timeslice is. It can
  1530. # be defined in a human readable short form -- e.g. "1d", "1y".
  1531. #
  1532. # 'retention' controls how long historical statistics will be kept for.
  1533. # It can be defined in a human readable short form -- e.g. "1d", "1y".
  1534. #
  1535. #
  1536. #stats:
  1537. # enabled: true
  1538. # bucket_size: 1d
  1539. # retention: 1y
  1540. # Server Notices room configuration
  1541. #
  1542. # Uncomment this section to enable a room which can be used to send notices
  1543. # from the server to users. It is a special room which cannot be left; notices
  1544. # come from a special "notices" user id.
  1545. #
  1546. # If you uncomment this section, you *must* define the system_mxid_localpart
  1547. # setting, which defines the id of the user which will be used to send the
  1548. # notices.
  1549. #
  1550. # It's also possible to override the room name, the display name of the
  1551. # "notices" user, and the avatar for the user.
  1552. #
  1553. #server_notices:
  1554. # system_mxid_localpart: notices
  1555. # system_mxid_display_name: "Server Notices"
  1556. # system_mxid_avatar_url: "mxc://server.com/oumMVlgDnLYFaPVkExemNVVZ"
  1557. # room_name: "Server Notices"
  1558. # Uncomment to disable searching the public room list. When disabled
  1559. # blocks searching local and remote room lists for local and remote
  1560. # users by always returning an empty list for all queries.
  1561. #
  1562. #enable_room_list_search: false
  1563. enable_room_list_search: {{ matrix_synapse_enable_room_list_search|to_json }}
  1564. # The `alias_creation` option controls who's allowed to create aliases
  1565. # on this server.
  1566. #
  1567. # The format of this option is a list of rules that contain globs that
  1568. # match against user_id, room_id and the new alias (fully qualified with
  1569. # server name). The action in the first rule that matches is taken,
  1570. # which can currently either be "allow" or "deny".
  1571. #
  1572. # Missing user_id/room_id/alias fields default to "*".
  1573. #
  1574. # If no rules match the request is denied. An empty list means no one
  1575. # can create aliases.
  1576. #
  1577. # Options for the rules include:
  1578. #
  1579. # user_id: Matches against the creator of the alias
  1580. # alias: Matches against the alias being created
  1581. # room_id: Matches against the room ID the alias is being pointed at
  1582. # action: Whether to "allow" or "deny" the request if the rule matches
  1583. #
  1584. # The default is:
  1585. #
  1586. #alias_creation_rules:
  1587. # - user_id: "*"
  1588. # alias: "*"
  1589. # room_id: "*"
  1590. # action: allow
  1591. alias_creation_rules: {{ matrix_synapse_alias_creation_rules|to_json }}
  1592. # The `room_list_publication_rules` option controls who can publish and
  1593. # which rooms can be published in the public room list.
  1594. #
  1595. # The format of this option is the same as that for
  1596. # `alias_creation_rules`.
  1597. #
  1598. # If the room has one or more aliases associated with it, only one of
  1599. # the aliases needs to match the alias rule. If there are no aliases
  1600. # then only rules with `alias: *` match.
  1601. #
  1602. # If no rules match the request is denied. An empty list means no one
  1603. # can publish rooms.
  1604. #
  1605. # Options for the rules include:
  1606. #
  1607. # user_id: Matches agaisnt the creator of the alias
  1608. # room_id: Matches against the room ID being published
  1609. # alias: Matches against any current local or canonical aliases
  1610. # associated with the room
  1611. # action: Whether to "allow" or "deny" the request if the rule matches
  1612. #
  1613. # The default is:
  1614. #
  1615. #room_list_publication_rules:
  1616. # - user_id: "*"
  1617. # alias: "*"
  1618. # room_id: "*"
  1619. # action: allow
  1620. room_list_publication_rules: {{ matrix_synapse_room_list_publication_rules|to_json }}
  1621. # Server admins can define a Python module that implements extra rules for
  1622. # allowing or denying incoming events. In order to work, this module needs to
  1623. # override the methods defined in synapse/events/third_party_rules.py.
  1624. #
  1625. # This feature is designed to be used in closed federations only, where each
  1626. # participating server enforces the same rules.
  1627. #
  1628. #third_party_event_rules:
  1629. # module: "my_custom_project.SuperRulesSet"
  1630. # config:
  1631. # example_option: 'things'
  1632. ## Opentracing ##
  1633. # These settings enable opentracing, which implements distributed tracing.
  1634. # This allows you to observe the causal chains of events across servers
  1635. # including requests, key lookups etc., across any server running
  1636. # synapse or any other other services which supports opentracing
  1637. # (specifically those implemented with Jaeger).
  1638. #
  1639. opentracing:
  1640. # tracing is disabled by default. Uncomment the following line to enable it.
  1641. #
  1642. #enabled: true
  1643. # The list of homeservers we wish to send and receive span contexts and span baggage.
  1644. # See docs/opentracing.rst
  1645. # This is a list of regexes which are matched against the server_name of the
  1646. # homeserver.
  1647. #
  1648. # By defult, it is empty, so no servers are matched.
  1649. #
  1650. #homeserver_whitelist:
  1651. # - ".*"
  1652. # Jaeger can be configured to sample traces at different rates.
  1653. # All configuration options provided by Jaeger can be set here.
  1654. # Jaeger's configuration mostly related to trace sampling which
  1655. # is documented here:
  1656. # https://www.jaegertracing.io/docs/1.13/sampling/.
  1657. #
  1658. #jaeger_config:
  1659. # sampler:
  1660. # type: const
  1661. # param: 1
  1662. # Logging whether spans were started and reported
  1663. #
  1664. # logging:
  1665. # false
  1666. # vim:ft=yaml