sample_config.yaml 100 KB

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