Matrix Docker Ansible eploy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

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