1
0

sample_config.yaml 101 KB

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