sample_config.yaml 58 KB

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