homeserver_sample_config.html 123 KB

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