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.
 
 
 
 
 
 

2872 lines
102 KiB

  1. # This file is maintained as an up-to-date snapshot of the default
  2. # homeserver.yaml configuration generated by Synapse.
  3. #
  4. # It is intended to act as a reference for the default configuration,
  5. # helping admins keep track of new options and other changes, and compare
  6. # their configs with the current default. As such, many of the actual
  7. # config values shown are placeholders.
  8. #
  9. # It is *not* intended to be copied and used as the basis for a real
  10. # homeserver.yaml. Instead, if you are starting from scratch, please generate
  11. # a fresh config using Synapse by following the instructions in
  12. # https://matrix-org.github.io/synapse/latest/setup/installation.html.
  13. # Configuration options that take a time period can be set using a number
  14. # followed by a letter. Letters have the following meanings:
  15. # s = second
  16. # m = minute
  17. # h = hour
  18. # d = day
  19. # w = week
  20. # y = year
  21. # For example, setting redaction_retention_period: 5m would remove redacted
  22. # messages from the database after 5 minutes, rather than 5 months.
  23. ################################################################################
  24. # Configuration file for Synapse.
  25. #
  26. # This is a YAML file: see [1] for a quick introduction. Note in particular
  27. # that *indentation is important*: all the elements of a list or dictionary
  28. # should have the same indentation.
  29. #
  30. # [1] https://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.html
  31. ## Modules ##
  32. # Server admins can expand Synapse's functionality with external modules.
  33. #
  34. # See https://matrix-org.github.io/synapse/latest/modules.html for more
  35. # documentation on how to configure or create custom modules for Synapse.
  36. #
  37. modules:
  38. # - module: my_super_module.MySuperClass
  39. # config:
  40. # do_thing: true
  41. # - module: my_other_super_module.SomeClass
  42. # config: {}
  43. ## Server ##
  44. # The public-facing domain of the server
  45. #
  46. # The server_name name will appear at the end of usernames and room addresses
  47. # created on this server. For example if the server_name was example.com,
  48. # usernames on this server would be in the format @user:example.com
  49. #
  50. # In most cases you should avoid using a matrix specific subdomain such as
  51. # matrix.example.com or synapse.example.com as the server_name for the same
  52. # reasons you wouldn't use user@email.example.com as your email address.
  53. # See https://matrix-org.github.io/synapse/latest/delegate.html
  54. # for information on how to host Synapse on a subdomain while preserving
  55. # a clean server_name.
  56. #
  57. # The server_name cannot be changed later so it is important to
  58. # configure this correctly before you start Synapse. It should be all
  59. # lowercase and may contain an explicit port.
  60. # Examples: matrix.org, localhost:8080
  61. #
  62. server_name: "SERVERNAME"
  63. # When running as a daemon, the file to store the pid in
  64. #
  65. pid_file: DATADIR/homeserver.pid
  66. # The absolute URL to the web client which /_matrix/client will redirect
  67. # to if 'webclient' is configured under the 'listeners' configuration.
  68. #
  69. # This option can be also set to the filesystem path to the web client
  70. # which will be served at /_matrix/client/ if 'webclient' is configured
  71. # under the 'listeners' configuration, however this is a security risk:
  72. # https://github.com/matrix-org/synapse#security-note
  73. #
  74. #web_client_location: https://riot.example.com/
  75. # The public-facing base URL that clients use to access this Homeserver (not
  76. # including _matrix/...). This is the same URL a user might enter into the
  77. # 'Custom Homeserver URL' field on their client. If you use Synapse with a
  78. # reverse proxy, this should be the URL to reach Synapse via the proxy.
  79. # Otherwise, it should be the URL to reach Synapse's client HTTP listener (see
  80. # 'listeners' below).
  81. #
  82. #public_baseurl: https://example.com/
  83. # Set the soft limit on the number of file descriptors synapse can use
  84. # Zero is used to indicate synapse should set the soft limit to the
  85. # hard limit.
  86. #
  87. #soft_file_limit: 0
  88. # Presence tracking allows users to see the state (e.g online/offline)
  89. # of other local and remote users.
  90. #
  91. presence:
  92. # Uncomment to disable presence tracking on this homeserver. This option
  93. # replaces the previous top-level 'use_presence' option.
  94. #
  95. #enabled: false
  96. # Presence routers are third-party modules that can specify additional logic
  97. # to where presence updates from users are routed.
  98. #
  99. presence_router:
  100. # The custom module's class. Uncomment to use a custom presence router module.
  101. #
  102. #module: "my_custom_router.PresenceRouter"
  103. # Configuration options of the custom module. Refer to your module's
  104. # documentation for available options.
  105. #
  106. #config:
  107. # example_option: 'something'
  108. # Whether to require authentication to retrieve profile data (avatars,
  109. # display names) of other users through the client API. Defaults to
  110. # 'false'. Note that profile data is also available via the federation
  111. # API, unless allow_profile_lookup_over_federation is set to false.
  112. #
  113. #require_auth_for_profile_requests: true
  114. # Uncomment to require a user to share a room with another user in order
  115. # to retrieve their profile information. Only checked on Client-Server
  116. # requests. Profile requests from other servers should be checked by the
  117. # requesting server. Defaults to 'false'.
  118. #
  119. #limit_profile_requests_to_users_who_share_rooms: true
  120. # Uncomment to prevent a user's profile data from being retrieved and
  121. # displayed in a room until they have joined it. By default, a user's
  122. # profile data is included in an invite event, regardless of the values
  123. # of the above two settings, and whether or not the users share a server.
  124. # Defaults to 'true'.
  125. #
  126. #include_profile_data_on_invite: false
  127. # If set to 'true', removes the need for authentication to access the server's
  128. # public rooms directory through the client API, meaning that anyone can
  129. # query the room directory. Defaults to 'false'.
  130. #
  131. #allow_public_rooms_without_auth: true
  132. # If set to 'true', allows any other homeserver to fetch the server's public
  133. # rooms directory via federation. Defaults to 'false'.
  134. #
  135. #allow_public_rooms_over_federation: true
  136. # The default room version for newly created rooms.
  137. #
  138. # Known room versions are listed here:
  139. # https://matrix.org/docs/spec/#complete-list-of-room-versions
  140. #
  141. # For example, for room version 1, default_room_version should be set
  142. # to "1".
  143. #
  144. #default_room_version: "6"
  145. # The GC threshold parameters to pass to `gc.set_threshold`, if defined
  146. #
  147. #gc_thresholds: [700, 10, 10]
  148. # The minimum time in seconds between each GC for a generation, regardless of
  149. # the GC thresholds. This ensures that we don't do GC too frequently.
  150. #
  151. # A value of `[1s, 10s, 30s]` indicates that a second must pass between consecutive
  152. # generation 0 GCs, etc.
  153. #
  154. # Defaults to `[1s, 10s, 30s]`.
  155. #
  156. #gc_min_interval: [0.5s, 30s, 1m]
  157. # Set the limit on the returned events in the timeline in the get
  158. # and sync operations. The default value is 100. -1 means no upper limit.
  159. #
  160. # Uncomment the following to increase the limit to 5000.
  161. #
  162. #filter_timeline_limit: 5000
  163. # Whether room invites to users on this server should be blocked
  164. # (except those sent by local server admins). The default is False.
  165. #
  166. #block_non_admin_invites: true
  167. # Room searching
  168. #
  169. # If disabled, new messages will not be indexed for searching and users
  170. # will receive errors when searching for messages. Defaults to enabled.
  171. #
  172. #enable_search: false
  173. # Prevent outgoing requests from being sent to the following blacklisted IP address
  174. # CIDR ranges. If this option is not specified then it defaults to private IP
  175. # address ranges (see the example below).
  176. #
  177. # The blacklist applies to the outbound requests for federation, identity servers,
  178. # push servers, and for checking key validity for third-party invite events.
  179. #
  180. # (0.0.0.0 and :: are always blacklisted, whether or not they are explicitly
  181. # listed here, since they correspond to unroutable addresses.)
  182. #
  183. # This option replaces federation_ip_range_blacklist in Synapse v1.25.0.
  184. #
  185. #ip_range_blacklist:
  186. # - '127.0.0.0/8'
  187. # - '10.0.0.0/8'
  188. # - '172.16.0.0/12'
  189. # - '192.168.0.0/16'
  190. # - '100.64.0.0/10'
  191. # - '192.0.0.0/24'
  192. # - '169.254.0.0/16'
  193. # - '192.88.99.0/24'
  194. # - '198.18.0.0/15'
  195. # - '192.0.2.0/24'
  196. # - '198.51.100.0/24'
  197. # - '203.0.113.0/24'
  198. # - '224.0.0.0/4'
  199. # - '::1/128'
  200. # - 'fe80::/10'
  201. # - 'fc00::/7'
  202. # - '2001:db8::/32'
  203. # - 'ff00::/8'
  204. # - 'fec0::/10'
  205. # List of IP address CIDR ranges that should be allowed for federation,
  206. # identity servers, push servers, and for checking key validity for
  207. # third-party invite events. This is useful for specifying exceptions to
  208. # wide-ranging blacklisted target IP ranges - e.g. for communication with
  209. # a push server only visible in your network.
  210. #
  211. # This whitelist overrides ip_range_blacklist and defaults to an empty
  212. # list.
  213. #
  214. #ip_range_whitelist:
  215. # - '192.168.1.1'
  216. # List of ports that Synapse should listen on, their purpose and their
  217. # configuration.
  218. #
  219. # Options for each listener include:
  220. #
  221. # port: the TCP port to bind to
  222. #
  223. # bind_addresses: a list of local addresses to listen on. The default is
  224. # 'all local interfaces'.
  225. #
  226. # type: the type of listener. Normally 'http', but other valid options are:
  227. # 'manhole' (see https://matrix-org.github.io/synapse/latest/manhole.html),
  228. # 'metrics' (see https://matrix-org.github.io/synapse/latest/metrics-howto.html),
  229. # 'replication' (see https://matrix-org.github.io/synapse/latest/workers.html).
  230. #
  231. # tls: set to true to enable TLS for this listener. Will use the TLS
  232. # key/cert specified in tls_private_key_path / tls_certificate_path.
  233. #
  234. # x_forwarded: Only valid for an 'http' listener. Set to true to use the
  235. # X-Forwarded-For header as the client IP. Useful when Synapse is
  236. # behind a reverse-proxy.
  237. #
  238. # resources: Only valid for an 'http' listener. A list of resources to host
  239. # on this port. Options for each resource are:
  240. #
  241. # names: a list of names of HTTP resources. See below for a list of
  242. # valid resource names.
  243. #
  244. # compress: set to true to enable HTTP compression for this resource.
  245. #
  246. # additional_resources: Only valid for an 'http' listener. A map of
  247. # additional endpoints which should be loaded via dynamic modules.
  248. #
  249. # Valid resource names are:
  250. #
  251. # client: the client-server API (/_matrix/client), and the synapse admin
  252. # API (/_synapse/admin). Also implies 'media' and 'static'.
  253. #
  254. # consent: user consent forms (/_matrix/consent).
  255. # See https://matrix-org.github.io/synapse/latest/consent_tracking.html.
  256. #
  257. # federation: the server-server API (/_matrix/federation). Also implies
  258. # 'media', 'keys', 'openid'
  259. #
  260. # keys: the key discovery API (/_matrix/keys).
  261. #
  262. # media: the media API (/_matrix/media).
  263. #
  264. # metrics: the metrics interface.
  265. # See https://matrix-org.github.io/synapse/latest/metrics-howto.html.
  266. #
  267. # openid: OpenID authentication.
  268. #
  269. # replication: the HTTP replication API (/_synapse/replication).
  270. # See https://matrix-org.github.io/synapse/latest/workers.html.
  271. #
  272. # static: static resources under synapse/static (/_matrix/static). (Mostly
  273. # useful for 'fallback authentication'.)
  274. #
  275. # webclient: A web client. Requires web_client_location to be set.
  276. #
  277. listeners:
  278. # TLS-enabled listener: for when matrix traffic is sent directly to synapse.
  279. #
  280. # Disabled by default. To enable it, uncomment the following. (Note that you
  281. # will also need to give Synapse a TLS key and certificate: see the TLS section
  282. # below.)
  283. #
  284. #- port: 8448
  285. # type: http
  286. # tls: true
  287. # resources:
  288. # - names: [client, federation]
  289. # Unsecure HTTP listener: for when matrix traffic passes through a reverse proxy
  290. # that unwraps TLS.
  291. #
  292. # If you plan to use a reverse proxy, please see
  293. # https://matrix-org.github.io/synapse/latest/reverse_proxy.html.
  294. #
  295. - port: 8008
  296. tls: false
  297. type: http
  298. x_forwarded: true
  299. bind_addresses: ['::1', '127.0.0.1']
  300. resources:
  301. - names: [client, federation]
  302. compress: false
  303. # example additional_resources:
  304. #
  305. #additional_resources:
  306. # "/_matrix/my/custom/endpoint":
  307. # module: my_module.CustomRequestHandler
  308. # config: {}
  309. # Turn on the twisted ssh manhole service on localhost on the given
  310. # port.
  311. #
  312. #- port: 9000
  313. # bind_addresses: ['::1', '127.0.0.1']
  314. # type: manhole
  315. # Forward extremities can build up in a room due to networking delays between
  316. # homeservers. Once this happens in a large room, calculation of the state of
  317. # that room can become quite expensive. To mitigate this, once the number of
  318. # forward extremities reaches a given threshold, Synapse will send an
  319. # org.matrix.dummy_event event, which will reduce the forward extremities
  320. # in the room.
  321. #
  322. # This setting defines the threshold (i.e. number of forward extremities in the
  323. # room) at which dummy events are sent. The default value is 10.
  324. #
  325. #dummy_events_threshold: 5
  326. ## Homeserver blocking ##
  327. # How to reach the server admin, used in ResourceLimitError
  328. #
  329. #admin_contact: 'mailto:admin@server.com'
  330. # Global blocking
  331. #
  332. #hs_disabled: false
  333. #hs_disabled_message: 'Human readable reason for why the HS is blocked'
  334. # Monthly Active User Blocking
  335. #
  336. # Used in cases where the admin or server owner wants to limit to the
  337. # number of monthly active users.
  338. #
  339. # 'limit_usage_by_mau' disables/enables monthly active user blocking. When
  340. # enabled and a limit is reached the server returns a 'ResourceLimitError'
  341. # with error type Codes.RESOURCE_LIMIT_EXCEEDED
  342. #
  343. # 'max_mau_value' is the hard limit of monthly active users above which
  344. # the server will start blocking user actions.
  345. #
  346. # 'mau_trial_days' is a means to add a grace period for active users. It
  347. # means that users must be active for this number of days before they
  348. # can be considered active and guards against the case where lots of users
  349. # sign up in a short space of time never to return after their initial
  350. # session.
  351. #
  352. # 'mau_limit_alerting' is a means of limiting client side alerting
  353. # should the mau limit be reached. This is useful for small instances
  354. # where the admin has 5 mau seats (say) for 5 specific people and no
  355. # interest increasing the mau limit further. Defaults to True, which
  356. # means that alerting is enabled
  357. #
  358. #limit_usage_by_mau: false
  359. #max_mau_value: 50
  360. #mau_trial_days: 2
  361. #mau_limit_alerting: false
  362. # If enabled, the metrics for the number of monthly active users will
  363. # be populated, however no one will be limited. If limit_usage_by_mau
  364. # is true, this is implied to be true.
  365. #
  366. #mau_stats_only: false
  367. # Sometimes the server admin will want to ensure certain accounts are
  368. # never blocked by mau checking. These accounts are specified here.
  369. #
  370. #mau_limit_reserved_threepids:
  371. # - medium: 'email'
  372. # address: 'reserved_user@example.com'
  373. # Used by phonehome stats to group together related servers.
  374. #server_context: context
  375. # Resource-constrained homeserver settings
  376. #
  377. # When this is enabled, the room "complexity" will be checked before a user
  378. # joins a new remote room. If it is above the complexity limit, the server will
  379. # disallow joining, or will instantly leave.
  380. #
  381. # Room complexity is an arbitrary measure based on factors such as the number of
  382. # users in the room.
  383. #
  384. limit_remote_rooms:
  385. # Uncomment to enable room complexity checking.
  386. #
  387. #enabled: true
  388. # the limit above which rooms cannot be joined. The default is 1.0.
  389. #
  390. #complexity: 0.5
  391. # override the error which is returned when the room is too complex.
  392. #
  393. #complexity_error: "This room is too complex."
  394. # allow server admins to join complex rooms. Default is false.
  395. #
  396. #admins_can_join: true
  397. # Whether to require a user to be in the room to add an alias to it.
  398. # Defaults to 'true'.
  399. #
  400. #require_membership_for_aliases: false
  401. # Whether to allow per-room membership profiles through the send of membership
  402. # events with profile information that differ from the target's global profile.
  403. # Defaults to 'true'.
  404. #
  405. #allow_per_room_profiles: false
  406. # How long to keep redacted events in unredacted form in the database. After
  407. # this period redacted events get replaced with their redacted form in the DB.
  408. #
  409. # Defaults to `7d`. Set to `null` to disable.
  410. #
  411. #redaction_retention_period: 28d
  412. # How long to track users' last seen time and IPs in the database.
  413. #
  414. # Defaults to `28d`. Set to `null` to disable clearing out of old rows.
  415. #
  416. #user_ips_max_age: 14d
  417. # Message retention policy at the server level.
  418. #
  419. # Room admins and mods can define a retention period for their rooms using the
  420. # 'm.room.retention' state event, and server admins can cap this period by setting
  421. # the 'allowed_lifetime_min' and 'allowed_lifetime_max' config options.
  422. #
  423. # If this feature is enabled, Synapse will regularly look for and purge events
  424. # which are older than the room's maximum retention period. Synapse will also
  425. # filter events received over federation so that events that should have been
  426. # purged are ignored and not stored again.
  427. #
  428. retention:
  429. # The message retention policies feature is disabled by default. Uncomment the
  430. # following line to enable it.
  431. #
  432. #enabled: true
  433. # Default retention policy. If set, Synapse will apply it to rooms that lack the
  434. # 'm.room.retention' state event. Currently, the value of 'min_lifetime' doesn't
  435. # matter much because Synapse doesn't take it into account yet.
  436. #
  437. #default_policy:
  438. # min_lifetime: 1d
  439. # max_lifetime: 1y
  440. # Retention policy limits. If set, and the state of a room contains a
  441. # 'm.room.retention' event in its state which contains a 'min_lifetime' or a
  442. # 'max_lifetime' that's out of these bounds, Synapse will cap the room's policy
  443. # to these limits when running purge jobs.
  444. #
  445. #allowed_lifetime_min: 1d
  446. #allowed_lifetime_max: 1y
  447. # Server admins can define the settings of the background jobs purging the
  448. # events which lifetime has expired under the 'purge_jobs' section.
  449. #
  450. # If no configuration is provided, a single job will be set up to delete expired
  451. # events in every room daily.
  452. #
  453. # Each job's configuration defines which range of message lifetimes the job
  454. # takes care of. For example, if 'shortest_max_lifetime' is '2d' and
  455. # 'longest_max_lifetime' is '3d', the job will handle purging expired events in
  456. # rooms whose state defines a 'max_lifetime' that's both higher than 2 days, and
  457. # lower than or equal to 3 days. Both the minimum and the maximum value of a
  458. # range are optional, e.g. a job with no 'shortest_max_lifetime' and a
  459. # 'longest_max_lifetime' of '3d' will handle every room with a retention policy
  460. # which 'max_lifetime' is lower than or equal to three days.
  461. #
  462. # The rationale for this per-job configuration is that some rooms might have a
  463. # retention policy with a low 'max_lifetime', where history needs to be purged
  464. # of outdated messages on a more frequent basis than for the rest of the rooms
  465. # (e.g. every 12h), but not want that purge to be performed by a job that's
  466. # iterating over every room it knows, which could be heavy on the server.
  467. #
  468. # If any purge job is configured, it is strongly recommended to have at least
  469. # a single job with neither 'shortest_max_lifetime' nor 'longest_max_lifetime'
  470. # set, or one job without 'shortest_max_lifetime' and one job without
  471. # 'longest_max_lifetime' set. Otherwise some rooms might be ignored, even if
  472. # 'allowed_lifetime_min' and 'allowed_lifetime_max' are set, because capping a
  473. # room's policy to these values is done after the policies are retrieved from
  474. # Synapse's database (which is done using the range specified in a purge job's
  475. # configuration).
  476. #
  477. #purge_jobs:
  478. # - longest_max_lifetime: 3d
  479. # interval: 12h
  480. # - shortest_max_lifetime: 3d
  481. # interval: 1d
  482. # Inhibits the /requestToken endpoints from returning an error that might leak
  483. # information about whether an e-mail address is in use or not on this
  484. # homeserver.
  485. # Note that for some endpoints the error situation is the e-mail already being
  486. # used, and for others the error is entering the e-mail being unused.
  487. # If this option is enabled, instead of returning an error, these endpoints will
  488. # act as if no error happened and return a fake session ID ('sid') to clients.
  489. #
  490. #request_token_inhibit_3pid_errors: true
  491. # A list of domains that the domain portion of 'next_link' parameters
  492. # must match.
  493. #
  494. # This parameter is optionally provided by clients while requesting
  495. # validation of an email or phone number, and maps to a link that
  496. # users will be automatically redirected to after validation
  497. # succeeds. Clients can make use this parameter to aid the validation
  498. # process.
  499. #
  500. # The whitelist is applied whether the homeserver or an
  501. # identity server is handling validation.
  502. #
  503. # The default value is no whitelist functionality; all domains are
  504. # allowed. Setting this value to an empty list will instead disallow
  505. # all domains.
  506. #
  507. #next_link_domain_whitelist: ["matrix.org"]
  508. ## TLS ##
  509. # PEM-encoded X509 certificate for TLS.
  510. # This certificate, as of Synapse 1.0, will need to be a valid and verifiable
  511. # certificate, signed by a recognised Certificate Authority.
  512. #
  513. # Be sure to use a `.pem` file that includes the full certificate chain including
  514. # any intermediate certificates (for instance, if using certbot, use
  515. # `fullchain.pem` as your certificate, not `cert.pem`).
  516. #
  517. #tls_certificate_path: "CONFDIR/SERVERNAME.tls.crt"
  518. # PEM-encoded private key for TLS
  519. #
  520. #tls_private_key_path: "CONFDIR/SERVERNAME.tls.key"
  521. # Whether to verify TLS server certificates for outbound federation requests.
  522. #
  523. # Defaults to `true`. To disable certificate verification, uncomment the
  524. # following line.
  525. #
  526. #federation_verify_certificates: false
  527. # The minimum TLS version that will be used for outbound federation requests.
  528. #
  529. # Defaults to `1`. Configurable to `1`, `1.1`, `1.2`, or `1.3`. Note
  530. # that setting this value higher than `1.2` will prevent federation to most
  531. # of the public Matrix network: only configure it to `1.3` if you have an
  532. # entirely private federation setup and you can ensure TLS 1.3 support.
  533. #
  534. #federation_client_minimum_tls_version: 1.2
  535. # Skip federation certificate verification on the following whitelist
  536. # of domains.
  537. #
  538. # This setting should only be used in very specific cases, such as
  539. # federation over Tor hidden services and similar. For private networks
  540. # of homeservers, you likely want to use a private CA instead.
  541. #
  542. # Only effective if federation_verify_certicates is `true`.
  543. #
  544. #federation_certificate_verification_whitelist:
  545. # - lon.example.com
  546. # - *.domain.com
  547. # - *.onion
  548. # List of custom certificate authorities for federation traffic.
  549. #
  550. # This setting should only normally be used within a private network of
  551. # homeservers.
  552. #
  553. # Note that this list will replace those that are provided by your
  554. # operating environment. Certificates must be in PEM format.
  555. #
  556. #federation_custom_ca_list:
  557. # - myCA1.pem
  558. # - myCA2.pem
  559. # - myCA3.pem
  560. ## Federation ##
  561. # Restrict federation to the following whitelist of domains.
  562. # N.B. we recommend also firewalling your federation listener to limit
  563. # inbound federation traffic as early as possible, rather than relying
  564. # purely on this application-layer restriction. If not specified, the
  565. # default is to whitelist everything.
  566. #
  567. #federation_domain_whitelist:
  568. # - lon.example.com
  569. # - nyc.example.com
  570. # - syd.example.com
  571. # Report prometheus metrics on the age of PDUs being sent to and received from
  572. # the following domains. This can be used to give an idea of "delay" on inbound
  573. # and outbound federation, though be aware that any delay can be due to problems
  574. # at either end or with the intermediate network.
  575. #
  576. # By default, no domains are monitored in this way.
  577. #
  578. #federation_metrics_domains:
  579. # - matrix.org
  580. # - example.com
  581. # Uncomment to disable profile lookup over federation. By default, the
  582. # Federation API allows other homeservers to obtain profile data of any user
  583. # on this homeserver. Defaults to 'true'.
  584. #
  585. #allow_profile_lookup_over_federation: false
  586. # Uncomment to disable device display name lookup over federation. By default, the
  587. # Federation API allows other homeservers to obtain device display names of any user
  588. # on this homeserver. Defaults to 'true'.
  589. #
  590. #allow_device_name_lookup_over_federation: false
  591. ## Caching ##
  592. # Caching can be configured through the following options.
  593. #
  594. # A cache 'factor' is a multiplier that can be applied to each of
  595. # Synapse's caches in order to increase or decrease the maximum
  596. # number of entries that can be stored.
  597. # The number of events to cache in memory. Not affected by
  598. # caches.global_factor.
  599. #
  600. #event_cache_size: 10K
  601. caches:
  602. # Controls the global cache factor, which is the default cache factor
  603. # for all caches if a specific factor for that cache is not otherwise
  604. # set.
  605. #
  606. # This can also be set by the "SYNAPSE_CACHE_FACTOR" environment
  607. # variable. Setting by environment variable takes priority over
  608. # setting through the config file.
  609. #
  610. # Defaults to 0.5, which will half the size of all caches.
  611. #
  612. #global_factor: 1.0
  613. # A dictionary of cache name to cache factor for that individual
  614. # cache. Overrides the global cache factor for a given cache.
  615. #
  616. # These can also be set through environment variables comprised
  617. # of "SYNAPSE_CACHE_FACTOR_" + the name of the cache in capital
  618. # letters and underscores. Setting by environment variable
  619. # takes priority over setting through the config file.
  620. # Ex. SYNAPSE_CACHE_FACTOR_GET_USERS_WHO_SHARE_ROOM_WITH_USER=2.0
  621. #
  622. # Some caches have '*' and other characters that are not
  623. # alphanumeric or underscores. These caches can be named with or
  624. # without the special characters stripped. For example, to specify
  625. # the cache factor for `*stateGroupCache*` via an environment
  626. # variable would be `SYNAPSE_CACHE_FACTOR_STATEGROUPCACHE=2.0`.
  627. #
  628. per_cache_factors:
  629. #get_users_who_share_room_with_user: 2.0
  630. # Controls how long an entry can be in a cache without having been
  631. # accessed before being evicted. Defaults to None, which means
  632. # entries are never evicted based on time.
  633. #
  634. #expiry_time: 30m
  635. ## Database ##
  636. # The 'database' setting defines the database that synapse uses to store all of
  637. # its data.
  638. #
  639. # 'name' gives the database engine to use: either 'sqlite3' (for SQLite) or
  640. # 'psycopg2' (for PostgreSQL).
  641. #
  642. # 'args' gives options which are passed through to the database engine,
  643. # except for options starting 'cp_', which are used to configure the Twisted
  644. # connection pool. For a reference to valid arguments, see:
  645. # * for sqlite: https://docs.python.org/3/library/sqlite3.html#sqlite3.connect
  646. # * for postgres: https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS
  647. # * for the connection pool: https://twistedmatrix.com/documents/current/api/twisted.enterprise.adbapi.ConnectionPool.html#__init__
  648. #
  649. #
  650. # Example SQLite configuration:
  651. #
  652. #database:
  653. # name: sqlite3
  654. # args:
  655. # database: /path/to/homeserver.db
  656. #
  657. #
  658. # Example Postgres configuration:
  659. #
  660. #database:
  661. # name: psycopg2
  662. # args:
  663. # user: synapse_user
  664. # password: secretpassword
  665. # database: synapse
  666. # host: localhost
  667. # port: 5432
  668. # cp_min: 5
  669. # cp_max: 10
  670. #
  671. # For more information on using Synapse with Postgres,
  672. # see https://matrix-org.github.io/synapse/latest/postgres.html.
  673. #
  674. database:
  675. name: sqlite3
  676. args:
  677. database: DATADIR/homeserver.db
  678. ## Logging ##
  679. # A yaml python logging config file as described by
  680. # https://docs.python.org/3.7/library/logging.config.html#configuration-dictionary-schema
  681. #
  682. log_config: "CONFDIR/SERVERNAME.log.config"
  683. ## Ratelimiting ##
  684. # Ratelimiting settings for client actions (registration, login, messaging).
  685. #
  686. # Each ratelimiting configuration is made of two parameters:
  687. # - per_second: number of requests a client can send per second.
  688. # - burst_count: number of requests a client can send before being throttled.
  689. #
  690. # Synapse currently uses the following configurations:
  691. # - one for messages that ratelimits sending based on the account the client
  692. # is using
  693. # - one for registration that ratelimits registration requests based on the
  694. # client's IP address.
  695. # - one for login that ratelimits login requests based on the client's IP
  696. # address.
  697. # - one for login that ratelimits login requests based on the account the
  698. # client is attempting to log into.
  699. # - one for login that ratelimits login requests based on the account the
  700. # client is attempting to log into, based on the amount of failed login
  701. # attempts for this account.
  702. # - one for ratelimiting redactions by room admins. If this is not explicitly
  703. # set then it uses the same ratelimiting as per rc_message. This is useful
  704. # to allow room admins to deal with abuse quickly.
  705. # - two for ratelimiting number of rooms a user can join, "local" for when
  706. # users are joining rooms the server is already in (this is cheap) vs
  707. # "remote" for when users are trying to join rooms not on the server (which
  708. # can be more expensive)
  709. # - one for ratelimiting how often a user or IP can attempt to validate a 3PID.
  710. # - two for ratelimiting how often invites can be sent in a room or to a
  711. # specific user.
  712. #
  713. # The defaults are as shown below.
  714. #
  715. #rc_message:
  716. # per_second: 0.2
  717. # burst_count: 10
  718. #
  719. #rc_registration:
  720. # per_second: 0.17
  721. # burst_count: 3
  722. #
  723. #rc_login:
  724. # address:
  725. # per_second: 0.17
  726. # burst_count: 3
  727. # account:
  728. # per_second: 0.17
  729. # burst_count: 3
  730. # failed_attempts:
  731. # per_second: 0.17
  732. # burst_count: 3
  733. #
  734. #rc_admin_redaction:
  735. # per_second: 1
  736. # burst_count: 50
  737. #
  738. #rc_joins:
  739. # local:
  740. # per_second: 0.1
  741. # burst_count: 10
  742. # remote:
  743. # per_second: 0.01
  744. # burst_count: 10
  745. #
  746. #rc_3pid_validation:
  747. # per_second: 0.003
  748. # burst_count: 5
  749. #
  750. #rc_invites:
  751. # per_room:
  752. # per_second: 0.3
  753. # burst_count: 10
  754. # per_user:
  755. # per_second: 0.003
  756. # burst_count: 5
  757. # Ratelimiting settings for incoming federation
  758. #
  759. # The rc_federation configuration is made up of the following settings:
  760. # - window_size: window size in milliseconds
  761. # - sleep_limit: number of federation requests from a single server in
  762. # a window before the server will delay processing the request.
  763. # - sleep_delay: duration in milliseconds to delay processing events
  764. # from remote servers by if they go over the sleep limit.
  765. # - reject_limit: maximum number of concurrent federation requests
  766. # allowed from a single server
  767. # - concurrent: number of federation requests to concurrently process
  768. # from a single server
  769. #
  770. # The defaults are as shown below.
  771. #
  772. #rc_federation:
  773. # window_size: 1000
  774. # sleep_limit: 10
  775. # sleep_delay: 500
  776. # reject_limit: 50
  777. # concurrent: 3
  778. # Target outgoing federation transaction frequency for sending read-receipts,
  779. # per-room.
  780. #
  781. # If we end up trying to send out more read-receipts, they will get buffered up
  782. # into fewer transactions.
  783. #
  784. #federation_rr_transactions_per_room_per_second: 50
  785. ## Media Store ##
  786. # Enable the media store service in the Synapse master. Uncomment the
  787. # following if you are using a separate media store worker.
  788. #
  789. #enable_media_repo: false
  790. # Directory where uploaded images and attachments are stored.
  791. #
  792. media_store_path: "DATADIR/media_store"
  793. # Media storage providers allow media to be stored in different
  794. # locations.
  795. #
  796. #media_storage_providers:
  797. # - module: file_system
  798. # # Whether to store newly uploaded local files
  799. # store_local: false
  800. # # Whether to store newly downloaded remote files
  801. # store_remote: false
  802. # # Whether to wait for successful storage for local uploads
  803. # store_synchronous: false
  804. # config:
  805. # directory: /mnt/some/other/directory
  806. # The largest allowed upload size in bytes
  807. #
  808. # If you are using a reverse proxy you may also need to set this value in
  809. # your reverse proxy's config. Notably Nginx has a small max body size by default.
  810. # See https://matrix-org.github.io/synapse/latest/reverse_proxy.html.
  811. #
  812. #max_upload_size: 50M
  813. # Maximum number of pixels that will be thumbnailed
  814. #
  815. #max_image_pixels: 32M
  816. # Whether to generate new thumbnails on the fly to precisely match
  817. # the resolution requested by the client. If true then whenever
  818. # a new resolution is requested by the client the server will
  819. # generate a new thumbnail. If false the server will pick a thumbnail
  820. # from a precalculated list.
  821. #
  822. #dynamic_thumbnails: false
  823. # List of thumbnails to precalculate when an image is uploaded.
  824. #
  825. #thumbnail_sizes:
  826. # - width: 32
  827. # height: 32
  828. # method: crop
  829. # - width: 96
  830. # height: 96
  831. # method: crop
  832. # - width: 320
  833. # height: 240
  834. # method: scale
  835. # - width: 640
  836. # height: 480
  837. # method: scale
  838. # - width: 800
  839. # height: 600
  840. # method: scale
  841. # Is the preview URL API enabled?
  842. #
  843. # 'false' by default: uncomment the following to enable it (and specify a
  844. # url_preview_ip_range_blacklist blacklist).
  845. #
  846. #url_preview_enabled: true
  847. # List of IP address CIDR ranges that the URL preview spider is denied
  848. # from accessing. There are no defaults: you must explicitly
  849. # specify a list for URL previewing to work. You should specify any
  850. # internal services in your network that you do not want synapse to try
  851. # to connect to, otherwise anyone in any Matrix room could cause your
  852. # synapse to issue arbitrary GET requests to your internal services,
  853. # causing serious security issues.
  854. #
  855. # (0.0.0.0 and :: are always blacklisted, whether or not they are explicitly
  856. # listed here, since they correspond to unroutable addresses.)
  857. #
  858. # This must be specified if url_preview_enabled is set. It is recommended that
  859. # you uncomment the following list as a starting point.
  860. #
  861. #url_preview_ip_range_blacklist:
  862. # - '127.0.0.0/8'
  863. # - '10.0.0.0/8'
  864. # - '172.16.0.0/12'
  865. # - '192.168.0.0/16'
  866. # - '100.64.0.0/10'
  867. # - '192.0.0.0/24'
  868. # - '169.254.0.0/16'
  869. # - '192.88.99.0/24'
  870. # - '198.18.0.0/15'
  871. # - '192.0.2.0/24'
  872. # - '198.51.100.0/24'
  873. # - '203.0.113.0/24'
  874. # - '224.0.0.0/4'
  875. # - '::1/128'
  876. # - 'fe80::/10'
  877. # - 'fc00::/7'
  878. # - '2001:db8::/32'
  879. # - 'ff00::/8'
  880. # - 'fec0::/10'
  881. # List of IP address CIDR ranges that the URL preview spider is allowed
  882. # to access even if they are specified in url_preview_ip_range_blacklist.
  883. # This is useful for specifying exceptions to wide-ranging blacklisted
  884. # target IP ranges - e.g. for enabling URL previews for a specific private
  885. # website only visible in your network.
  886. #
  887. #url_preview_ip_range_whitelist:
  888. # - '192.168.1.1'
  889. # Optional list of URL matches that the URL preview spider is
  890. # denied from accessing. You should use url_preview_ip_range_blacklist
  891. # in preference to this, otherwise someone could define a public DNS
  892. # entry that points to a private IP address and circumvent the blacklist.
  893. # This is more useful if you know there is an entire shape of URL that
  894. # you know that will never want synapse to try to spider.
  895. #
  896. # Each list entry is a dictionary of url component attributes as returned
  897. # by urlparse.urlsplit as applied to the absolute form of the URL. See
  898. # https://docs.python.org/2/library/urlparse.html#urlparse.urlsplit
  899. # The values of the dictionary are treated as an filename match pattern
  900. # applied to that component of URLs, unless they start with a ^ in which
  901. # case they are treated as a regular expression match. If all the
  902. # specified component matches for a given list item succeed, the URL is
  903. # blacklisted.
  904. #
  905. #url_preview_url_blacklist:
  906. # # blacklist any URL with a username in its URI
  907. # - username: '*'
  908. #
  909. # # blacklist all *.google.com URLs
  910. # - netloc: 'google.com'
  911. # - netloc: '*.google.com'
  912. #
  913. # # blacklist all plain HTTP URLs
  914. # - scheme: 'http'
  915. #
  916. # # blacklist http(s)://www.acme.com/foo
  917. # - netloc: 'www.acme.com'
  918. # path: '/foo'
  919. #
  920. # # blacklist any URL with a literal IPv4 address
  921. # - netloc: '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$'
  922. # The largest allowed URL preview spidering size in bytes
  923. #
  924. #max_spider_size: 10M
  925. # A list of values for the Accept-Language HTTP header used when
  926. # downloading webpages during URL preview generation. This allows
  927. # Synapse to specify the preferred languages that URL previews should
  928. # be in when communicating with remote servers.
  929. #
  930. # Each value is a IETF language tag; a 2-3 letter identifier for a
  931. # language, optionally followed by subtags separated by '-', specifying
  932. # a country or region variant.
  933. #
  934. # Multiple values can be provided, and a weight can be added to each by
  935. # using quality value syntax (;q=). '*' translates to any language.
  936. #
  937. # Defaults to "en".
  938. #
  939. # Example:
  940. #
  941. # url_preview_accept_language:
  942. # - en-UK
  943. # - en-US;q=0.9
  944. # - fr;q=0.8
  945. # - *;q=0.7
  946. #
  947. url_preview_accept_language:
  948. # - en
  949. ## Captcha ##
  950. # See docs/CAPTCHA_SETUP.md for full details of configuring this.
  951. # This homeserver's ReCAPTCHA public key. Must be specified if
  952. # enable_registration_captcha is enabled.
  953. #
  954. #recaptcha_public_key: "YOUR_PUBLIC_KEY"
  955. # This homeserver's ReCAPTCHA private key. Must be specified if
  956. # enable_registration_captcha is enabled.
  957. #
  958. #recaptcha_private_key: "YOUR_PRIVATE_KEY"
  959. # Uncomment to enable ReCaptcha checks when registering, preventing signup
  960. # unless a captcha is answered. Requires a valid ReCaptcha
  961. # public/private key. Defaults to 'false'.
  962. #
  963. #enable_registration_captcha: true
  964. # The API endpoint to use for verifying m.login.recaptcha responses.
  965. # Defaults to "https://www.recaptcha.net/recaptcha/api/siteverify".
  966. #
  967. #recaptcha_siteverify_api: "https://my.recaptcha.site"
  968. ## TURN ##
  969. # The public URIs of the TURN server to give to clients
  970. #
  971. #turn_uris: []
  972. # The shared secret used to compute passwords for the TURN server
  973. #
  974. #turn_shared_secret: "YOUR_SHARED_SECRET"
  975. # The Username and password if the TURN server needs them and
  976. # does not use a token
  977. #
  978. #turn_username: "TURNSERVER_USERNAME"
  979. #turn_password: "TURNSERVER_PASSWORD"
  980. # How long generated TURN credentials last
  981. #
  982. #turn_user_lifetime: 1h
  983. # Whether guests should be allowed to use the TURN server.
  984. # This defaults to True, otherwise VoIP will be unreliable for guests.
  985. # However, it does introduce a slight security risk as it allows users to
  986. # connect to arbitrary endpoints without having first signed up for a
  987. # valid account (e.g. by passing a CAPTCHA).
  988. #
  989. #turn_allow_guests: true
  990. ## Registration ##
  991. #
  992. # Registration can be rate-limited using the parameters in the "Ratelimiting"
  993. # section of this file.
  994. # Enable registration for new users.
  995. #
  996. #enable_registration: false
  997. # Time that a user's session remains valid for, after they log in.
  998. #
  999. # Note that this is not currently compatible with guest logins.
  1000. #
  1001. # Note also that this is calculated at login time: changes are not applied
  1002. # retrospectively to users who have already logged in.
  1003. #
  1004. # By default, this is infinite.
  1005. #
  1006. #session_lifetime: 24h
  1007. # The user must provide all of the below types of 3PID when registering.
  1008. #
  1009. #registrations_require_3pid:
  1010. # - email
  1011. # - msisdn
  1012. # Explicitly disable asking for MSISDNs from the registration
  1013. # flow (overrides registrations_require_3pid if MSISDNs are set as required)
  1014. #
  1015. #disable_msisdn_registration: true
  1016. # Mandate that users are only allowed to associate certain formats of
  1017. # 3PIDs with accounts on this server.
  1018. #
  1019. #allowed_local_3pids:
  1020. # - medium: email
  1021. # pattern: '^[^@]+@matrix\.org$'
  1022. # - medium: email
  1023. # pattern: '^[^@]+@vector\.im$'
  1024. # - medium: msisdn
  1025. # pattern: '\+44'
  1026. # Enable 3PIDs lookup requests to identity servers from this server.
  1027. #
  1028. #enable_3pid_lookup: true
  1029. # If set, allows registration of standard or admin accounts by anyone who
  1030. # has the shared secret, even if registration is otherwise disabled.
  1031. #
  1032. #registration_shared_secret: <PRIVATE STRING>
  1033. # Set the number of bcrypt rounds used to generate password hash.
  1034. # Larger numbers increase the work factor needed to generate the hash.
  1035. # The default number is 12 (which equates to 2^12 rounds).
  1036. # N.B. that increasing this will exponentially increase the time required
  1037. # to register or login - e.g. 24 => 2^24 rounds which will take >20 mins.
  1038. #
  1039. #bcrypt_rounds: 12
  1040. # Allows users to register as guests without a password/email/etc, and
  1041. # participate in rooms hosted on this server which have been made
  1042. # accessible to anonymous users.
  1043. #
  1044. #allow_guest_access: false
  1045. # The identity server which we suggest that clients should use when users log
  1046. # in on this server.
  1047. #
  1048. # (By default, no suggestion is made, so it is left up to the client.
  1049. # This setting is ignored unless public_baseurl is also set.)
  1050. #
  1051. #default_identity_server: https://matrix.org
  1052. # Handle threepid (email/phone etc) registration and password resets through a set of
  1053. # *trusted* identity servers. Note that this allows the configured identity server to
  1054. # reset passwords for accounts!
  1055. #
  1056. # Be aware that if `email` is not set, and SMTP options have not been
  1057. # configured in the email config block, registration and user password resets via
  1058. # email will be globally disabled.
  1059. #
  1060. # Additionally, if `msisdn` is not set, registration and password resets via msisdn
  1061. # will be disabled regardless, and users will not be able to associate an msisdn
  1062. # identifier to their account. This is due to Synapse currently not supporting
  1063. # any method of sending SMS messages on its own.
  1064. #
  1065. # To enable using an identity server for operations regarding a particular third-party
  1066. # identifier type, set the value to the URL of that identity server as shown in the
  1067. # examples below.
  1068. #
  1069. # Servers handling the these requests must answer the `/requestToken` endpoints defined
  1070. # by the Matrix Identity Service API specification:
  1071. # https://matrix.org/docs/spec/identity_service/latest
  1072. #
  1073. # If a delegate is specified, the config option public_baseurl must also be filled out.
  1074. #
  1075. account_threepid_delegates:
  1076. #email: https://example.com # Delegate email sending to example.com
  1077. #msisdn: http://localhost:8090 # Delegate SMS sending to this local process
  1078. # Whether users are allowed to change their displayname after it has
  1079. # been initially set. Useful when provisioning users based on the
  1080. # contents of a third-party directory.
  1081. #
  1082. # Does not apply to server administrators. Defaults to 'true'
  1083. #
  1084. #enable_set_displayname: false
  1085. # Whether users are allowed to change their avatar after it has been
  1086. # initially set. Useful when provisioning users based on the contents
  1087. # of a third-party directory.
  1088. #
  1089. # Does not apply to server administrators. Defaults to 'true'
  1090. #
  1091. #enable_set_avatar_url: false
  1092. # Whether users can change the 3PIDs associated with their accounts
  1093. # (email address and msisdn).
  1094. #
  1095. # Defaults to 'true'
  1096. #
  1097. #enable_3pid_changes: false
  1098. # Users who register on this homeserver will automatically be joined
  1099. # to these rooms.
  1100. #
  1101. # By default, any room aliases included in this list will be created
  1102. # as a publicly joinable room when the first user registers for the
  1103. # homeserver. This behaviour can be customised with the settings below.
  1104. # If the room already exists, make certain it is a publicly joinable
  1105. # room. The join rule of the room must be set to 'public'.
  1106. #
  1107. #auto_join_rooms:
  1108. # - "#example:example.com"
  1109. # Where auto_join_rooms are specified, setting this flag ensures that the
  1110. # the rooms exist by creating them when the first user on the
  1111. # homeserver registers.
  1112. #
  1113. # By default the auto-created rooms are publicly joinable from any federated
  1114. # server. Use the autocreate_auto_join_rooms_federated and
  1115. # autocreate_auto_join_room_preset settings below to customise this behaviour.
  1116. #
  1117. # Setting to false means that if the rooms are not manually created,
  1118. # users cannot be auto-joined since they do not exist.
  1119. #
  1120. # Defaults to true. Uncomment the following line to disable automatically
  1121. # creating auto-join rooms.
  1122. #
  1123. #autocreate_auto_join_rooms: false
  1124. # Whether the auto_join_rooms that are auto-created are available via
  1125. # federation. Only has an effect if autocreate_auto_join_rooms is true.
  1126. #
  1127. # Note that whether a room is federated cannot be modified after
  1128. # creation.
  1129. #
  1130. # Defaults to true: the room will be joinable from other servers.
  1131. # Uncomment the following to prevent users from other homeservers from
  1132. # joining these rooms.
  1133. #
  1134. #autocreate_auto_join_rooms_federated: false
  1135. # The room preset to use when auto-creating one of auto_join_rooms. Only has an
  1136. # effect if autocreate_auto_join_rooms is true.
  1137. #
  1138. # This can be one of "public_chat", "private_chat", or "trusted_private_chat".
  1139. # If a value of "private_chat" or "trusted_private_chat" is used then
  1140. # auto_join_mxid_localpart must also be configured.
  1141. #
  1142. # Defaults to "public_chat", meaning that the room is joinable by anyone, including
  1143. # federated servers if autocreate_auto_join_rooms_federated is true (the default).
  1144. # Uncomment the following to require an invitation to join these rooms.
  1145. #
  1146. #autocreate_auto_join_room_preset: private_chat
  1147. # The local part of the user id which is used to create auto_join_rooms if
  1148. # autocreate_auto_join_rooms is true. If this is not provided then the
  1149. # initial user account that registers will be used to create the rooms.
  1150. #
  1151. # The user id is also used to invite new users to any auto-join rooms which
  1152. # are set to invite-only.
  1153. #
  1154. # It *must* be configured if autocreate_auto_join_room_preset is set to
  1155. # "private_chat" or "trusted_private_chat".
  1156. #
  1157. # Note that this must be specified in order for new users to be correctly
  1158. # invited to any auto-join rooms which have been set to invite-only (either
  1159. # at the time of creation or subsequently).
  1160. #
  1161. # Note that, if the room already exists, this user must be joined and
  1162. # have the appropriate permissions to invite new members.
  1163. #
  1164. #auto_join_mxid_localpart: system
  1165. # When auto_join_rooms is specified, setting this flag to false prevents
  1166. # guest accounts from being automatically joined to the rooms.
  1167. #
  1168. # Defaults to true.
  1169. #
  1170. #auto_join_rooms_for_guests: false
  1171. ## Account Validity ##
  1172. # Optional account validity configuration. This allows for accounts to be denied
  1173. # any request after a given period.
  1174. #
  1175. # Once this feature is enabled, Synapse will look for registered users without an
  1176. # expiration date at startup and will add one to every account it found using the
  1177. # current settings at that time.
  1178. # This means that, if a validity period is set, and Synapse is restarted (it will
  1179. # then derive an expiration date from the current validity period), and some time
  1180. # after that the validity period changes and Synapse is restarted, the users'
  1181. # expiration dates won't be updated unless their account is manually renewed. This
  1182. # date will be randomly selected within a range [now + period - d ; now + period],
  1183. # where d is equal to 10% of the validity period.
  1184. #
  1185. account_validity:
  1186. # The account validity feature is disabled by default. Uncomment the
  1187. # following line to enable it.
  1188. #
  1189. #enabled: true
  1190. # The period after which an account is valid after its registration. When
  1191. # renewing the account, its validity period will be extended by this amount
  1192. # of time. This parameter is required when using the account validity
  1193. # feature.
  1194. #
  1195. #period: 6w
  1196. # The amount of time before an account's expiry date at which Synapse will
  1197. # send an email to the account's email address with a renewal link. By
  1198. # default, no such emails are sent.
  1199. #
  1200. # If you enable this setting, you will also need to fill out the 'email' and
  1201. # 'public_baseurl' configuration sections.
  1202. #
  1203. #renew_at: 1w
  1204. # The subject of the email sent out with the renewal link. '%(app)s' can be
  1205. # used as a placeholder for the 'app_name' parameter from the 'email'
  1206. # section.
  1207. #
  1208. # Note that the placeholder must be written '%(app)s', including the
  1209. # trailing 's'.
  1210. #
  1211. # If this is not set, a default value is used.
  1212. #
  1213. #renew_email_subject: "Renew your %(app)s account"
  1214. # Directory in which Synapse will try to find templates for the HTML files to
  1215. # serve to the user when trying to renew an account. If not set, default
  1216. # templates from within the Synapse package will be used.
  1217. #
  1218. # The currently available templates are:
  1219. #
  1220. # * account_renewed.html: Displayed to the user after they have successfully
  1221. # renewed their account.
  1222. #
  1223. # * account_previously_renewed.html: Displayed to the user if they attempt to
  1224. # renew their account with a token that is valid, but that has already
  1225. # been used. In this case the account is not renewed again.
  1226. #
  1227. # * invalid_token.html: Displayed to the user when they try to renew an account
  1228. # with an unknown or invalid renewal token.
  1229. #
  1230. # See https://github.com/matrix-org/synapse/tree/master/synapse/res/templates for
  1231. # default template contents.
  1232. #
  1233. # The file name of some of these templates can be configured below for legacy
  1234. # reasons.
  1235. #
  1236. #template_dir: "res/templates"
  1237. # A custom file name for the 'account_renewed.html' template.
  1238. #
  1239. # If not set, the file is assumed to be named "account_renewed.html".
  1240. #
  1241. #account_renewed_html_path: "account_renewed.html"
  1242. # A custom file name for the 'invalid_token.html' template.
  1243. #
  1244. # If not set, the file is assumed to be named "invalid_token.html".
  1245. #
  1246. #invalid_token_html_path: "invalid_token.html"
  1247. ## Metrics ###
  1248. # Enable collection and rendering of performance metrics
  1249. #
  1250. #enable_metrics: false
  1251. # Enable sentry integration
  1252. # NOTE: While attempts are made to ensure that the logs don't contain
  1253. # any sensitive information, this cannot be guaranteed. By enabling
  1254. # this option the sentry server may therefore receive sensitive
  1255. # information, and it in turn may then diseminate sensitive information
  1256. # through insecure notification channels if so configured.
  1257. #
  1258. #sentry:
  1259. # dsn: "..."
  1260. # Flags to enable Prometheus metrics which are not suitable to be
  1261. # enabled by default, either for performance reasons or limited use.
  1262. #
  1263. metrics_flags:
  1264. # Publish synapse_federation_known_servers, a gauge of the number of
  1265. # servers this homeserver knows about, including itself. May cause
  1266. # performance problems on large homeservers.
  1267. #
  1268. #known_servers: true
  1269. # Whether or not to report anonymized homeserver usage statistics.
  1270. #
  1271. #report_stats: true|false
  1272. # The endpoint to report the anonymized homeserver usage statistics to.
  1273. # Defaults to https://matrix.org/report-usage-stats/push
  1274. #
  1275. #report_stats_endpoint: https://example.com/report-usage-stats/push
  1276. ## API Configuration ##
  1277. # Controls for the state that is shared with users who receive an invite
  1278. # to a room
  1279. #
  1280. room_prejoin_state:
  1281. # By default, the following state event types are shared with users who
  1282. # receive invites to the room:
  1283. #
  1284. # - m.room.join_rules
  1285. # - m.room.canonical_alias
  1286. # - m.room.avatar
  1287. # - m.room.encryption
  1288. # - m.room.name
  1289. # - m.room.create
  1290. #
  1291. # Uncomment the following to disable these defaults (so that only the event
  1292. # types listed in 'additional_event_types' are shared). Defaults to 'false'.
  1293. #
  1294. #disable_default_event_types: true
  1295. # Additional state event types to share with users when they are invited
  1296. # to a room.
  1297. #
  1298. # By default, this list is empty (so only the default event types are shared).
  1299. #
  1300. #additional_event_types:
  1301. # - org.example.custom.event.type
  1302. # A list of application service config files to use
  1303. #
  1304. #app_service_config_files:
  1305. # - app_service_1.yaml
  1306. # - app_service_2.yaml
  1307. # Uncomment to enable tracking of application service IP addresses. Implicitly
  1308. # enables MAU tracking for application service users.
  1309. #
  1310. #track_appservice_user_ips: true
  1311. # a secret which is used to sign access tokens. If none is specified,
  1312. # the registration_shared_secret is used, if one is given; otherwise,
  1313. # a secret key is derived from the signing key.
  1314. #
  1315. #macaroon_secret_key: <PRIVATE STRING>
  1316. # a secret which is used to calculate HMACs for form values, to stop
  1317. # falsification of values. Must be specified for the User Consent
  1318. # forms to work.
  1319. #
  1320. #form_secret: <PRIVATE STRING>
  1321. ## Signing Keys ##
  1322. # Path to the signing key to sign messages with
  1323. #
  1324. signing_key_path: "CONFDIR/SERVERNAME.signing.key"
  1325. # The keys that the server used to sign messages with but won't use
  1326. # to sign new messages.
  1327. #
  1328. old_signing_keys:
  1329. # For each key, `key` should be the base64-encoded public key, and
  1330. # `expired_ts`should be the time (in milliseconds since the unix epoch) that
  1331. # it was last used.
  1332. #
  1333. # It is possible to build an entry from an old signing.key file using the
  1334. # `export_signing_key` script which is provided with synapse.
  1335. #
  1336. # For example:
  1337. #
  1338. #"ed25519:id": { key: "base64string", expired_ts: 123456789123 }
  1339. # How long key response published by this server is valid for.
  1340. # Used to set the valid_until_ts in /key/v2 APIs.
  1341. # Determines how quickly servers will query to check which keys
  1342. # are still valid.
  1343. #
  1344. #key_refresh_interval: 1d
  1345. # The trusted servers to download signing keys from.
  1346. #
  1347. # When we need to fetch a signing key, each server is tried in parallel.
  1348. #
  1349. # Normally, the connection to the key server is validated via TLS certificates.
  1350. # Additional security can be provided by configuring a `verify key`, which
  1351. # will make synapse check that the response is signed by that key.
  1352. #
  1353. # This setting supercedes an older setting named `perspectives`. The old format
  1354. # is still supported for backwards-compatibility, but it is deprecated.
  1355. #
  1356. # 'trusted_key_servers' defaults to matrix.org, but using it will generate a
  1357. # warning on start-up. To suppress this warning, set
  1358. # 'suppress_key_server_warning' to true.
  1359. #
  1360. # Options for each entry in the list include:
  1361. #
  1362. # server_name: the name of the server. required.
  1363. #
  1364. # verify_keys: an optional map from key id to base64-encoded public key.
  1365. # If specified, we will check that the response is signed by at least
  1366. # one of the given keys.
  1367. #
  1368. # accept_keys_insecurely: a boolean. Normally, if `verify_keys` is unset,
  1369. # and federation_verify_certificates is not `true`, synapse will refuse
  1370. # to start, because this would allow anyone who can spoof DNS responses
  1371. # to masquerade as the trusted key server. If you know what you are doing
  1372. # and are sure that your network environment provides a secure connection
  1373. # to the key server, you can set this to `true` to override this
  1374. # behaviour.
  1375. #
  1376. # An example configuration might look like:
  1377. #
  1378. #trusted_key_servers:
  1379. # - server_name: "my_trusted_server.example.com"
  1380. # verify_keys:
  1381. # "ed25519:auto": "abcdefghijklmnopqrstuvwxyzabcdefghijklmopqr"
  1382. # - server_name: "my_other_trusted_server.example.com"
  1383. #
  1384. trusted_key_servers:
  1385. - server_name: "matrix.org"
  1386. # Uncomment the following to disable the warning that is emitted when the
  1387. # trusted_key_servers include 'matrix.org'. See above.
  1388. #
  1389. #suppress_key_server_warning: true
  1390. # The signing keys to use when acting as a trusted key server. If not specified
  1391. # defaults to the server signing key.
  1392. #
  1393. # Can contain multiple keys, one per line.
  1394. #
  1395. #key_server_signing_keys_path: "key_server_signing_keys.key"
  1396. ## Single sign-on integration ##
  1397. # The following settings can be used to make Synapse use a single sign-on
  1398. # provider for authentication, instead of its internal password database.
  1399. #
  1400. # You will probably also want to set the following options to `false` to
  1401. # disable the regular login/registration flows:
  1402. # * enable_registration
  1403. # * password_config.enabled
  1404. #
  1405. # You will also want to investigate the settings under the "sso" configuration
  1406. # section below.
  1407. # Enable SAML2 for registration and login. Uses pysaml2.
  1408. #
  1409. # At least one of `sp_config` or `config_path` must be set in this section to
  1410. # enable SAML login.
  1411. #
  1412. # Once SAML support is enabled, a metadata file will be exposed at
  1413. # https://<server>:<port>/_synapse/client/saml2/metadata.xml, which you may be able to
  1414. # use to configure your SAML IdP with. Alternatively, you can manually configure
  1415. # the IdP to use an ACS location of
  1416. # https://<server>:<port>/_synapse/client/saml2/authn_response.
  1417. #
  1418. saml2_config:
  1419. # `sp_config` is the configuration for the pysaml2 Service Provider.
  1420. # See pysaml2 docs for format of config.
  1421. #
  1422. # Default values will be used for the 'entityid' and 'service' settings,
  1423. # so it is not normally necessary to specify them unless you need to
  1424. # override them.
  1425. #
  1426. sp_config:
  1427. # Point this to the IdP's metadata. You must provide either a local
  1428. # file via the `local` attribute or (preferably) a URL via the
  1429. # `remote` attribute.
  1430. #
  1431. #metadata:
  1432. # local: ["saml2/idp.xml"]
  1433. # remote:
  1434. # - url: https://our_idp/metadata.xml
  1435. # Allowed clock difference in seconds between the homeserver and IdP.
  1436. #
  1437. # Uncomment the below to increase the accepted time difference from 0 to 3 seconds.
  1438. #
  1439. #accepted_time_diff: 3
  1440. # By default, the user has to go to our login page first. If you'd like
  1441. # to allow IdP-initiated login, set 'allow_unsolicited: true' in a
  1442. # 'service.sp' section:
  1443. #
  1444. #service:
  1445. # sp:
  1446. # allow_unsolicited: true
  1447. # The examples below are just used to generate our metadata xml, and you
  1448. # may well not need them, depending on your setup. Alternatively you
  1449. # may need a whole lot more detail - see the pysaml2 docs!
  1450. #description: ["My awesome SP", "en"]
  1451. #name: ["Test SP", "en"]
  1452. #ui_info:
  1453. # display_name:
  1454. # - lang: en
  1455. # text: "Display Name is the descriptive name of your service."
  1456. # description:
  1457. # - lang: en
  1458. # text: "Description should be a short paragraph explaining the purpose of the service."
  1459. # information_url:
  1460. # - lang: en
  1461. # text: "https://example.com/terms-of-service"
  1462. # privacy_statement_url:
  1463. # - lang: en
  1464. # text: "https://example.com/privacy-policy"
  1465. # keywords:
  1466. # - lang: en
  1467. # text: ["Matrix", "Element"]
  1468. # logo:
  1469. # - lang: en
  1470. # text: "https://example.com/logo.svg"
  1471. # width: "200"
  1472. # height: "80"
  1473. #organization:
  1474. # name: Example com
  1475. # display_name:
  1476. # - ["Example co", "en"]
  1477. # url: "http://example.com"
  1478. #contact_person:
  1479. # - given_name: Bob
  1480. # sur_name: "the Sysadmin"
  1481. # email_address": ["admin@example.com"]
  1482. # contact_type": technical
  1483. # Instead of putting the config inline as above, you can specify a
  1484. # separate pysaml2 configuration file:
  1485. #
  1486. #config_path: "CONFDIR/sp_conf.py"
  1487. # The lifetime of a SAML session. This defines how long a user has to
  1488. # complete the authentication process, if allow_unsolicited is unset.
  1489. # The default is 15 minutes.
  1490. #
  1491. #saml_session_lifetime: 5m
  1492. # An external module can be provided here as a custom solution to
  1493. # mapping attributes returned from a saml provider onto a matrix user.
  1494. #
  1495. user_mapping_provider:
  1496. # The custom module's class. Uncomment to use a custom module.
  1497. #
  1498. #module: mapping_provider.SamlMappingProvider
  1499. # Custom configuration values for the module. Below options are
  1500. # intended for the built-in provider, they should be changed if
  1501. # using a custom module. This section will be passed as a Python
  1502. # dictionary to the module's `parse_config` method.
  1503. #
  1504. config:
  1505. # The SAML attribute (after mapping via the attribute maps) to use
  1506. # to derive the Matrix ID from. 'uid' by default.
  1507. #
  1508. # Note: This used to be configured by the
  1509. # saml2_config.mxid_source_attribute option. If that is still
  1510. # defined, its value will be used instead.
  1511. #
  1512. #mxid_source_attribute: displayName
  1513. # The mapping system to use for mapping the saml attribute onto a
  1514. # matrix ID.
  1515. #
  1516. # Options include:
  1517. # * 'hexencode' (which maps unpermitted characters to '=xx')
  1518. # * 'dotreplace' (which replaces unpermitted characters with
  1519. # '.').
  1520. # The default is 'hexencode'.
  1521. #
  1522. # Note: This used to be configured by the
  1523. # saml2_config.mxid_mapping option. If that is still defined, its
  1524. # value will be used instead.
  1525. #
  1526. #mxid_mapping: dotreplace
  1527. # In previous versions of synapse, the mapping from SAML attribute to
  1528. # MXID was always calculated dynamically rather than stored in a
  1529. # table. For backwards- compatibility, we will look for user_ids
  1530. # matching such a pattern before creating a new account.
  1531. #
  1532. # This setting controls the SAML attribute which will be used for this
  1533. # backwards-compatibility lookup. Typically it should be 'uid', but if
  1534. # the attribute maps are changed, it may be necessary to change it.
  1535. #
  1536. # The default is 'uid'.
  1537. #
  1538. #grandfathered_mxid_source_attribute: upn
  1539. # It is possible to configure Synapse to only allow logins if SAML attributes
  1540. # match particular values. The requirements can be listed under
  1541. # `attribute_requirements` as shown below. All of the listed attributes must
  1542. # match for the login to be permitted.
  1543. #
  1544. #attribute_requirements:
  1545. # - attribute: userGroup
  1546. # value: "staff"
  1547. # - attribute: department
  1548. # value: "sales"
  1549. # If the metadata XML contains multiple IdP entities then the `idp_entityid`
  1550. # option must be set to the entity to redirect users to.
  1551. #
  1552. # Most deployments only have a single IdP entity and so should omit this
  1553. # option.
  1554. #
  1555. #idp_entityid: 'https://our_idp/entityid'
  1556. # List of OpenID Connect (OIDC) / OAuth 2.0 identity providers, for registration
  1557. # and login.
  1558. #
  1559. # Options for each entry include:
  1560. #
  1561. # idp_id: a unique identifier for this identity provider. Used internally
  1562. # by Synapse; should be a single word such as 'github'.
  1563. #
  1564. # Note that, if this is changed, users authenticating via that provider
  1565. # will no longer be recognised as the same user!
  1566. #
  1567. # (Use "oidc" here if you are migrating from an old "oidc_config"
  1568. # configuration.)
  1569. #
  1570. # idp_name: A user-facing name for this identity provider, which is used to
  1571. # offer the user a choice of login mechanisms.
  1572. #
  1573. # idp_icon: An optional icon for this identity provider, which is presented
  1574. # by clients and Synapse's own IdP picker page. If given, must be an
  1575. # MXC URI of the format mxc://<server-name>/<media-id>. (An easy way to
  1576. # obtain such an MXC URI is to upload an image to an (unencrypted) room
  1577. # and then copy the "url" from the source of the event.)
  1578. #
  1579. # idp_brand: An optional brand for this identity provider, allowing clients
  1580. # to style the login flow according to the identity provider in question.
  1581. # See the spec for possible options here.
  1582. #
  1583. # discover: set to 'false' to disable the use of the OIDC discovery mechanism
  1584. # to discover endpoints. Defaults to true.
  1585. #
  1586. # issuer: Required. The OIDC issuer. Used to validate tokens and (if discovery
  1587. # is enabled) to discover the provider's endpoints.
  1588. #
  1589. # client_id: Required. oauth2 client id to use.
  1590. #
  1591. # client_secret: oauth2 client secret to use. May be omitted if
  1592. # client_secret_jwt_key is given, or if client_auth_method is 'none'.
  1593. #
  1594. # client_secret_jwt_key: Alternative to client_secret: details of a key used
  1595. # to create a JSON Web Token to be used as an OAuth2 client secret. If
  1596. # given, must be a dictionary with the following properties:
  1597. #
  1598. # key: a pem-encoded signing key. Must be a suitable key for the
  1599. # algorithm specified. Required unless 'key_file' is given.
  1600. #
  1601. # key_file: the path to file containing a pem-encoded signing key file.
  1602. # Required unless 'key' is given.
  1603. #
  1604. # jwt_header: a dictionary giving properties to include in the JWT
  1605. # header. Must include the key 'alg', giving the algorithm used to
  1606. # sign the JWT, such as "ES256", using the JWA identifiers in
  1607. # RFC7518.
  1608. #
  1609. # jwt_payload: an optional dictionary giving properties to include in
  1610. # the JWT payload. Normally this should include an 'iss' key.
  1611. #
  1612. # client_auth_method: auth method to use when exchanging the token. Valid
  1613. # values are 'client_secret_basic' (default), 'client_secret_post' and
  1614. # 'none'.
  1615. #
  1616. # scopes: list of scopes to request. This should normally include the "openid"
  1617. # scope. Defaults to ["openid"].
  1618. #
  1619. # authorization_endpoint: the oauth2 authorization endpoint. Required if
  1620. # provider discovery is disabled.
  1621. #
  1622. # token_endpoint: the oauth2 token endpoint. Required if provider discovery is
  1623. # disabled.
  1624. #
  1625. # userinfo_endpoint: the OIDC userinfo endpoint. Required if discovery is
  1626. # disabled and the 'openid' scope is not requested.
  1627. #
  1628. # jwks_uri: URI where to fetch the JWKS. Required if discovery is disabled and
  1629. # the 'openid' scope is used.
  1630. #
  1631. # skip_verification: set to 'true' to skip metadata verification. Use this if
  1632. # you are connecting to a provider that is not OpenID Connect compliant.
  1633. # Defaults to false. Avoid this in production.
  1634. #
  1635. # user_profile_method: Whether to fetch the user profile from the userinfo
  1636. # endpoint. Valid values are: 'auto' or 'userinfo_endpoint'.
  1637. #
  1638. # Defaults to 'auto', which fetches the userinfo endpoint if 'openid' is
  1639. # included in 'scopes'. Set to 'userinfo_endpoint' to always fetch the
  1640. # userinfo endpoint.
  1641. #
  1642. # allow_existing_users: set to 'true' to allow a user logging in via OIDC to
  1643. # match a pre-existing account instead of failing. This could be used if
  1644. # switching from password logins to OIDC. Defaults to false.
  1645. #
  1646. # user_mapping_provider: Configuration for how attributes returned from a OIDC
  1647. # provider are mapped onto a matrix user. This setting has the following
  1648. # sub-properties:
  1649. #
  1650. # module: The class name of a custom mapping module. Default is
  1651. # 'synapse.handlers.oidc.JinjaOidcMappingProvider'.
  1652. # See https://matrix-org.github.io/synapse/latest/sso_mapping_providers.html#openid-mapping-providers
  1653. # for information on implementing a custom mapping provider.
  1654. #
  1655. # config: Configuration for the mapping provider module. This section will
  1656. # be passed as a Python dictionary to the user mapping provider
  1657. # module's `parse_config` method.
  1658. #
  1659. # For the default provider, the following settings are available:
  1660. #
  1661. # subject_claim: name of the claim containing a unique identifier
  1662. # for the user. Defaults to 'sub', which OpenID Connect
  1663. # compliant providers should provide.
  1664. #
  1665. # localpart_template: Jinja2 template for the localpart of the MXID.
  1666. # If this is not set, the user will be prompted to choose their
  1667. # own username (see 'sso_auth_account_details.html' in the 'sso'
  1668. # section of this file).
  1669. #
  1670. # display_name_template: Jinja2 template for the display name to set
  1671. # on first login. If unset, no displayname will be set.
  1672. #
  1673. # email_template: Jinja2 template for the email address of the user.
  1674. # If unset, no email address will be added to the account.
  1675. #
  1676. # extra_attributes: a map of Jinja2 templates for extra attributes
  1677. # to send back to the client during login.
  1678. # Note that these are non-standard and clients will ignore them
  1679. # without modifications.
  1680. #
  1681. # When rendering, the Jinja2 templates are given a 'user' variable,
  1682. # which is set to the claims returned by the UserInfo Endpoint and/or
  1683. # in the ID Token.
  1684. #
  1685. # It is possible to configure Synapse to only allow logins if certain attributes
  1686. # match particular values in the OIDC userinfo. The requirements can be listed under
  1687. # `attribute_requirements` as shown below. All of the listed attributes must
  1688. # match for the login to be permitted. Additional attributes can be added to
  1689. # userinfo by expanding the `scopes` section of the OIDC config to retrieve
  1690. # additional information from the OIDC provider.
  1691. #
  1692. # If the OIDC claim is a list, then the attribute must match any value in the list.
  1693. # Otherwise, it must exactly match the value of the claim. Using the example
  1694. # below, the `family_name` claim MUST be "Stephensson", but the `groups`
  1695. # claim MUST contain "admin".
  1696. #
  1697. # attribute_requirements:
  1698. # - attribute: family_name
  1699. # value: "Stephensson"
  1700. # - attribute: groups
  1701. # value: "admin"
  1702. #
  1703. # See https://matrix-org.github.io/synapse/latest/openid.html
  1704. # for information on how to configure these options.
  1705. #
  1706. # For backwards compatibility, it is also possible to configure a single OIDC
  1707. # provider via an 'oidc_config' setting. This is now deprecated and admins are
  1708. # advised to migrate to the 'oidc_providers' format. (When doing that migration,
  1709. # use 'oidc' for the idp_id to ensure that existing users continue to be
  1710. # recognised.)
  1711. #
  1712. oidc_providers:
  1713. # Generic example
  1714. #
  1715. #- idp_id: my_idp
  1716. # idp_name: "My OpenID provider"
  1717. # idp_icon: "mxc://example.com/mediaid"
  1718. # discover: false
  1719. # issuer: "https://accounts.example.com/"
  1720. # client_id: "provided-by-your-issuer"
  1721. # client_secret: "provided-by-your-issuer"
  1722. # client_auth_method: client_secret_post
  1723. # scopes: ["openid", "profile"]
  1724. # authorization_endpoint: "https://accounts.example.com/oauth2/auth"
  1725. # token_endpoint: "https://accounts.example.com/oauth2/token"
  1726. # userinfo_endpoint: "https://accounts.example.com/userinfo"
  1727. # jwks_uri: "https://accounts.example.com/.well-known/jwks.json"
  1728. # skip_verification: true
  1729. # user_mapping_provider:
  1730. # config:
  1731. # subject_claim: "id"
  1732. # localpart_template: "{{ user.login }}"
  1733. # display_name_template: "{{ user.name }}"
  1734. # email_template: "{{ user.email }}"
  1735. # attribute_requirements:
  1736. # - attribute: userGroup
  1737. # value: "synapseUsers"
  1738. # Enable Central Authentication Service (CAS) for registration and login.
  1739. #
  1740. cas_config:
  1741. # Uncomment the following to enable authorization against a CAS server.
  1742. # Defaults to false.
  1743. #
  1744. #enabled: true
  1745. # The URL of the CAS authorization endpoint.
  1746. #
  1747. #server_url: "https://cas-server.com"
  1748. # The attribute of the CAS response to use as the display name.
  1749. #
  1750. # If unset, no displayname will be set.
  1751. #
  1752. #displayname_attribute: name
  1753. # It is possible to configure Synapse to only allow logins if CAS attributes
  1754. # match particular values. All of the keys in the mapping below must exist
  1755. # and the values must match the given value. Alternately if the given value
  1756. # is None then any value is allowed (the attribute just must exist).
  1757. # All of the listed attributes must match for the login to be permitted.
  1758. #
  1759. #required_attributes:
  1760. # userGroup: "staff"
  1761. # department: None
  1762. # Additional settings to use with single-sign on systems such as OpenID Connect,
  1763. # SAML2 and CAS.
  1764. #
  1765. sso:
  1766. # A list of client URLs which are whitelisted so that the user does not
  1767. # have to confirm giving access to their account to the URL. Any client
  1768. # whose URL starts with an entry in the following list will not be subject
  1769. # to an additional confirmation step after the SSO login is completed.
  1770. #
  1771. # WARNING: An entry such as "https://my.client" is insecure, because it
  1772. # will also match "https://my.client.evil.site", exposing your users to
  1773. # phishing attacks from evil.site. To avoid this, include a slash after the
  1774. # hostname: "https://my.client/".
  1775. #
  1776. # If public_baseurl is set, then the login fallback page (used by clients
  1777. # that don't natively support the required login flows) is whitelisted in
  1778. # addition to any URLs in this list.
  1779. #
  1780. # By default, this list is empty.
  1781. #
  1782. #client_whitelist:
  1783. # - https://riot.im/develop
  1784. # - https://my.custom.client/
  1785. # Uncomment to keep a user's profile fields in sync with information from
  1786. # the identity provider. Currently only syncing the displayname is
  1787. # supported. Fields are checked on every SSO login, and are updated
  1788. # if necessary.
  1789. #
  1790. # Note that enabling this option will override user profile information,
  1791. # regardless of whether users have opted-out of syncing that
  1792. # information when first signing in. Defaults to false.
  1793. #
  1794. #update_profile_information: true
  1795. # Directory in which Synapse will try to find the template files below.
  1796. # If not set, or the files named below are not found within the template
  1797. # directory, default templates from within the Synapse package will be used.
  1798. #
  1799. # Synapse will look for the following templates in this directory:
  1800. #
  1801. # * HTML page to prompt the user to choose an Identity Provider during
  1802. # login: 'sso_login_idp_picker.html'.
  1803. #
  1804. # This is only used if multiple SSO Identity Providers are configured.
  1805. #
  1806. # When rendering, this template is given the following variables:
  1807. # * redirect_url: the URL that the user will be redirected to after
  1808. # login.
  1809. #
  1810. # * server_name: the homeserver's name.
  1811. #
  1812. # * providers: a list of available Identity Providers. Each element is
  1813. # an object with the following attributes:
  1814. #
  1815. # * idp_id: unique identifier for the IdP
  1816. # * idp_name: user-facing name for the IdP
  1817. # * idp_icon: if specified in the IdP config, an MXC URI for an icon
  1818. # for the IdP
  1819. # * idp_brand: if specified in the IdP config, a textual identifier
  1820. # for the brand of the IdP
  1821. #
  1822. # The rendered HTML page should contain a form which submits its results
  1823. # back as a GET request, with the following query parameters:
  1824. #
  1825. # * redirectUrl: the client redirect URI (ie, the `redirect_url` passed
  1826. # to the template)
  1827. #
  1828. # * idp: the 'idp_id' of the chosen IDP.
  1829. #
  1830. # * HTML page to prompt new users to enter a userid and confirm other
  1831. # details: 'sso_auth_account_details.html'. This is only shown if the
  1832. # SSO implementation (with any user_mapping_provider) does not return
  1833. # a localpart.
  1834. #
  1835. # When rendering, this template is given the following variables:
  1836. #
  1837. # * server_name: the homeserver's name.
  1838. #
  1839. # * idp: details of the SSO Identity Provider that the user logged in
  1840. # with: an object with the following attributes:
  1841. #
  1842. # * idp_id: unique identifier for the IdP
  1843. # * idp_name: user-facing name for the IdP
  1844. # * idp_icon: if specified in the IdP config, an MXC URI for an icon
  1845. # for the IdP
  1846. # * idp_brand: if specified in the IdP config, a textual identifier
  1847. # for the brand of the IdP
  1848. #
  1849. # * user_attributes: an object containing details about the user that
  1850. # we received from the IdP. May have the following attributes:
  1851. #
  1852. # * display_name: the user's display_name
  1853. # * emails: a list of email addresses
  1854. #
  1855. # The template should render a form which submits the following fields:
  1856. #
  1857. # * username: the localpart of the user's chosen user id
  1858. #
  1859. # * HTML page allowing the user to consent to the server's terms and
  1860. # conditions. This is only shown for new users, and only if
  1861. # `user_consent.require_at_registration` is set.
  1862. #
  1863. # When rendering, this template is given the following variables:
  1864. #
  1865. # * server_name: the homeserver's name.
  1866. #
  1867. # * user_id: the user's matrix proposed ID.
  1868. #
  1869. # * user_profile.display_name: the user's proposed display name, if any.
  1870. #
  1871. # * consent_version: the version of the terms that the user will be
  1872. # shown
  1873. #
  1874. # * terms_url: a link to the page showing the terms.
  1875. #
  1876. # The template should render a form which submits the following fields:
  1877. #
  1878. # * accepted_version: the version of the terms accepted by the user
  1879. # (ie, 'consent_version' from the input variables).
  1880. #
  1881. # * HTML page for a confirmation step before redirecting back to the client
  1882. # with the login token: 'sso_redirect_confirm.html'.
  1883. #
  1884. # When rendering, this template is given the following variables:
  1885. #
  1886. # * redirect_url: the URL the user is about to be redirected to.
  1887. #
  1888. # * display_url: the same as `redirect_url`, but with the query
  1889. # parameters stripped. The intention is to have a
  1890. # human-readable URL to show to users, not to use it as
  1891. # the final address to redirect to.
  1892. #
  1893. # * server_name: the homeserver's name.
  1894. #
  1895. # * new_user: a boolean indicating whether this is the user's first time
  1896. # logging in.
  1897. #
  1898. # * user_id: the user's matrix ID.
  1899. #
  1900. # * user_profile.avatar_url: an MXC URI for the user's avatar, if any.
  1901. # None if the user has not set an avatar.
  1902. #
  1903. # * user_profile.display_name: the user's display name. None if the user
  1904. # has not set a display name.
  1905. #
  1906. # * HTML page which notifies the user that they are authenticating to confirm
  1907. # an operation on their account during the user interactive authentication
  1908. # process: 'sso_auth_confirm.html'.
  1909. #
  1910. # When rendering, this template is given the following variables:
  1911. # * redirect_url: the URL the user is about to be redirected to.
  1912. #
  1913. # * description: the operation which the user is being asked to confirm
  1914. #
  1915. # * idp: details of the Identity Provider that we will use to confirm
  1916. # the user's identity: an object with the following attributes:
  1917. #
  1918. # * idp_id: unique identifier for the IdP
  1919. # * idp_name: user-facing name for the IdP
  1920. # * idp_icon: if specified in the IdP config, an MXC URI for an icon
  1921. # for the IdP
  1922. # * idp_brand: if specified in the IdP config, a textual identifier
  1923. # for the brand of the IdP
  1924. #
  1925. # * HTML page shown after a successful user interactive authentication session:
  1926. # 'sso_auth_success.html'.
  1927. #
  1928. # Note that this page must include the JavaScript which notifies of a successful authentication
  1929. # (see https://matrix.org/docs/spec/client_server/r0.6.0#fallback).
  1930. #
  1931. # This template has no additional variables.
  1932. #
  1933. # * HTML page shown after a user-interactive authentication session which
  1934. # does not map correctly onto the expected user: 'sso_auth_bad_user.html'.
  1935. #
  1936. # When rendering, this template is given the following variables:
  1937. # * server_name: the homeserver's name.
  1938. # * user_id_to_verify: the MXID of the user that we are trying to
  1939. # validate.
  1940. #
  1941. # * HTML page shown during single sign-on if a deactivated user (according to Synapse's database)
  1942. # attempts to login: 'sso_account_deactivated.html'.
  1943. #
  1944. # This template has no additional variables.
  1945. #
  1946. # * HTML page to display to users if something goes wrong during the
  1947. # OpenID Connect authentication process: 'sso_error.html'.
  1948. #
  1949. # When rendering, this template is given two variables:
  1950. # * error: the technical name of the error
  1951. # * error_description: a human-readable message for the error
  1952. #
  1953. # You can see the default templates at:
  1954. # https://github.com/matrix-org/synapse/tree/master/synapse/res/templates
  1955. #
  1956. #template_dir: "res/templates"
  1957. # JSON web token integration. The following settings can be used to make
  1958. # Synapse JSON web tokens for authentication, instead of its internal
  1959. # password database.
  1960. #
  1961. # Each JSON Web Token needs to contain a "sub" (subject) claim, which is
  1962. # used as the localpart of the mxid.
  1963. #
  1964. # Additionally, the expiration time ("exp"), not before time ("nbf"),
  1965. # and issued at ("iat") claims are validated if present.
  1966. #
  1967. # Note that this is a non-standard login type and client support is
  1968. # expected to be non-existent.
  1969. #
  1970. # See https://matrix-org.github.io/synapse/latest/jwt.html.
  1971. #
  1972. #jwt_config:
  1973. # Uncomment the following to enable authorization using JSON web
  1974. # tokens. Defaults to false.
  1975. #
  1976. #enabled: true
  1977. # This is either the private shared secret or the public key used to
  1978. # decode the contents of the JSON web token.
  1979. #
  1980. # Required if 'enabled' is true.
  1981. #
  1982. #secret: "provided-by-your-issuer"
  1983. # The algorithm used to sign the JSON web token.
  1984. #
  1985. # Supported algorithms are listed at
  1986. # https://pyjwt.readthedocs.io/en/latest/algorithms.html
  1987. #
  1988. # Required if 'enabled' is true.
  1989. #
  1990. #algorithm: "provided-by-your-issuer"
  1991. # The issuer to validate the "iss" claim against.
  1992. #
  1993. # Optional, if provided the "iss" claim will be required and
  1994. # validated for all JSON web tokens.
  1995. #
  1996. #issuer: "provided-by-your-issuer"
  1997. # A list of audiences to validate the "aud" claim against.
  1998. #
  1999. # Optional, if provided the "aud" claim will be required and
  2000. # validated for all JSON web tokens.
  2001. #
  2002. # Note that if the "aud" claim is included in a JSON web token then
  2003. # validation will fail without configuring audiences.
  2004. #
  2005. #audiences:
  2006. # - "provided-by-your-issuer"
  2007. password_config:
  2008. # Uncomment to disable password login
  2009. #
  2010. #enabled: false
  2011. # Uncomment to disable authentication against the local password
  2012. # database. This is ignored if `enabled` is false, and is only useful
  2013. # if you have other password_providers.
  2014. #
  2015. #localdb_enabled: false
  2016. # Uncomment and change to a secret random string for extra security.
  2017. # DO NOT CHANGE THIS AFTER INITIAL SETUP!
  2018. #
  2019. #pepper: "EVEN_MORE_SECRET"
  2020. # Define and enforce a password policy. Each parameter is optional.
  2021. # This is an implementation of MSC2000.
  2022. #
  2023. policy:
  2024. # Whether to enforce the password policy.
  2025. # Defaults to 'false'.
  2026. #
  2027. #enabled: true
  2028. # Minimum accepted length for a password.
  2029. # Defaults to 0.
  2030. #
  2031. #minimum_length: 15
  2032. # Whether a password must contain at least one digit.
  2033. # Defaults to 'false'.
  2034. #
  2035. #require_digit: true
  2036. # Whether a password must contain at least one symbol.
  2037. # A symbol is any character that's not a number or a letter.
  2038. # Defaults to 'false'.
  2039. #
  2040. #require_symbol: true
  2041. # Whether a password must contain at least one lowercase letter.
  2042. # Defaults to 'false'.
  2043. #
  2044. #require_lowercase: true
  2045. # Whether a password must contain at least one lowercase letter.
  2046. # Defaults to 'false'.
  2047. #
  2048. #require_uppercase: true
  2049. ui_auth:
  2050. # The amount of time to allow a user-interactive authentication session
  2051. # to be active.
  2052. #
  2053. # This defaults to 0, meaning the user is queried for their credentials
  2054. # before every action, but this can be overridden to allow a single
  2055. # validation to be re-used. This weakens the protections afforded by
  2056. # the user-interactive authentication process, by allowing for multiple
  2057. # (and potentially different) operations to use the same validation session.
  2058. #
  2059. # This is ignored for potentially "dangerous" operations (including
  2060. # deactivating an account, modifying an account password, and
  2061. # adding a 3PID).
  2062. #
  2063. # Uncomment below to allow for credential validation to last for 15
  2064. # seconds.
  2065. #
  2066. #session_timeout: "15s"
  2067. # Configuration for sending emails from Synapse.
  2068. #
  2069. email:
  2070. # The hostname of the outgoing SMTP server to use. Defaults to 'localhost'.
  2071. #
  2072. #smtp_host: mail.server
  2073. # The port on the mail server for outgoing SMTP. Defaults to 25.
  2074. #
  2075. #smtp_port: 587
  2076. # Username/password for authentication to the SMTP server. By default, no
  2077. # authentication is attempted.
  2078. #
  2079. #smtp_user: "exampleusername"
  2080. #smtp_pass: "examplepassword"
  2081. # Uncomment the following to require TLS transport security for SMTP.
  2082. # By default, Synapse will connect over plain text, and will then switch to
  2083. # TLS via STARTTLS *if the SMTP server supports it*. If this option is set,
  2084. # Synapse will refuse to connect unless the server supports STARTTLS.
  2085. #
  2086. #require_transport_security: true
  2087. # notif_from defines the "From" address to use when sending emails.
  2088. # It must be set if email sending is enabled.
  2089. #
  2090. # The placeholder '%(app)s' will be replaced by the application name,
  2091. # which is normally 'app_name' (below), but may be overridden by the
  2092. # Matrix client application.
  2093. #
  2094. # Note that the placeholder must be written '%(app)s', including the
  2095. # trailing 's'.
  2096. #
  2097. #notif_from: "Your Friendly %(app)s homeserver <noreply@example.com>"
  2098. # app_name defines the default value for '%(app)s' in notif_from and email
  2099. # subjects. It defaults to 'Matrix'.
  2100. #
  2101. #app_name: my_branded_matrix_server
  2102. # Uncomment the following to enable sending emails for messages that the user
  2103. # has missed. Disabled by default.
  2104. #
  2105. #enable_notifs: true
  2106. # Uncomment the following to disable automatic subscription to email
  2107. # notifications for new users. Enabled by default.
  2108. #
  2109. #notif_for_new_users: false
  2110. # Custom URL for client links within the email notifications. By default
  2111. # links will be based on "https://matrix.to".
  2112. #
  2113. # (This setting used to be called riot_base_url; the old name is still
  2114. # supported for backwards-compatibility but is now deprecated.)
  2115. #
  2116. #client_base_url: "http://localhost/riot"
  2117. # Configure the time that a validation email will expire after sending.
  2118. # Defaults to 1h.
  2119. #
  2120. #validation_token_lifetime: 15m
  2121. # The web client location to direct users to during an invite. This is passed
  2122. # to the identity server as the org.matrix.web_client_location key. Defaults
  2123. # to unset, giving no guidance to the identity server.
  2124. #
  2125. #invite_client_location: https://app.element.io
  2126. # Directory in which Synapse will try to find the template files below.
  2127. # If not set, or the files named below are not found within the template
  2128. # directory, default templates from within the Synapse package will be used.
  2129. #
  2130. # Synapse will look for the following templates in this directory:
  2131. #
  2132. # * The contents of email notifications of missed events: 'notif_mail.html' and
  2133. # 'notif_mail.txt'.
  2134. #
  2135. # * The contents of account expiry notice emails: 'notice_expiry.html' and
  2136. # 'notice_expiry.txt'.
  2137. #
  2138. # * The contents of password reset emails sent by the homeserver:
  2139. # 'password_reset.html' and 'password_reset.txt'
  2140. #
  2141. # * An HTML page that a user will see when they follow the link in the password
  2142. # reset email. The user will be asked to confirm the action before their
  2143. # password is reset: 'password_reset_confirmation.html'
  2144. #
  2145. # * HTML pages for success and failure that a user will see when they confirm
  2146. # the password reset flow using the page above: 'password_reset_success.html'
  2147. # and 'password_reset_failure.html'
  2148. #
  2149. # * The contents of address verification emails sent during registration:
  2150. # 'registration.html' and 'registration.txt'
  2151. #
  2152. # * HTML pages for success and failure that a user will see when they follow
  2153. # the link in an address verification email sent during registration:
  2154. # 'registration_success.html' and 'registration_failure.html'
  2155. #
  2156. # * The contents of address verification emails sent when an address is added
  2157. # to a Matrix account: 'add_threepid.html' and 'add_threepid.txt'
  2158. #
  2159. # * HTML pages for success and failure that a user will see when they follow
  2160. # the link in an address verification email sent when an address is added
  2161. # to a Matrix account: 'add_threepid_success.html' and
  2162. # 'add_threepid_failure.html'
  2163. #
  2164. # You can see the default templates at:
  2165. # https://github.com/matrix-org/synapse/tree/master/synapse/res/templates
  2166. #
  2167. #template_dir: "res/templates"
  2168. # Subjects to use when sending emails from Synapse.
  2169. #
  2170. # The placeholder '%(app)s' will be replaced with the value of the 'app_name'
  2171. # setting above, or by a value dictated by the Matrix client application.
  2172. #
  2173. # If a subject isn't overridden in this configuration file, the value used as
  2174. # its example will be used.
  2175. #
  2176. #subjects:
  2177. # Subjects for notification emails.
  2178. #
  2179. # On top of the '%(app)s' placeholder, these can use the following
  2180. # placeholders:
  2181. #
  2182. # * '%(person)s', which will be replaced by the display name of the user(s)
  2183. # that sent the message(s), e.g. "Alice and Bob".
  2184. # * '%(room)s', which will be replaced by the name of the room the
  2185. # message(s) have been sent to, e.g. "My super room".
  2186. #
  2187. # See the example provided for each setting to see which placeholder can be
  2188. # used and how to use them.
  2189. #
  2190. # Subject to use to notify about one message from one or more user(s) in a
  2191. # room which has a name.
  2192. #message_from_person_in_room: "[%(app)s] You have a message on %(app)s from %(person)s in the %(room)s room..."
  2193. #
  2194. # Subject to use to notify about one message from one or more user(s) in a
  2195. # room which doesn't have a name.
  2196. #message_from_person: "[%(app)s] You have a message on %(app)s from %(person)s..."
  2197. #
  2198. # Subject to use to notify about multiple messages from one or more users in
  2199. # a room which doesn't have a name.
  2200. #messages_from_person: "[%(app)s] You have messages on %(app)s from %(person)s..."
  2201. #
  2202. # Subject to use to notify about multiple messages in a room which has a
  2203. # name.
  2204. #messages_in_room: "[%(app)s] You have messages on %(app)s in the %(room)s room..."
  2205. #
  2206. # Subject to use to notify about multiple messages in multiple rooms.
  2207. #messages_in_room_and_others: "[%(app)s] You have messages on %(app)s in the %(room)s room and others..."
  2208. #
  2209. # Subject to use to notify about multiple messages from multiple persons in
  2210. # multiple rooms. This is similar to the setting above except it's used when
  2211. # the room in which the notification was triggered has no name.
  2212. #messages_from_person_and_others: "[%(app)s] You have messages on %(app)s from %(person)s and others..."
  2213. #
  2214. # Subject to use to notify about an invite to a room which has a name.
  2215. #invite_from_person_to_room: "[%(app)s] %(person)s has invited you to join the %(room)s room on %(app)s..."
  2216. #
  2217. # Subject to use to notify about an invite to a room which doesn't have a
  2218. # name.
  2219. #invite_from_person: "[%(app)s] %(person)s has invited you to chat on %(app)s..."
  2220. # Subject for emails related to account administration.
  2221. #
  2222. # On top of the '%(app)s' placeholder, these one can use the
  2223. # '%(server_name)s' placeholder, which will be replaced by the value of the
  2224. # 'server_name' setting in your Synapse configuration.
  2225. #
  2226. # Subject to use when sending a password reset email.
  2227. #password_reset: "[%(server_name)s] Password reset"
  2228. #
  2229. # Subject to use when sending a verification email to assert an address's
  2230. # ownership.
  2231. #email_validation: "[%(server_name)s] Validate your email"
  2232. # Password providers allow homeserver administrators to integrate
  2233. # their Synapse installation with existing authentication methods
  2234. # ex. LDAP, external tokens, etc.
  2235. #
  2236. # For more information and known implementations, please see
  2237. # https://matrix-org.github.io/synapse/latest/password_auth_providers.html
  2238. #
  2239. # Note: instances wishing to use SAML or CAS authentication should
  2240. # instead use the `saml2_config` or `cas_config` options,
  2241. # respectively.
  2242. #
  2243. password_providers:
  2244. # # Example config for an LDAP auth provider
  2245. # - module: "ldap_auth_provider.LdapAuthProvider"
  2246. # config:
  2247. # enabled: true
  2248. # uri: "ldap://ldap.example.com:389"
  2249. # start_tls: true
  2250. # base: "ou=users,dc=example,dc=com"
  2251. # attributes:
  2252. # uid: "cn"
  2253. # mail: "email"
  2254. # name: "givenName"
  2255. # #bind_dn:
  2256. # #bind_password:
  2257. # #filter: "(objectClass=posixAccount)"
  2258. ## Push ##
  2259. push:
  2260. # Clients requesting push notifications can either have the body of
  2261. # the message sent in the notification poke along with other details
  2262. # like the sender, or just the event ID and room ID (`event_id_only`).
  2263. # If clients choose the former, this option controls whether the
  2264. # notification request includes the content of the event (other details
  2265. # like the sender are still included). For `event_id_only` push, it
  2266. # has no effect.
  2267. #
  2268. # For modern android devices the notification content will still appear
  2269. # because it is loaded by the app. iPhone, however will send a
  2270. # notification saying only that a message arrived and who it came from.
  2271. #
  2272. # The default value is "true" to include message details. Uncomment to only
  2273. # include the event ID and room ID in push notification payloads.
  2274. #
  2275. #include_content: false
  2276. # When a push notification is received, an unread count is also sent.
  2277. # This number can either be calculated as the number of unread messages
  2278. # for the user, or the number of *rooms* the user has unread messages in.
  2279. #
  2280. # The default value is "true", meaning push clients will see the number of
  2281. # rooms with unread messages in them. Uncomment to instead send the number
  2282. # of unread messages.
  2283. #
  2284. #group_unread_count_by_room: false
  2285. ## Rooms ##
  2286. # Controls whether locally-created rooms should be end-to-end encrypted by
  2287. # default.
  2288. #
  2289. # Possible options are "all", "invite", and "off". They are defined as:
  2290. #
  2291. # * "all": any locally-created room
  2292. # * "invite": any room created with the "private_chat" or "trusted_private_chat"
  2293. # room creation presets
  2294. # * "off": this option will take no effect
  2295. #
  2296. # The default value is "off".
  2297. #
  2298. # Note that this option will only affect rooms created after it is set. It
  2299. # will also not affect rooms created by other servers.
  2300. #
  2301. #encryption_enabled_by_default_for_room_type: invite
  2302. # Uncomment to allow non-server-admin users to create groups on this server
  2303. #
  2304. #enable_group_creation: true
  2305. # If enabled, non server admins can only create groups with local parts
  2306. # starting with this prefix
  2307. #
  2308. #group_creation_prefix: "unofficial_"
  2309. # User Directory configuration
  2310. #
  2311. user_directory:
  2312. # Defines whether users can search the user directory. If false then
  2313. # empty responses are returned to all queries. Defaults to true.
  2314. #
  2315. # Uncomment to disable the user directory.
  2316. #
  2317. #enabled: false
  2318. # Defines whether to search all users visible to your HS when searching
  2319. # the user directory, rather than limiting to users visible in public
  2320. # rooms. Defaults to false.
  2321. #
  2322. # If you set it true, you'll have to rebuild the user_directory search
  2323. # indexes, see:
  2324. # https://matrix-org.github.io/synapse/latest/user_directory.html
  2325. #
  2326. # Uncomment to return search results containing all known users, even if that
  2327. # user does not share a room with the requester.
  2328. #
  2329. #search_all_users: true
  2330. # Defines whether to prefer local users in search query results.
  2331. # If True, local users are more likely to appear above remote users
  2332. # when searching the user directory. Defaults to false.
  2333. #
  2334. # Uncomment to prefer local over remote users in user directory search
  2335. # results.
  2336. #
  2337. #prefer_local_users: true
  2338. # User Consent configuration
  2339. #
  2340. # for detailed instructions, see
  2341. # https://matrix-org.github.io/synapse/latest/consent_tracking.html
  2342. #
  2343. # Parts of this section are required if enabling the 'consent' resource under
  2344. # 'listeners', in particular 'template_dir' and 'version'.
  2345. #
  2346. # 'template_dir' gives the location of the templates for the HTML forms.
  2347. # This directory should contain one subdirectory per language (eg, 'en', 'fr'),
  2348. # and each language directory should contain the policy document (named as
  2349. # '<version>.html') and a success page (success.html).
  2350. #
  2351. # 'version' specifies the 'current' version of the policy document. It defines
  2352. # the version to be served by the consent resource if there is no 'v'
  2353. # parameter.
  2354. #
  2355. # 'server_notice_content', if enabled, will send a user a "Server Notice"
  2356. # asking them to consent to the privacy policy. The 'server_notices' section
  2357. # must also be configured for this to work. Notices will *not* be sent to
  2358. # guest users unless 'send_server_notice_to_guests' is set to true.
  2359. #
  2360. # 'block_events_error', if set, will block any attempts to send events
  2361. # until the user consents to the privacy policy. The value of the setting is
  2362. # used as the text of the error.
  2363. #
  2364. # 'require_at_registration', if enabled, will add a step to the registration
  2365. # process, similar to how captcha works. Users will be required to accept the
  2366. # policy before their account is created.
  2367. #
  2368. # 'policy_name' is the display name of the policy users will see when registering
  2369. # for an account. Has no effect unless `require_at_registration` is enabled.
  2370. # Defaults to "Privacy Policy".
  2371. #
  2372. #user_consent:
  2373. # template_dir: res/templates/privacy
  2374. # version: 1.0
  2375. # server_notice_content:
  2376. # msgtype: m.text
  2377. # body: >-
  2378. # To continue using this homeserver you must review and agree to the
  2379. # terms and conditions at %(consent_uri)s
  2380. # send_server_notice_to_guests: true
  2381. # block_events_error: >-
  2382. # To continue using this homeserver you must review and agree to the
  2383. # terms and conditions at %(consent_uri)s
  2384. # require_at_registration: false
  2385. # policy_name: Privacy Policy
  2386. #
  2387. # Settings for local room and user statistics collection. See
  2388. # https://matrix-org.github.io/synapse/latest/room_and_user_statistics.html.
  2389. #
  2390. stats:
  2391. # Uncomment the following to disable room and user statistics. Note that doing
  2392. # so may cause certain features (such as the room directory) not to work
  2393. # correctly.
  2394. #
  2395. #enabled: false
  2396. # The size of each timeslice in the room_stats_historical and
  2397. # user_stats_historical tables, as a time period. Defaults to "1d".
  2398. #
  2399. #bucket_size: 1h
  2400. # Server Notices room configuration
  2401. #
  2402. # Uncomment this section to enable a room which can be used to send notices
  2403. # from the server to users. It is a special room which cannot be left; notices
  2404. # come from a special "notices" user id.
  2405. #
  2406. # If you uncomment this section, you *must* define the system_mxid_localpart
  2407. # setting, which defines the id of the user which will be used to send the
  2408. # notices.
  2409. #
  2410. # It's also possible to override the room name, the display name of the
  2411. # "notices" user, and the avatar for the user.
  2412. #
  2413. #server_notices:
  2414. # system_mxid_localpart: notices
  2415. # system_mxid_display_name: "Server Notices"
  2416. # system_mxid_avatar_url: "mxc://server.com/oumMVlgDnLYFaPVkExemNVVZ"
  2417. # room_name: "Server Notices"
  2418. # Uncomment to disable searching the public room list. When disabled
  2419. # blocks searching local and remote room lists for local and remote
  2420. # users by always returning an empty list for all queries.
  2421. #
  2422. #enable_room_list_search: false
  2423. # The `alias_creation` option controls who's allowed to create aliases
  2424. # on this server.
  2425. #
  2426. # The format of this option is a list of rules that contain globs that
  2427. # match against user_id, room_id and the new alias (fully qualified with
  2428. # server name). The action in the first rule that matches is taken,
  2429. # which can currently either be "allow" or "deny".
  2430. #
  2431. # Missing user_id/room_id/alias fields default to "*".
  2432. #
  2433. # If no rules match the request is denied. An empty list means no one
  2434. # can create aliases.
  2435. #
  2436. # Options for the rules include:
  2437. #
  2438. # user_id: Matches against the creator of the alias
  2439. # alias: Matches against the alias being created
  2440. # room_id: Matches against the room ID the alias is being pointed at
  2441. # action: Whether to "allow" or "deny" the request if the rule matches
  2442. #
  2443. # The default is:
  2444. #
  2445. #alias_creation_rules:
  2446. # - user_id: "*"
  2447. # alias: "*"
  2448. # room_id: "*"
  2449. # action: allow
  2450. # The `room_list_publication_rules` option controls who can publish and
  2451. # which rooms can be published in the public room list.
  2452. #
  2453. # The format of this option is the same as that for
  2454. # `alias_creation_rules`.
  2455. #
  2456. # If the room has one or more aliases associated with it, only one of
  2457. # the aliases needs to match the alias rule. If there are no aliases
  2458. # then only rules with `alias: *` match.
  2459. #
  2460. # If no rules match the request is denied. An empty list means no one
  2461. # can publish rooms.
  2462. #
  2463. # Options for the rules include:
  2464. #
  2465. # user_id: Matches against the creator of the alias
  2466. # room_id: Matches against the room ID being published
  2467. # alias: Matches against any current local or canonical aliases
  2468. # associated with the room
  2469. # action: Whether to "allow" or "deny" the request if the rule matches
  2470. #
  2471. # The default is:
  2472. #
  2473. #room_list_publication_rules:
  2474. # - user_id: "*"
  2475. # alias: "*"
  2476. # room_id: "*"
  2477. # action: allow
  2478. # Server admins can define a Python module that implements extra rules for
  2479. # allowing or denying incoming events. In order to work, this module needs to
  2480. # override the methods defined in synapse/events/third_party_rules.py.
  2481. #
  2482. # This feature is designed to be used in closed federations only, where each
  2483. # participating server enforces the same rules.
  2484. #
  2485. #third_party_event_rules:
  2486. # module: "my_custom_project.SuperRulesSet"
  2487. # config:
  2488. # example_option: 'things'
  2489. ## Opentracing ##
  2490. # These settings enable opentracing, which implements distributed tracing.
  2491. # This allows you to observe the causal chains of events across servers
  2492. # including requests, key lookups etc., across any server running
  2493. # synapse or any other other services which supports opentracing
  2494. # (specifically those implemented with Jaeger).
  2495. #
  2496. opentracing:
  2497. # tracing is disabled by default. Uncomment the following line to enable it.
  2498. #
  2499. #enabled: true
  2500. # The list of homeservers we wish to send and receive span contexts and span baggage.
  2501. # See https://matrix-org.github.io/synapse/latest/opentracing.html.
  2502. #
  2503. # This is a list of regexes which are matched against the server_name of the
  2504. # homeserver.
  2505. #
  2506. # By default, it is empty, so no servers are matched.
  2507. #
  2508. #homeserver_whitelist:
  2509. # - ".*"
  2510. # A list of the matrix IDs of users whose requests will always be traced,
  2511. # even if the tracing system would otherwise drop the traces due to
  2512. # probabilistic sampling.
  2513. #
  2514. # By default, the list is empty.
  2515. #
  2516. #force_tracing_for_users:
  2517. # - "@user1:server_name"
  2518. # - "@user2:server_name"
  2519. # Jaeger can be configured to sample traces at different rates.
  2520. # All configuration options provided by Jaeger can be set here.
  2521. # Jaeger's configuration is mostly related to trace sampling which
  2522. # is documented here:
  2523. # https://www.jaegertracing.io/docs/latest/sampling/.
  2524. #
  2525. #jaeger_config:
  2526. # sampler:
  2527. # type: const
  2528. # param: 1
  2529. # logging:
  2530. # false
  2531. ## Workers ##
  2532. # Disables sending of outbound federation transactions on the main process.
  2533. # Uncomment if using a federation sender worker.
  2534. #
  2535. #send_federation: false
  2536. # It is possible to run multiple federation sender workers, in which case the
  2537. # work is balanced across them.
  2538. #
  2539. # This configuration must be shared between all federation sender workers, and if
  2540. # changed all federation sender workers must be stopped at the same time and then
  2541. # started, to ensure that all instances are running with the same config (otherwise
  2542. # events may be dropped).
  2543. #
  2544. #federation_sender_instances:
  2545. # - federation_sender1
  2546. # When using workers this should be a map from `worker_name` to the
  2547. # HTTP replication listener of the worker, if configured.
  2548. #
  2549. #instance_map:
  2550. # worker1:
  2551. # host: localhost
  2552. # port: 8034
  2553. # Experimental: When using workers you can define which workers should
  2554. # handle event persistence and typing notifications. Any worker
  2555. # specified here must also be in the `instance_map`.
  2556. #
  2557. #stream_writers:
  2558. # events: worker1
  2559. # typing: worker1
  2560. # The worker that is used to run background tasks (e.g. cleaning up expired
  2561. # data). If not provided this defaults to the main process.
  2562. #
  2563. #run_background_tasks_on: worker1
  2564. # A shared secret used by the replication APIs to authenticate HTTP requests
  2565. # from workers.
  2566. #
  2567. # By default this is unused and traffic is not authenticated.
  2568. #
  2569. #worker_replication_secret: ""
  2570. # Configuration for Redis when using workers. This *must* be enabled when
  2571. # using workers (unless using old style direct TCP configuration).
  2572. #
  2573. redis:
  2574. # Uncomment the below to enable Redis support.
  2575. #
  2576. #enabled: true
  2577. # Optional host and port to use to connect to redis. Defaults to
  2578. # localhost and 6379
  2579. #
  2580. #host: localhost
  2581. #port: 6379
  2582. # Optional password if configured on the Redis instance
  2583. #
  2584. #password: <secret_password>