Matrix Docker Ansible eploy
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 

1820 satır
63 KiB

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