sample_config.yaml 62 KB

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