homeserver_sample_config.html 122 KB

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