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.
 
 

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