sample_config.yaml 104 KB

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