sample_config.yaml 101 KB

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