sample_config.yaml 102 KB

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