upgrade.html 139 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975
  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>Upgrading between Synapse Versions - 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="setup/forward_proxy.html">Configuring a Forward/Outbound Proxy</a></li><li class="chapter-item expanded "><a href="turn-howto.html">Configuring a Turn Server</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="setup/turn/coturn.html">coturn TURN server</a></li><li class="chapter-item expanded "><a href="setup/turn/eturnal.html">eturnal TURN server</a></li></ol></li><li class="chapter-item expanded "><a href="delegate.html">Delegation</a></li><li class="chapter-item expanded affix "><li class="part-title">Upgrading</li><li class="chapter-item expanded "><a href="upgrade.html" class="active">Upgrading between Synapse Versions</a></li><li class="chapter-item expanded affix "><li class="part-title">Usage</li><li class="chapter-item expanded "><a href="federate.html">Federation</a></li><li class="chapter-item expanded "><a href="usage/configuration/index.html">Configuration</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="usage/configuration/config_documentation.html">Configuration Manual</a></li><li class="chapter-item expanded "><a href="usage/configuration/homeserver_sample_config.html">Homeserver Sample Config File</a></li><li class="chapter-item expanded "><a href="usage/configuration/logging_sample_config.html">Logging Sample Config File</a></li><li class="chapter-item expanded "><a href="structured_logging.html">Structured Logging</a></li><li class="chapter-item expanded "><a href="templates.html">Templates</a></li><li class="chapter-item expanded "><a href="usage/configuration/user_authentication/index.html">User Authentication</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="usage/configuration/user_authentication/single_sign_on/index.html">Single-Sign On</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="openid.html">OpenID Connect</a></li><li class="chapter-item expanded "><a href="usage/configuration/user_authentication/single_sign_on/saml.html">SAML</a></li><li class="chapter-item expanded "><a href="usage/configuration/user_authentication/single_sign_on/cas.html">CAS</a></li><li class="chapter-item expanded "><a href="sso_mapping_providers.html">SSO Mapping Providers</a></li></ol></li><li class="chapter-item expanded "><a href="password_auth_providers.html">Password Auth Providers</a></li><li class="chapter-item expanded "><a href="jwt.html">JSON Web Tokens</a></li><li class="chapter-item expanded "><a href="usage/configuration/user_authentication/refresh_tokens.html">Refresh Tokens</a></li></ol></li><li class="chapter-item expanded "><a href="CAPTCHA_SETUP.html">Registration Captcha</a></li><li class="chapter-item expanded "><a href="application_services.html">Application Services</a></li><li class="chapter-item expanded "><a href="server_notices.html">Server Notices</a></li><li class="chapter-item expanded "><a href="consent_tracking.html">Consent Tracking</a></li><li class="chapter-item expanded "><a href="user_directory.html">User Directory</a></li><li class="chapter-item expanded "><a href="message_retention_policies.html">Message Retention Policies</a></li><li class="chapter-item expanded "><a href="modules/index.html">Pluggable Modules</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="modules/writing_a_module.html">Writing a module</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="modules/spam_checker_callbacks.html">Spam checker callbacks</a></li><li class="chapter-item expanded "><a href="modules/third_party_rules_callbacks.html">Third-party rules callbacks</a></li><li class="chapter-item expanded "><a href="modules/presence_router_callbacks.html">Presence router callbacks</a></li><li class="chapter-item expanded "><a href="modules/account_validity_callbacks.html">Account validity callbacks</a></li><li class="chapter-item expanded "><a href="modules/password_auth_provider_callbacks.html">Password auth provider callbacks</a></li><li class="chapter-item expanded "><a href="modules/background_update_controller_callbacks.html">Background update controller callbacks</a></li><li class="chapter-item expanded "><a href="modules/account_data_callbacks.html">Account data callbacks</a></li><li class="chapter-item expanded "><a href="modules/porting_legacy_module.html">Porting a legacy module to the new interface</a></li></ol></li></ol></li><li class="chapter-item expanded "><a href="workers.html">Workers</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="synctl_workers.html">Using synctl with Workers</a></li><li class="chapter-item expanded "><a href="systemd-with-workers/index.html">Systemd</a></li></ol></li></ol></li><li class="chapter-item expanded "><a href="usage/administration/index.html">Administration</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="usage/administration/admin_api/index.html">Admin API</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="admin_api/account_validity.html">Account Validity</a></li><li class="chapter-item expanded "><a href="usage/administration/admin_api/background_updates.html">Background Updates</a></li><li class="chapter-item expanded "><a href="admin_api/event_reports.html">Event Reports</a></li><li class="chapter-item expanded "><a href="admin_api/media_admin_api.html">Media</a></li><li class="chapter-item expanded "><a href="admin_api/purge_history_api.html">Purge History</a></li><li class="chapter-item expanded "><a href="admin_api/register_api.html">Register Users</a></li><li class="chapter-item expanded "><a href="usage/administration/admin_api/registration_tokens.html">Registration Tokens</a></li><li class="chapter-item expanded "><a href="admin_api/room_membership.html">Manipulate Room Membership</a></li><li class="chapter-item expanded "><a href="admin_api/rooms.html">Rooms</a></li><li class="chapter-item expanded "><a href="admin_api/server_notices.html">Server Notices</a></li><li class="chapter-item expanded "><a href="admin_api/statistics.html">Statistics</a></li><li class="chapter-item expanded "><a href="admin_api/user_admin_api.html">Users</a></li><li class="chapter-item expanded "><a href="admin_api/version_api.html">Server Version</a></li><li class="chapter-item expanded "><a href="usage/administration/admin_api/federation.html">Federation</a></li></ol></li><li class="chapter-item expanded "><a href="manhole.html">Manhole</a></li><li class="chapter-item expanded "><a href="metrics-howto.html">Monitoring</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="usage/administration/monitoring/reporting_homeserver_usage_statistics.html">Reporting Homeserver Usage Statistics</a></li></ol></li><li class="chapter-item expanded "><a href="usage/administration/monthly_active_users.html">Monthly Active Users</a></li><li class="chapter-item expanded "><a href="usage/administration/understanding_synapse_through_grafana_graphs.html">Understanding Synapse Through Grafana Graphs</a></li><li class="chapter-item expanded "><a href="usage/administration/useful_sql_for_admins.html">Useful SQL for Admins</a></li><li class="chapter-item expanded "><a href="usage/administration/database_maintenance_tools.html">Database Maintenance Tools</a></li><li class="chapter-item expanded "><a href="usage/administration/state_groups.html">State Groups</a></li><li class="chapter-item expanded "><a href="usage/administration/request_log.html">Request log format</a></li><li class="chapter-item expanded "><a href="usage/administration/admin_faq.html">Admin FAQ</a></li><li class="chapter-item expanded "><div>Scripts</div></li></ol></li><li class="chapter-item expanded "><li class="part-title">Development</li><li class="chapter-item expanded "><a href="development/contributing_guide.html">Contributing Guide</a></li><li class="chapter-item expanded "><a href="code_style.html">Code Style</a></li><li class="chapter-item expanded "><a href="development/reviews.html">Reviewing Code</a></li><li class="chapter-item expanded "><a href="development/releases.html">Release Cycle</a></li><li class="chapter-item expanded "><a href="development/git.html">Git Usage</a></li><li class="chapter-item expanded "><div>Testing</div></li><li><ol class="section"><li class="chapter-item expanded "><a href="development/demo.html">Demo scripts</a></li></ol></li><li class="chapter-item expanded "><a href="opentracing.html">OpenTracing</a></li><li class="chapter-item expanded "><a href="development/database_schema.html">Database Schemas</a></li><li class="chapter-item expanded "><a href="development/experimental_features.html">Experimental features</a></li><li class="chapter-item expanded "><a href="development/dependencies.html">Dependency management</a></li><li class="chapter-item expanded "><div>Synapse Architecture</div></li><li><ol class="section"><li class="chapter-item expanded "><a href="development/synapse_architecture/cancellation.html">Cancellation</a></li><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><li class="chapter-item expanded "><a href="development/synapse_architecture/faster_joins.html">Faster remote joins</a></li></ol></li><li class="chapter-item expanded "><a href="development/internal_documentation/index.html">Internal Documentation</a></li><li><ol class="section"><li class="chapter-item expanded "><div>Single Sign-On</div></li><li><ol class="section"><li class="chapter-item expanded "><a href="development/saml.html">SAML</a></li><li class="chapter-item expanded "><a href="development/cas.html">CAS</a></li></ol></li><li class="chapter-item expanded "><a href="development/room-dag-concepts.html">Room DAG concepts</a></li><li class="chapter-item expanded "><div>State Resolution</div></li><li><ol class="section"><li class="chapter-item expanded "><a href="auth_chain_difference_algorithm.html">The Auth Chain Difference Algorithm</a></li></ol></li><li class="chapter-item expanded "><a href="media_repository.html">Media Repository</a></li><li class="chapter-item expanded "><a href="room_and_user_statistics.html">Room and User Statistics</a></li></ol></li><li class="chapter-item expanded "><div>Scripts</div></li><li class="chapter-item expanded affix "><li class="part-title">Other</li><li class="chapter-item expanded "><a href="deprecation_policy.html">Dependency Deprecation Policy</a></li><li class="chapter-item expanded "><a href="other/running_synapse_on_single_board_computers.html">Running Synapse on a Single-Board Computer</a></li></ol>
  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/upgrade.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="upgrading-synapse"><a class="header" href="#upgrading-synapse">Upgrading Synapse</a></h1>
  137. <p>Before upgrading check if any special steps are required to upgrade from
  138. the version you currently have installed to the current version of
  139. Synapse. The extra instructions that may be required are listed later in
  140. this document.</p>
  141. <ul>
  142. <li>
  143. <p>Check that your versions of Python and PostgreSQL are still
  144. supported.</p>
  145. <p>Synapse follows upstream lifecycles for <a href="https://endoflife.date/python">Python</a> and
  146. <a href="https://endoflife.date/postgresql">PostgreSQL</a>, and removes support for versions
  147. which are no longer maintained.</p>
  148. <p>The website <a href="https://endoflife.date">https://endoflife.date</a> also offers convenient
  149. summaries.</p>
  150. </li>
  151. <li>
  152. <p>If Synapse was installed using <a href="setup/installation.html#prebuilt-packages">prebuilt packages</a>,
  153. you will need to follow the normal process for upgrading those packages.</p>
  154. </li>
  155. <li>
  156. <p>If Synapse was installed using pip then upgrade to the latest
  157. version by running:</p>
  158. <pre><code class="language-bash">pip install --upgrade matrix-synapse
  159. </code></pre>
  160. </li>
  161. <li>
  162. <p>If Synapse was installed from source, then:</p>
  163. <ol>
  164. <li>
  165. <p>Obtain the latest version of the source code. Git users can run
  166. <code>git pull</code> to do this.</p>
  167. </li>
  168. <li>
  169. <p>If you're running Synapse in a virtualenv, make sure to activate it before
  170. upgrading. For example, if Synapse is installed in a virtualenv in <code>~/synapse/env</code> then
  171. run:</p>
  172. <pre><code class="language-bash">source ~/synapse/env/bin/activate
  173. pip install --upgrade .
  174. </code></pre>
  175. <p>Include any relevant extras between square brackets, e.g. <code>pip install --upgrade &quot;.[postgres,oidc]&quot;</code>.</p>
  176. </li>
  177. <li>
  178. <p>If you're using <code>poetry</code> to manage a Synapse installation, run:</p>
  179. <pre><code class="language-bash">poetry install
  180. </code></pre>
  181. <p>Include any relevant extras with <code>--extras</code>, e.g. <code>poetry install --extras postgres --extras oidc</code>.
  182. It's probably easiest to run <code>poetry install --extras all</code>.</p>
  183. </li>
  184. <li>
  185. <p>Restart Synapse:</p>
  186. <pre><code class="language-bash">synctl restart
  187. </code></pre>
  188. </li>
  189. </ol>
  190. </li>
  191. </ul>
  192. <p>To check whether your update was successful, you can check the running
  193. server version with:</p>
  194. <pre><code class="language-bash"># you may need to replace 'localhost:8008' if synapse is not configured
  195. # to listen on port 8008.
  196. curl http://localhost:8008/_synapse/admin/v1/server_version
  197. </code></pre>
  198. <h2 id="rolling-back-to-older-versions"><a class="header" href="#rolling-back-to-older-versions">Rolling back to older versions</a></h2>
  199. <p>Rolling back to previous releases can be difficult, due to database
  200. schema changes between releases. Where we have been able to test the
  201. rollback process, this will be noted below.</p>
  202. <p>In general, you will need to undo any changes made during the upgrade
  203. process, for example:</p>
  204. <ul>
  205. <li>
  206. <p>pip:</p>
  207. <pre><code class="language-bash">source env/bin/activate
  208. # replace `1.3.0` accordingly:
  209. pip install matrix-synapse==1.3.0
  210. </code></pre>
  211. </li>
  212. <li>
  213. <p>Debian:</p>
  214. <pre><code class="language-bash"># replace `1.3.0` and `stretch` accordingly:
  215. wget https://packages.matrix.org/debian/pool/main/m/matrix-synapse-py3/matrix-synapse-py3_1.3.0+stretch1_amd64.deb
  216. dpkg -i matrix-synapse-py3_1.3.0+stretch1_amd64.deb
  217. </code></pre>
  218. </li>
  219. </ul>
  220. <h1 id="upgrading-to-v1790"><a class="header" href="#upgrading-to-v1790">Upgrading to v1.79.0</a></h1>
  221. <h2 id="the-on_threepid_bind-module-callback-method-has-been-deprecated"><a class="header" href="#the-on_threepid_bind-module-callback-method-has-been-deprecated">The <code>on_threepid_bind</code> module callback method has been deprecated</a></h2>
  222. <p>Synapse v1.79.0 deprecates the
  223. <a href="modules/third_party_rules_callbacks.html#on_threepid_bind"><code>on_threepid_bind</code></a>
  224. &quot;third-party rules&quot; Synapse module callback method in favour of a new module method,
  225. <a href="modules/third_party_rules_callbacks.html#on_add_user_third_party_identifier"><code>on_add_user_third_party_identifier</code></a>.
  226. <code>on_threepid_bind</code> will be removed in a future version of Synapse. You should check whether any Synapse
  227. modules in use in your deployment are making use of <code>on_threepid_bind</code>, and update them where possible.</p>
  228. <p>The arguments and functionality of the new method are the same.</p>
  229. <p>The justification behind the name change is that the old method's name, <code>on_threepid_bind</code>, was
  230. misleading. A user is considered to &quot;bind&quot; their third-party ID to their Matrix ID only if they
  231. do so via an <a href="https://spec.matrix.org/latest/identity-service-api/">identity server</a>
  232. (so that users on other homeservers may find them). But this method was not called in that case -
  233. it was only called when a user added a third-party identifier on the local homeserver.</p>
  234. <p>Module developers may also be interested in the related
  235. <a href="modules/third_party_rules_callbacks.html#on_remove_user_third_party_identifier"><code>on_remove_user_third_party_identifier</code></a>
  236. module callback method that was also added in Synapse v1.79.0. This new method is called when a
  237. user removes a third-party identifier from their account.</p>
  238. <h1 id="upgrading-to-v1780"><a class="header" href="#upgrading-to-v1780">Upgrading to v1.78.0</a></h1>
  239. <h2 id="deprecate-the-_synapseadminv1mediaserver_namedelete-admin-api"><a class="header" href="#deprecate-the-_synapseadminv1mediaserver_namedelete-admin-api">Deprecate the <code>/_synapse/admin/v1/media/&lt;server_name&gt;/delete</code> admin API</a></h2>
  240. <p>Synapse 1.78.0 replaces the <code>/_synapse/admin/v1/media/&lt;server_name&gt;/delete</code>
  241. admin API with an identical endpoint at <code>/_synapse/admin/v1/media/delete</code>. Please
  242. update your tooling to use the new endpoint. The deprecated version will be removed
  243. in a future release.</p>
  244. <h1 id="upgrading-to-v1760"><a class="header" href="#upgrading-to-v1760">Upgrading to v1.76.0</a></h1>
  245. <h2 id="faster-joins-are-enabled-by-default"><a class="header" href="#faster-joins-are-enabled-by-default">Faster joins are enabled by default</a></h2>
  246. <p>When joining a room for the first time, Synapse 1.76.0 will request a partial join from the other server by default. Previously, server admins had to opt-in to this using an experimental config flag.</p>
  247. <p>Server admins can opt out of this feature for the time being by setting</p>
  248. <pre><code class="language-yaml">experimental:
  249. faster_joins: false
  250. </code></pre>
  251. <p>in their server config.</p>
  252. <h2 id="changes-to-the-account-data-replication-streams"><a class="header" href="#changes-to-the-account-data-replication-streams">Changes to the account data replication streams</a></h2>
  253. <p>Synapse has changed the format of the account data and devices replication
  254. streams (between workers). This is a forwards- and backwards-incompatible
  255. change: v1.75 workers cannot process account data replicated by v1.76 workers,
  256. and vice versa.</p>
  257. <p>Once all workers are upgraded to v1.76 (or downgraded to v1.75), account data
  258. and device replication will resume as normal.</p>
  259. <h2 id="minimum-version-of-poetry-is-now-132"><a class="header" href="#minimum-version-of-poetry-is-now-132">Minimum version of Poetry is now 1.3.2</a></h2>
  260. <p>The minimum supported version of Poetry is now 1.3.2 (previously 1.2.0, <a href="#upgrading-to-v1670">since
  261. Synapse 1.67</a>). If you have used <code>poetry install</code> to
  262. install Synapse from a source checkout, you should upgrade poetry: see its
  263. <a href="https://python-poetry.org/docs/#installation">installation instructions</a>.
  264. For all other installation methods, no acction is required.</p>
  265. <h1 id="upgrading-to-v1740"><a class="header" href="#upgrading-to-v1740">Upgrading to v1.74.0</a></h1>
  266. <h2 id="unicode-support-in-user-search"><a class="header" href="#unicode-support-in-user-search">Unicode support in user search</a></h2>
  267. <p>This version introduces optional support for an <a href="https://github.com/matrix-org/synapse/pull/14464">improved user search dealing with Unicode characters</a>.</p>
  268. <p>If you want to take advantage of this feature you need to install PyICU,
  269. the ICU native dependency and its development headers
  270. so that PyICU can build since no prebuilt wheels are available.</p>
  271. <p>You can follow <a href="https://pypi.org/project/PyICU/">the PyICU documentation</a> to do so,
  272. and then do <code>pip install matrix-synapse[user-search]</code> for a PyPI install.</p>
  273. <p>Docker images and Debian packages need nothing specific as they already
  274. include or specify ICU as an explicit dependency.</p>
  275. <h1 id="upgrading-to-v1730"><a class="header" href="#upgrading-to-v1730">Upgrading to v1.73.0</a></h1>
  276. <h2 id="legacy-prometheus-metric-names-have-now-been-removed"><a class="header" href="#legacy-prometheus-metric-names-have-now-been-removed">Legacy Prometheus metric names have now been removed</a></h2>
  277. <p>Synapse v1.69.0 included the deprecation of legacy Prometheus metric names
  278. and offered an option to disable them.
  279. Synapse v1.71.0 disabled legacy Prometheus metric names by default.</p>
  280. <p>This version, v1.73.0, removes those legacy Prometheus metric names entirely.
  281. This also means that the <code>enable_legacy_metrics</code> configuration option has been
  282. removed; it will no longer be possible to re-enable the legacy metric names.</p>
  283. <p>If you use metrics and have not yet updated your Grafana dashboard(s),
  284. Prometheus console(s) or alerting rule(s), please consider doing so when upgrading
  285. to this version.
  286. Note that the included Grafana dashboard was updated in v1.72.0 to correct some
  287. metric names which were missed when legacy metrics were disabled by default.</p>
  288. <p>See <a href="#deprecation-of-legacy-prometheus-metric-names">v1.69.0: Deprecation of legacy Prometheus metric names</a>
  289. for more context.</p>
  290. <h1 id="upgrading-to-v1720"><a class="header" href="#upgrading-to-v1720">Upgrading to v1.72.0</a></h1>
  291. <h2 id="dropping-support-for-postgresql-10"><a class="header" href="#dropping-support-for-postgresql-10">Dropping support for PostgreSQL 10</a></h2>
  292. <p>In line with our <a href="deprecation_policy.html">deprecation policy</a>, we've dropped
  293. support for PostgreSQL 10, as it is no longer supported upstream.</p>
  294. <p>This release of Synapse requires PostgreSQL 11+.</p>
  295. <h1 id="upgrading-to-v1710"><a class="header" href="#upgrading-to-v1710">Upgrading to v1.71.0</a></h1>
  296. <h2 id="removal-of-the-generate_short_term_login_token-module-api-method"><a class="header" href="#removal-of-the-generate_short_term_login_token-module-api-method">Removal of the <code>generate_short_term_login_token</code> module API method</a></h2>
  297. <p>As announced with the release of <a href="#deprecation-of-the-generate_short_term_login_token-module-api-method">Synapse 1.69.0</a>, the deprecated <code>generate_short_term_login_token</code> module method has been removed.</p>
  298. <p>Modules relying on it can instead use the <code>create_login_token</code> method.</p>
  299. <h2 id="changes-to-the-events-received-by-application-services-interest"><a class="header" href="#changes-to-the-events-received-by-application-services-interest">Changes to the events received by application services (interest)</a></h2>
  300. <p>To align with spec (changed in
  301. <a href="https://github.com/matrix-org/matrix-spec-proposals/pull/3905">MSC3905</a>), Synapse now
  302. only considers local users to be interesting. In other words, the <code>users</code> namespace
  303. regex is only be applied against local users of the homeserver.</p>
  304. <p>Please note, this probably doesn't affect the expected behavior of your application
  305. service, since an interesting local user in a room still means all messages in the room
  306. (from local or remote users) will still be considered interesting. And matching a room
  307. with the <code>rooms</code> or <code>aliases</code> namespace regex will still consider all events sent in the
  308. room to be interesting to the application service.</p>
  309. <p>If one of your application service's <code>users</code> regex was intending to match a remote user,
  310. this will no longer match as you expect. The behavioral mismatch between matching all
  311. local users and some remote users is why the spec was changed/clarified and this
  312. caveat is no longer supported.</p>
  313. <h2 id="legacy-prometheus-metric-names-are-now-disabled-by-default"><a class="header" href="#legacy-prometheus-metric-names-are-now-disabled-by-default">Legacy Prometheus metric names are now disabled by default</a></h2>
  314. <p>Synapse v1.71.0 disables legacy Prometheus metric names by default.
  315. For administrators that still rely on them and have not yet had chance to update their
  316. uses of the metrics, it's still possible to specify <code>enable_legacy_metrics: true</code> in
  317. the configuration to re-enable them temporarily.</p>
  318. <p>Synapse v1.73.0 will <strong>remove legacy metric names altogether</strong> and at that point,
  319. it will no longer be possible to re-enable them.</p>
  320. <p>If you do not use metrics or you have already updated your Grafana dashboard(s),
  321. Prometheus console(s) and alerting rule(s), there is no action needed.</p>
  322. <p>See <a href="#deprecation-of-legacy-prometheus-metric-names">v1.69.0: Deprecation of legacy Prometheus metric names</a>.</p>
  323. <h1 id="upgrading-to-v1690"><a class="header" href="#upgrading-to-v1690">Upgrading to v1.69.0</a></h1>
  324. <h2 id="changes-to-the-receipts-replication-streams"><a class="header" href="#changes-to-the-receipts-replication-streams">Changes to the receipts replication streams</a></h2>
  325. <p>Synapse now includes information indicating if a receipt applies to a thread when
  326. replicating it to other workers. This is a forwards- and backwards-incompatible
  327. change: v1.68 and workers cannot process receipts replicated by v1.69 workers, and
  328. vice versa.</p>
  329. <p>Once all workers are upgraded to v1.69 (or downgraded to v1.68), receipts
  330. replication will resume as normal.</p>
  331. <h2 id="deprecation-of-legacy-prometheus-metric-names"><a class="header" href="#deprecation-of-legacy-prometheus-metric-names">Deprecation of legacy Prometheus metric names</a></h2>
  332. <p>In current versions of Synapse, some Prometheus metrics are emitted under two different names,
  333. with one of the names being older but non-compliant with OpenMetrics and Prometheus conventions
  334. and one of the names being newer but compliant.</p>
  335. <p>Synapse v1.71.0 will turn the old metric names off <em>by default</em>.
  336. For administrators that still rely on them and have not had chance to update their
  337. uses of the metrics, it's possible to specify <code>enable_legacy_metrics: true</code> in
  338. the configuration to re-enable them temporarily.</p>
  339. <p>Synapse v1.73.0 will <strong>remove legacy metric names altogether</strong> and it will no longer
  340. be possible to re-enable them.</p>
  341. <p>The Grafana dashboard, Prometheus recording rules and Prometheus Consoles included
  342. in the <code>contrib</code> directory in the Synapse repository have been updated to no longer
  343. rely on the legacy names. These can be used on a current version of Synapse
  344. because current versions of Synapse emit both old and new names.</p>
  345. <p>You may need to update your alerting rules or any other rules that depend on
  346. the names of Prometheus metrics.
  347. If you want to test your changes before legacy names are disabled by default,
  348. you may specify <code>enable_legacy_metrics: false</code> in your homeserver configuration.</p>
  349. <p>A list of affected metrics is available on the <a href="https://matrix-org.github.io/synapse/v1.69/metrics-howto.html?highlight=metrics%20deprecated#renaming-of-metrics--deprecation-of-old-names-in-12">Metrics How-to page</a>.</p>
  350. <h2 id="deprecation-of-the-generate_short_term_login_token-module-api-method"><a class="header" href="#deprecation-of-the-generate_short_term_login_token-module-api-method">Deprecation of the <code>generate_short_term_login_token</code> module API method</a></h2>
  351. <p>The following method of the module API has been deprecated, and is scheduled to
  352. be remove in v1.71.0:</p>
  353. <pre><code class="language-python">def generate_short_term_login_token(
  354. self,
  355. user_id: str,
  356. duration_in_ms: int = (2 * 60 * 1000),
  357. auth_provider_id: str = &quot;&quot;,
  358. auth_provider_session_id: Optional[str] = None,
  359. ) -&gt; str:
  360. ...
  361. </code></pre>
  362. <p>It has been replaced by an asynchronous equivalent:</p>
  363. <pre><code class="language-python">async def create_login_token(
  364. self,
  365. user_id: str,
  366. duration_in_ms: int = (2 * 60 * 1000),
  367. auth_provider_id: Optional[str] = None,
  368. auth_provider_session_id: Optional[str] = None,
  369. ) -&gt; str:
  370. ...
  371. </code></pre>
  372. <p>Synapse will log a warning when a module uses the deprecated method, to help
  373. administrators find modules using it.</p>
  374. <h1 id="upgrading-to-v1680"><a class="header" href="#upgrading-to-v1680">Upgrading to v1.68.0</a></h1>
  375. <p>Two changes announced in the upgrade notes for v1.67.0 have now landed in v1.68.0.</p>
  376. <h2 id="sqlite-version-requirement"><a class="header" href="#sqlite-version-requirement">SQLite version requirement</a></h2>
  377. <p>Synapse now requires a SQLite version of 3.27.0 or higher if SQLite is configured as
  378. Synapse's database.</p>
  379. <p>Installations using</p>
  380. <ul>
  381. <li>Docker images <a href="https://hub.docker.com/r/matrixdotorg/synapse">from <code>matrixdotorg</code></a>,</li>
  382. <li>Debian packages <a href="https://packages.matrix.org/">from Matrix.org</a>, or</li>
  383. <li>a PostgreSQL database</li>
  384. </ul>
  385. <p>are not affected.</p>
  386. <h2 id="rust-requirement-when-building-from-source"><a class="header" href="#rust-requirement-when-building-from-source">Rust requirement when building from source.</a></h2>
  387. <p>Building from a source checkout of Synapse now requires a recent Rust compiler
  388. (currently Rust 1.58.1, but see also the
  389. <a href="https://matrix-org.github.io/synapse/latest/deprecation_policy.html">Platform Dependency Policy</a>).</p>
  390. <p>Installations using</p>
  391. <ul>
  392. <li>Docker images <a href="https://hub.docker.com/r/matrixdotorg/synapse">from <code>matrixdotorg</code></a>,</li>
  393. <li>Debian packages <a href="https://packages.matrix.org/">from Matrix.org</a>, or</li>
  394. <li>PyPI wheels via <code>pip install matrix-synapse</code> (on supported platforms and architectures)</li>
  395. </ul>
  396. <p>will not be affected.</p>
  397. <h1 id="upgrading-to-v1670"><a class="header" href="#upgrading-to-v1670">Upgrading to v1.67.0</a></h1>
  398. <h2 id="direct-tcp-replication-is-no-longer-supported-migrate-to-redis"><a class="header" href="#direct-tcp-replication-is-no-longer-supported-migrate-to-redis">Direct TCP replication is no longer supported: migrate to Redis</a></h2>
  399. <p>Redis support was added in v1.13.0 with it becoming the recommended method in
  400. v1.18.0. It replaced the old direct TCP connections (which was deprecated as of
  401. v1.18.0) to the main process. With Redis, rather than all the workers connecting
  402. to the main process, all the workers and the main process connect to Redis,
  403. which relays replication commands between processes. This can give a significant
  404. CPU saving on the main process and is a prerequisite for upcoming
  405. performance improvements.</p>
  406. <p>To migrate to Redis add the <a href="./workers.html#shared-configuration"><code>redis</code> config</a>,
  407. and remove the TCP <code>replication</code> listener from config of the master and
  408. <code>worker_replication_port</code> from worker config. Note that a HTTP listener with a
  409. <code>replication</code> resource is still required.</p>
  410. <h2 id="minimum-version-of-poetry-is-now-v120"><a class="header" href="#minimum-version-of-poetry-is-now-v120">Minimum version of Poetry is now v1.2.0</a></h2>
  411. <p>The minimum supported version of poetry is now 1.2. This should only affect
  412. those installing from a source checkout.</p>
  413. <h2 id="rust-requirement-in-the-next-release"><a class="header" href="#rust-requirement-in-the-next-release">Rust requirement in the next release</a></h2>
  414. <p>From the next major release (v1.68.0) installing Synapse from a source checkout
  415. will require a recent Rust compiler. Those using packages or
  416. <code>pip install matrix-synapse</code> will not be affected.</p>
  417. <p>The simplest way of installing Rust is via <a href="https://rustup.rs/">rustup.rs</a></p>
  418. <h2 id="sqlite-version-requirement-in-the-next-release"><a class="header" href="#sqlite-version-requirement-in-the-next-release">SQLite version requirement in the next release</a></h2>
  419. <p>From the next major release (v1.68.0) Synapse will require SQLite 3.27.0 or
  420. higher. Synapse v1.67.0 will be the last major release supporting SQLite
  421. versions 3.22 to 3.26.</p>
  422. <p>Those using Docker images or Debian packages from Matrix.org will not be
  423. affected. If you have installed from source, you should check the version of
  424. SQLite used by Python with:</p>
  425. <pre><code class="language-shell">python -c &quot;import sqlite3; print(sqlite3.sqlite_version)&quot;
  426. </code></pre>
  427. <p>If this is too old, refer to your distribution for advice on upgrading.</p>
  428. <h1 id="upgrading-to-v1660"><a class="header" href="#upgrading-to-v1660">Upgrading to v1.66.0</a></h1>
  429. <h2 id="delegation-of-email-validation-no-longer-supported"><a class="header" href="#delegation-of-email-validation-no-longer-supported">Delegation of email validation no longer supported</a></h2>
  430. <p>As of this version, Synapse no longer allows the tasks of verifying email address
  431. ownership, and password reset confirmation, to be delegated to an identity server.
  432. This removal was previously planned for Synapse 1.64.0, but was
  433. <a href="https://github.com/matrix-org/synapse/issues/13421">delayed</a> until now to give
  434. homeserver administrators more notice of the change.</p>
  435. <p>To continue to allow users to add email addresses to their homeserver accounts,
  436. and perform password resets, make sure that Synapse is configured with a working
  437. email server in the <a href="https://matrix-org.github.io/synapse/latest/usage/configuration/config_documentation.html#email"><code>email</code> configuration
  438. section</a>
  439. (including, at a minimum, a <code>notif_from</code> setting.)</p>
  440. <p>Specifying an <code>email</code> setting under <code>account_threepid_delegates</code> will now cause
  441. an error at startup.</p>
  442. <h1 id="upgrading-to-v1640"><a class="header" href="#upgrading-to-v1640">Upgrading to v1.64.0</a></h1>
  443. <h2 id="deprecation-of-the-ability-to-delegate-e-mail-verification-to-identity-servers"><a class="header" href="#deprecation-of-the-ability-to-delegate-e-mail-verification-to-identity-servers">Deprecation of the ability to delegate e-mail verification to identity servers</a></h2>
  444. <p>Synapse v1.66.0 will remove the ability to delegate the tasks of verifying email address ownership, and password reset confirmation, to an identity server.</p>
  445. <p>If you require your homeserver to verify e-mail addresses or to support password resets via e-mail, please configure your homeserver with SMTP access so that it can send e-mails on its own behalf.
  446. <a href="https://matrix-org.github.io/synapse/latest/usage/configuration/config_documentation.html#email">Consult the configuration documentation for more information.</a></p>
  447. <p>The option that will be removed is <code>account_threepid_delegates.email</code>.</p>
  448. <h2 id="changes-to-the-event-replication-streams"><a class="header" href="#changes-to-the-event-replication-streams">Changes to the event replication streams</a></h2>
  449. <p>Synapse now includes a flag indicating if an event is an outlier when
  450. replicating it to other workers. This is a forwards- and backwards-incompatible
  451. change: v1.63 and workers cannot process events replicated by v1.64 workers, and
  452. vice versa.</p>
  453. <p>Once all workers are upgraded to v1.64 (or downgraded to v1.63), event
  454. replication will resume as normal.</p>
  455. <h2 id="frozendict-release"><a class="header" href="#frozendict-release">frozendict release</a></h2>
  456. <p><a href="https://github.com/Marco-Sulla/python-frozendict/releases/tag/v2.3.3">frozendict 2.3.3</a>
  457. has recently been released, which fixes a memory leak that occurs during <code>/sync</code>
  458. requests. We advise server administrators who installed Synapse via pip to upgrade
  459. frozendict with <code>pip install --upgrade frozendict</code>. The Docker image
  460. <code>matrixdotorg/synapse</code> and the Debian packages from <code>packages.matrix.org</code> already
  461. include the updated library.</p>
  462. <h1 id="upgrading-to-v1620"><a class="header" href="#upgrading-to-v1620">Upgrading to v1.62.0</a></h1>
  463. <h2 id="new-signatures-for-spam-checker-callbacks"><a class="header" href="#new-signatures-for-spam-checker-callbacks">New signatures for spam checker callbacks</a></h2>
  464. <p>As a followup to changes in v1.60.0, the following spam-checker callbacks have changed signature:</p>
  465. <ul>
  466. <li><code>user_may_join_room</code></li>
  467. <li><code>user_may_invite</code></li>
  468. <li><code>user_may_send_3pid_invite</code></li>
  469. <li><code>user_may_create_room</code></li>
  470. <li><code>user_may_create_room_alias</code></li>
  471. <li><code>user_may_publish_room</code></li>
  472. <li><code>check_media_file_for_spam</code></li>
  473. </ul>
  474. <p>For each of these methods, the previous callback signature has been deprecated.</p>
  475. <p>Whereas callbacks used to return <code>bool</code>, they should now return <code>Union[&quot;synapse.module_api.NOT_SPAM&quot;, &quot;synapse.module_api.errors.Codes&quot;]</code>.</p>
  476. <p>For instance, if your module implements <code>user_may_join_room</code> as follows:</p>
  477. <pre><code class="language-python">async def user_may_join_room(self, user_id: str, room_id: str, is_invited: bool)
  478. if ...:
  479. # Request is spam
  480. return False
  481. # Request is not spam
  482. return True
  483. </code></pre>
  484. <p>you should rewrite it as follows:</p>
  485. <pre><code class="language-python">async def user_may_join_room(self, user_id: str, room_id: str, is_invited: bool)
  486. if ...:
  487. # Request is spam, mark it as forbidden (you may use some more precise error
  488. # code if it is useful).
  489. return synapse.module_api.errors.Codes.FORBIDDEN
  490. # Request is not spam, mark it as such.
  491. return synapse.module_api.NOT_SPAM
  492. </code></pre>
  493. <h1 id="upgrading-to-v1610"><a class="header" href="#upgrading-to-v1610">Upgrading to v1.61.0</a></h1>
  494. <h2 id="removal-of-deprecated-communitygroups"><a class="header" href="#removal-of-deprecated-communitygroups">Removal of deprecated community/groups</a></h2>
  495. <p>This release of Synapse will remove deprecated community/groups from codebase.</p>
  496. <h3 id="worker-endpoints"><a class="header" href="#worker-endpoints">Worker endpoints</a></h3>
  497. <p>For those who have deployed workers, following worker endpoints will no longer
  498. exist and they can be removed from the reverse proxy configuration:</p>
  499. <ul>
  500. <li><code>^/_matrix/federation/v1/get_groups_publicised$</code></li>
  501. <li><code>^/_matrix/client/(r0|v3|unstable)/joined_groups$</code></li>
  502. <li><code>^/_matrix/client/(r0|v3|unstable)/publicised_groups$</code></li>
  503. <li><code>^/_matrix/client/(r0|v3|unstable)/publicised_groups/</code></li>
  504. <li><code>^/_matrix/federation/v1/groups/</code></li>
  505. <li><code>^/_matrix/client/(r0|v3|unstable)/groups/</code></li>
  506. </ul>
  507. <h1 id="upgrading-to-v1600"><a class="header" href="#upgrading-to-v1600">Upgrading to v1.60.0</a></h1>
  508. <h2 id="adding-a-new-unique-index-to-state_group_edges-could-fail-if-your-database-is-corrupted"><a class="header" href="#adding-a-new-unique-index-to-state_group_edges-could-fail-if-your-database-is-corrupted">Adding a new unique index to <code>state_group_edges</code> could fail if your database is corrupted</a></h2>
  509. <p>This release of Synapse will add a unique index to the <code>state_group_edges</code> table, in order
  510. to prevent accidentally introducing duplicate information (for example, because a database
  511. backup was restored multiple times).</p>
  512. <p>Duplicate rows being present in this table could cause drastic performance problems; see
  513. <a href="https://github.com/matrix-org/synapse/issues/11779">issue 11779</a> for more details.</p>
  514. <p>If your Synapse database already has had duplicate rows introduced into this table,
  515. this could fail, with either of these errors:</p>
  516. <p><strong>On Postgres:</strong></p>
  517. <pre><code>synapse.storage.background_updates - 623 - INFO - background_updates-0 - Adding index state_group_edges_unique_idx to state_group_edges
  518. synapse.storage.background_updates - 282 - ERROR - background_updates-0 - Error doing update
  519. ...
  520. psycopg2.errors.UniqueViolation: could not create unique index &quot;state_group_edges_unique_idx&quot;
  521. DETAIL: Key (state_group, prev_state_group)=(2, 1) is duplicated.
  522. </code></pre>
  523. <p>(The numbers may be different.)</p>
  524. <p><strong>On SQLite:</strong></p>
  525. <pre><code>synapse.storage.background_updates - 623 - INFO - background_updates-0 - Adding index state_group_edges_unique_idx to state_group_edges
  526. synapse.storage.background_updates - 282 - ERROR - background_updates-0 - Error doing update
  527. ...
  528. sqlite3.IntegrityError: UNIQUE constraint failed: state_group_edges.state_group, state_group_edges.prev_state_group
  529. </code></pre>
  530. <details>
  531. <summary><b>Expand this section for steps to resolve this problem</b></summary>
  532. <h3 id="on-postgres"><a class="header" href="#on-postgres">On Postgres</a></h3>
  533. <p>Connect to your database with <code>psql</code>.</p>
  534. <pre><code class="language-sql">BEGIN;
  535. DELETE FROM state_group_edges WHERE (ctid, state_group, prev_state_group) IN (
  536. SELECT row_id, state_group, prev_state_group
  537. FROM (
  538. SELECT
  539. ctid AS row_id,
  540. MIN(ctid) OVER (PARTITION BY state_group, prev_state_group) AS min_row_id,
  541. state_group,
  542. prev_state_group
  543. FROM state_group_edges
  544. ) AS t1
  545. WHERE row_id &lt;&gt; min_row_id
  546. );
  547. COMMIT;
  548. </code></pre>
  549. <h3 id="on-sqlite"><a class="header" href="#on-sqlite">On SQLite</a></h3>
  550. <p>At the command-line, use <code>sqlite3 path/to/your-homeserver-database.db</code>:</p>
  551. <pre><code class="language-sql">BEGIN;
  552. DELETE FROM state_group_edges WHERE (rowid, state_group, prev_state_group) IN (
  553. SELECT row_id, state_group, prev_state_group
  554. FROM (
  555. SELECT
  556. rowid AS row_id,
  557. MIN(rowid) OVER (PARTITION BY state_group, prev_state_group) AS min_row_id,
  558. state_group,
  559. prev_state_group
  560. FROM state_group_edges
  561. )
  562. WHERE row_id &lt;&gt; min_row_id
  563. );
  564. COMMIT;
  565. </code></pre>
  566. <h3 id="for-more-details"><a class="header" href="#for-more-details">For more details</a></h3>
  567. <p><a href="https://github.com/matrix-org/synapse/issues/11779#issuecomment-1131545970">This comment on issue 11779</a>
  568. has queries that can be used to check a database for this problem in advance.</p>
  569. </details>
  570. <h2 id="new-signature-for-the-spam-checker-callback-check_event_for_spam"><a class="header" href="#new-signature-for-the-spam-checker-callback-check_event_for_spam">New signature for the spam checker callback <code>check_event_for_spam</code></a></h2>
  571. <p>The previous signature has been deprecated.</p>
  572. <p>Whereas <code>check_event_for_spam</code> callbacks used to return <code>Union[str, bool]</code>, they should now return <code>Union[&quot;synapse.module_api.NOT_SPAM&quot;, &quot;synapse.module_api.errors.Codes&quot;]</code>.</p>
  573. <p>This is part of an ongoing refactoring of the SpamChecker API to make it less ambiguous and more powerful.</p>
  574. <p>If your module implements <code>check_event_for_spam</code> as follows:</p>
  575. <pre><code class="language-python">async def check_event_for_spam(event):
  576. if ...:
  577. # Event is spam
  578. return True
  579. # Event is not spam
  580. return False
  581. </code></pre>
  582. <p>you should rewrite it as follows:</p>
  583. <pre><code class="language-python">async def check_event_for_spam(event):
  584. if ...:
  585. # Event is spam, mark it as forbidden (you may use some more precise error
  586. # code if it is useful).
  587. return synapse.module_api.errors.Codes.FORBIDDEN
  588. # Event is not spam, mark it as such.
  589. return synapse.module_api.NOT_SPAM
  590. </code></pre>
  591. <h1 id="upgrading-to-v1590"><a class="header" href="#upgrading-to-v1590">Upgrading to v1.59.0</a></h1>
  592. <h2 id="device-name-lookup-over-federation-has-been-disabled-by-default"><a class="header" href="#device-name-lookup-over-federation-has-been-disabled-by-default">Device name lookup over federation has been disabled by default</a></h2>
  593. <p>The names of user devices are no longer visible to users on other homeservers by default.
  594. Device IDs are unaffected, as these are necessary to facilitate end-to-end encryption.</p>
  595. <p>To re-enable this functionality, set the
  596. <a href="https://matrix-org.github.io/synapse/v1.59/usage/configuration/config_documentation.html#federation"><code>allow_device_name_lookup_over_federation</code></a>
  597. homeserver config option to <code>true</code>.</p>
  598. <h2 id="deprecation-of-the-synapseappappservice-and-synapseappuser_dir-worker-application-types"><a class="header" href="#deprecation-of-the-synapseappappservice-and-synapseappuser_dir-worker-application-types">Deprecation of the <code>synapse.app.appservice</code> and <code>synapse.app.user_dir</code> worker application types</a></h2>
  599. <p>The <code>synapse.app.appservice</code> worker application type allowed you to configure a
  600. single worker to use to notify application services of new events, as long
  601. as this functionality was disabled on the main process with <code>notify_appservices: False</code>.
  602. Further, the <code>synapse.app.user_dir</code> worker application type allowed you to configure
  603. a single worker to be responsible for updating the user directory, as long as this
  604. was disabled on the main process with <code>update_user_directory: False</code>.</p>
  605. <p>To unify Synapse's worker types, the <code>synapse.app.appservice</code> worker application
  606. type and the <code>notify_appservices</code> configuration option have been deprecated.
  607. The <code>synapse.app.user_dir</code> worker application type and <code>update_user_directory</code>
  608. configuration option have also been deprecated.</p>
  609. <p>To get the same functionality as was provided by the deprecated options, it's now recommended that the <code>synapse.app.generic_worker</code>
  610. worker application type is used and that the <code>notify_appservices_from_worker</code> and/or
  611. <code>update_user_directory_from_worker</code> options are set to the name of a worker.</p>
  612. <p>For the time being, the old options can be used alongside the new options to make
  613. it easier to transition between the two configurations, however please note that:</p>
  614. <ul>
  615. <li>the options must not contradict each other (otherwise Synapse won't start); and</li>
  616. <li>the <code>notify_appservices</code> and <code>update_user_directory</code> options will be removed in a future release of Synapse.</li>
  617. </ul>
  618. <p>Please see the <a href="workers.html#notifying-application-services"><em>Notifying Application Services</em></a> and
  619. <a href="workers.html#updating-the-user-directory"><em>Updating the User Directory</em></a> sections of the worker
  620. documentation for more information.</p>
  621. <h1 id="upgrading-to-v1580"><a class="header" href="#upgrading-to-v1580">Upgrading to v1.58.0</a></h1>
  622. <h2 id="groupscommunities-feature-has-been-disabled-by-default"><a class="header" href="#groupscommunities-feature-has-been-disabled-by-default">Groups/communities feature has been disabled by default</a></h2>
  623. <p>The non-standard groups/communities feature in Synapse has been disabled by default
  624. and will be removed in Synapse v1.61.0.</p>
  625. <h1 id="upgrading-to-v1570"><a class="header" href="#upgrading-to-v1570">Upgrading to v1.57.0</a></h1>
  626. <h2 id="changes-to-database-schema-for-application-services"><a class="header" href="#changes-to-database-schema-for-application-services">Changes to database schema for application services</a></h2>
  627. <p>Synapse v1.57.0 includes a <a href="https://github.com/matrix-org/synapse/pull/12209">change</a> to the
  628. way transaction IDs are managed for application services. If your deployment uses a dedicated
  629. worker for application service traffic, <strong>it must be stopped</strong> when the database is upgraded
  630. (which normally happens when the main process is upgraded), to ensure the change is made safely
  631. without any risk of reusing transaction IDs.</p>
  632. <p>Deployments which do not use separate worker processes can be upgraded as normal. Similarly,
  633. deployments where no application services are in use can be upgraded as normal.</p>
  634. <details>
  635. <summary><b>Recovering from an incorrect upgrade</b></summary>
  636. <p>If the database schema is upgraded <em>without</em> stopping the worker responsible
  637. for AS traffic, then the following error may be given when attempting to start
  638. a Synapse worker or master process:</p>
  639. <pre><code>**********************************************************************************
  640. Error during initialisation:
  641. Postgres sequence 'application_services_txn_id_seq' is inconsistent with associated
  642. table 'application_services_txns'. This can happen if Synapse has been downgraded and
  643. then upgraded again, or due to a bad migration.
  644. To fix this error, shut down Synapse (including any and all workers)
  645. and run the following SQL:
  646. SELECT setval('application_services_txn_id_seq', (
  647. SELECT GREATEST(MAX(txn_id), 0) FROM application_services_txns
  648. ));
  649. See docs/postgres.md for more information.
  650. There may be more information in the logs.
  651. **********************************************************************************
  652. </code></pre>
  653. <p>This error may also be seen if Synapse is <em>downgraded</em> to an earlier version,
  654. and then upgraded again to v1.57.0 or later.</p>
  655. <p>In either case:</p>
  656. <ol>
  657. <li>Ensure that the worker responsible for AS traffic is stopped.</li>
  658. <li>Run the SQL command given in the error message via <code>psql</code>.</li>
  659. </ol>
  660. <p>Synapse should then start correctly.</p>
  661. </details>
  662. <h1 id="upgrading-to-v1560"><a class="header" href="#upgrading-to-v1560">Upgrading to v1.56.0</a></h1>
  663. <h2 id="open-registration-without-verification-is-now-disabled-by-default"><a class="header" href="#open-registration-without-verification-is-now-disabled-by-default">Open registration without verification is now disabled by default</a></h2>
  664. <p>Synapse will refuse to start if registration is enabled without email, captcha, or token-based verification unless the new config
  665. flag <code>enable_registration_without_verification</code> is set to &quot;true&quot;.</p>
  666. <h2 id="groupscommunities-feature-has-been-deprecated"><a class="header" href="#groupscommunities-feature-has-been-deprecated">Groups/communities feature has been deprecated</a></h2>
  667. <p>The non-standard groups/communities feature in Synapse has been deprecated and will
  668. be disabled by default in Synapse v1.58.0.</p>
  669. <p>You can test disabling it by adding the following to your homeserver configuration:</p>
  670. <pre><code class="language-yaml">experimental_features:
  671. groups_enabled: false
  672. </code></pre>
  673. <h2 id="change-in-behaviour-for-postgresql-databases-with-unsafe-locale"><a class="header" href="#change-in-behaviour-for-postgresql-databases-with-unsafe-locale">Change in behaviour for PostgreSQL databases with unsafe locale</a></h2>
  674. <p>Synapse now refuses to start when using PostgreSQL with non-<code>C</code> values for <code>COLLATE</code> and
  675. <code>CTYPE</code> unless the config flag <code>allow_unsafe_locale</code>, found in the database section of
  676. the configuration file, is set to <code>true</code>. See the <a href="https://matrix-org.github.io/synapse/latest/postgres.html#fixing-incorrect-collate-or-ctype">PostgreSQL documentation</a>
  677. for more information and instructions on how to fix a database with incorrect values.</p>
  678. <h1 id="upgrading-to-v1550"><a class="header" href="#upgrading-to-v1550">Upgrading to v1.55.0</a></h1>
  679. <h2 id="synctl-script-has-been-moved"><a class="header" href="#synctl-script-has-been-moved"><code>synctl</code> script has been moved</a></h2>
  680. <p>The <code>synctl</code> script
  681. <a href="https://github.com/matrix-org/synapse/pull/12140">has been made</a> an
  682. <a href="https://packaging.python.org/en/latest/specifications/entry-points/">entry point</a>
  683. and no longer exists at the root of Synapse's source tree. If you wish to use
  684. <code>synctl</code> to manage your homeserver, you should invoke <code>synctl</code> directly, e.g.
  685. <code>synctl start</code> instead of <code>./synctl start</code> or <code>/path/to/synctl start</code>.</p>
  686. <p>You will need to ensure <code>synctl</code> is on your <code>PATH</code>.</p>
  687. <ul>
  688. <li>This is automatically the case when using
  689. <a href="https://packages.matrix.org/debian/">Debian packages</a> or
  690. <a href="https://hub.docker.com/r/matrixdotorg/synapse">docker images</a>
  691. provided by Matrix.org.</li>
  692. <li>When installing from a wheel, sdist, or PyPI, a <code>synctl</code> executable is added
  693. to your Python installation's <code>bin</code>. This should be on your <code>PATH</code>
  694. automatically, though you might need to activate a virtual environment
  695. depending on how you installed Synapse.</li>
  696. </ul>
  697. <h2 id="compatibility-dropped-for-mjolnir-131-and-earlier"><a class="header" href="#compatibility-dropped-for-mjolnir-131-and-earlier">Compatibility dropped for Mjolnir 1.3.1 and earlier</a></h2>
  698. <p>Synapse v1.55.0 drops support for Mjolnir 1.3.1 and earlier.
  699. If you use the Mjolnir module to moderate your homeserver,
  700. please upgrade Mjolnir to version 1.3.2 or later before upgrading Synapse.</p>
  701. <h1 id="upgrading-to-v1540"><a class="header" href="#upgrading-to-v1540">Upgrading to v1.54.0</a></h1>
  702. <h2 id="legacy-structured-logging-configuration-removal"><a class="header" href="#legacy-structured-logging-configuration-removal">Legacy structured logging configuration removal</a></h2>
  703. <p>This release removes support for the <code>structured: true</code> logging configuration
  704. which was deprecated in Synapse v1.23.0. If your logging configuration contains
  705. <code>structured: true</code> then it should be modified based on the
  706. <a href="https://matrix-org.github.io/synapse/v1.56/structured_logging.html#upgrading-from-legacy-structured-logging-configuration">structured logging documentation</a>.</p>
  707. <h1 id="upgrading-to-v1530"><a class="header" href="#upgrading-to-v1530">Upgrading to v1.53.0</a></h1>
  708. <h2 id="dropping-support-for-webclient-listeners-and-non-https-web_client_location"><a class="header" href="#dropping-support-for-webclient-listeners-and-non-https-web_client_location">Dropping support for <code>webclient</code> listeners and non-HTTP(S) <code>web_client_location</code></a></h2>
  709. <p>Per the deprecation notice in Synapse v1.51.0, listeners of type <code>webclient</code>
  710. are no longer supported and configuring them is a now a configuration error.</p>
  711. <p>Configuring a non-HTTP(S) <code>web_client_location</code> configuration is is now a
  712. configuration error. Since the <code>webclient</code> listener is no longer supported, this
  713. setting only applies to the root path <code>/</code> of Synapse's web server and no longer
  714. the <code>/_matrix/client/</code> path.</p>
  715. <h2 id="stablisation-of-msc3231"><a class="header" href="#stablisation-of-msc3231">Stablisation of MSC3231</a></h2>
  716. <p>The unstable validity-check endpoint for the
  717. <a href="https://spec.matrix.org/v1.2/client-server-api/#get_matrixclientv1registermloginregistration_tokenvalidity">Registration Tokens</a>
  718. feature has been stabilised and moved from:</p>
  719. <p><code>/_matrix/client/unstable/org.matrix.msc3231/register/org.matrix.msc3231.login.registration_token/validity</code></p>
  720. <p>to:</p>
  721. <p><code>/_matrix/client/v1/register/m.login.registration_token/validity</code></p>
  722. <p>Please update any relevant reverse proxy or firewall configurations appropriately.</p>
  723. <h2 id="time-based-cache-expiry-is-now-enabled-by-default"><a class="header" href="#time-based-cache-expiry-is-now-enabled-by-default">Time-based cache expiry is now enabled by default</a></h2>
  724. <p>Formerly, entries in the cache were not evicted regardless of whether they were accessed after storing.
  725. This behavior has now changed. By default entries in the cache are now evicted after 30m of not being accessed.
  726. To change the default behavior, go to the <code>caches</code> section of the config and change the <code>expire_caches</code> and
  727. <code>cache_entry_ttl</code> flags as necessary. Please note that these flags replace the <code>expiry_time</code> flag in the config.
  728. The <code>expiry_time</code> flag will still continue to work, but it has been deprecated and will be removed in the future.</p>
  729. <h2 id="deprecation-of-capability-orgmatrixmsc3283"><a class="header" href="#deprecation-of-capability-orgmatrixmsc3283">Deprecation of <code>capability</code> <code>org.matrix.msc3283.*</code></a></h2>
  730. <p>The <code>capabilities</code> of MSC3283 from the REST API <code>/_matrix/client/r0/capabilities</code>
  731. becomes stable.</p>
  732. <p>The old <code>capabilities</code></p>
  733. <ul>
  734. <li><code>org.matrix.msc3283.set_displayname</code>,</li>
  735. <li><code>org.matrix.msc3283.set_avatar_url</code> and</li>
  736. <li><code>org.matrix.msc3283.3pid_changes</code></li>
  737. </ul>
  738. <p>are deprecated and scheduled to be removed in Synapse v1.54.0.</p>
  739. <p>The new <code>capabilities</code></p>
  740. <ul>
  741. <li><code>m.set_displayname</code>,</li>
  742. <li><code>m.set_avatar_url</code> and</li>
  743. <li><code>m.3pid_changes</code></li>
  744. </ul>
  745. <p>are now active by default.</p>
  746. <h2 id="removal-of-user_may_create_room_with_invites"><a class="header" href="#removal-of-user_may_create_room_with_invites">Removal of <code>user_may_create_room_with_invites</code></a></h2>
  747. <p>As announced with the release of <a href="#deprecation-of-the-user_may_create_room_with_invites-module-callback">Synapse 1.47.0</a>,
  748. the deprecated <code>user_may_create_room_with_invites</code> module callback has been removed.</p>
  749. <p>Modules relying on it can instead implement <a href="https://matrix-org.github.io/synapse/latest/modules/spam_checker_callbacks.html#user_may_invite"><code>user_may_invite</code></a>
  750. and use the <a href="https://github.com/matrix-org/synapse/blob/872f23b95fa980a61b0866c1475e84491991fa20/synapse/module_api/__init__.py#L869-L876"><code>get_room_state</code></a>
  751. module API to infer whether the invite is happening while creating a room (see <a href="https://github.com/matrix-org/synapse-domain-rule-checker/blob/e7d092dd9f2a7f844928771dbfd9fd24c2332e48/synapse_domain_rule_checker/__init__.py#L56-L89">this function</a>
  752. as an example). Alternately, modules can also implement <a href="https://matrix-org.github.io/synapse/latest/modules/third_party_rules_callbacks.html#on_create_room"><code>on_create_room</code></a>.</p>
  753. <h1 id="upgrading-to-v1520"><a class="header" href="#upgrading-to-v1520">Upgrading to v1.52.0</a></h1>
  754. <h2 id="twisted-security-release"><a class="header" href="#twisted-security-release">Twisted security release</a></h2>
  755. <p>Note that <a href="https://github.com/twisted/twisted/releases/tag/twisted-22.1.0">Twisted 22.1.0</a>
  756. has recently been released, which fixes a <a href="https://github.com/twisted/twisted/security/advisories/GHSA-92x2-jw7w-xvvx">security issue</a>
  757. within the Twisted library. We do not believe Synapse is affected by this vulnerability,
  758. though we advise server administrators who installed Synapse via pip to upgrade Twisted
  759. with <code>pip install --upgrade Twisted treq</code> as a matter of good practice. The Docker image
  760. <code>matrixdotorg/synapse</code> and the Debian packages from <code>packages.matrix.org</code> are using the
  761. updated library.</p>
  762. <h1 id="upgrading-to-v1510"><a class="header" href="#upgrading-to-v1510">Upgrading to v1.51.0</a></h1>
  763. <h2 id="deprecation-of-webclient-listeners-and-non-https-web_client_location"><a class="header" href="#deprecation-of-webclient-listeners-and-non-https-web_client_location">Deprecation of <code>webclient</code> listeners and non-HTTP(S) <code>web_client_location</code></a></h2>
  764. <p>Listeners of type <code>webclient</code> are deprecated and scheduled to be removed in
  765. Synapse v1.53.0.</p>
  766. <p>Similarly, a non-HTTP(S) <code>web_client_location</code> configuration is deprecated and
  767. will become a configuration error in Synapse v1.53.0.</p>
  768. <h1 id="upgrading-to-v1500"><a class="header" href="#upgrading-to-v1500">Upgrading to v1.50.0</a></h1>
  769. <h2 id="dropping-support-for-old-python-and-postgres-versions"><a class="header" href="#dropping-support-for-old-python-and-postgres-versions">Dropping support for old Python and Postgres versions</a></h2>
  770. <p>In line with our <a href="deprecation_policy.html">deprecation policy</a>,
  771. we've dropped support for Python 3.6 and PostgreSQL 9.6, as they are no
  772. longer supported upstream.</p>
  773. <p>This release of Synapse requires Python 3.7+ and PostgreSQL 10+.</p>
  774. <h1 id="upgrading-to-v1470"><a class="header" href="#upgrading-to-v1470">Upgrading to v1.47.0</a></h1>
  775. <h2 id="removal-of-old-room-admin-api"><a class="header" href="#removal-of-old-room-admin-api">Removal of old Room Admin API</a></h2>
  776. <p>The following admin APIs were deprecated in <a href="https://github.com/matrix-org/synapse/blob/v1.34.0/CHANGES.md#deprecations-and-removals">Synapse 1.34</a>
  777. (released on 2021-05-17) and have now been removed:</p>
  778. <ul>
  779. <li><code>POST /_synapse/admin/v1/&lt;room_id&gt;/delete</code></li>
  780. </ul>
  781. <p>Any scripts still using the above APIs should be converted to use the
  782. <a href="https://matrix-org.github.io/synapse/latest/admin_api/rooms.html#delete-room-api">Delete Room API</a>.</p>
  783. <h2 id="deprecation-of-the-user_may_create_room_with_invites-module-callback"><a class="header" href="#deprecation-of-the-user_may_create_room_with_invites-module-callback">Deprecation of the <code>user_may_create_room_with_invites</code> module callback</a></h2>
  784. <p>The <code>user_may_create_room_with_invites</code> is deprecated and will be removed in a future
  785. version of Synapse. Modules implementing this callback can instead implement
  786. <a href="https://matrix-org.github.io/synapse/latest/modules/spam_checker_callbacks.html#user_may_invite"><code>user_may_invite</code></a>
  787. and use the <a href="https://github.com/matrix-org/synapse/blob/872f23b95fa980a61b0866c1475e84491991fa20/synapse/module_api/__init__.py#L869-L876"><code>get_room_state</code></a>
  788. module API method to infer whether the invite is happening in the context of creating a
  789. room.</p>
  790. <p>We plan to remove this callback in January 2022.</p>
  791. <h1 id="upgrading-to-v1450"><a class="header" href="#upgrading-to-v1450">Upgrading to v1.45.0</a></h1>
  792. <h2 id="changes-required-to-media-storage-provider-modules-when-reading-from-the-synapse-configuration-object"><a class="header" href="#changes-required-to-media-storage-provider-modules-when-reading-from-the-synapse-configuration-object">Changes required to media storage provider modules when reading from the Synapse configuration object</a></h2>
  793. <p>Media storage provider modules that read from the Synapse configuration object (i.e. that
  794. read the value of <code>hs.config.[...]</code>) now need to specify the configuration section they're
  795. reading from. This means that if a module reads the value of e.g. <code>hs.config.media_store_path</code>,
  796. it needs to replace it with <code>hs.config.media.media_store_path</code>.</p>
  797. <h1 id="upgrading-to-v1440"><a class="header" href="#upgrading-to-v1440">Upgrading to v1.44.0</a></h1>
  798. <h2 id="the-url-preview-cache-is-no-longer-mirrored-to-storage-providers"><a class="header" href="#the-url-preview-cache-is-no-longer-mirrored-to-storage-providers">The URL preview cache is no longer mirrored to storage providers</a></h2>
  799. <p>The <code>url_cache/</code> and <code>url_cache_thumbnails/</code> directories in the media store are
  800. no longer mirrored to storage providers. These two directories can be safely
  801. deleted from any configured storage providers to reclaim space.</p>
  802. <h1 id="upgrading-to-v1430"><a class="header" href="#upgrading-to-v1430">Upgrading to v1.43.0</a></h1>
  803. <h2 id="the-spaces-summary-apis-can-now-be-handled-by-workers"><a class="header" href="#the-spaces-summary-apis-can-now-be-handled-by-workers">The spaces summary APIs can now be handled by workers</a></h2>
  804. <p>The <a href="https://matrix-org.github.io/synapse/latest/workers.html#available-worker-applications">available worker applications documentation</a>
  805. has been updated to reflect that calls to the <code>/spaces</code>, <code>/hierarchy</code>, and
  806. <code>/summary</code> endpoints can now be routed to workers for both client API and
  807. federation requests.</p>
  808. <h1 id="upgrading-to-v1420"><a class="header" href="#upgrading-to-v1420">Upgrading to v1.42.0</a></h1>
  809. <h2 id="removal-of-old-room-admin-api-1"><a class="header" href="#removal-of-old-room-admin-api-1">Removal of old Room Admin API</a></h2>
  810. <p>The following admin APIs were deprecated in <a href="https://github.com/matrix-org/synapse/blob/v1.25.0/CHANGES.md#removal-warning">Synapse 1.25</a>
  811. (released on 2021-01-13) and have now been removed:</p>
  812. <ul>
  813. <li><code>POST /_synapse/admin/v1/purge_room</code></li>
  814. <li><code>POST /_synapse/admin/v1/shutdown_room/&lt;room_id&gt;</code></li>
  815. </ul>
  816. <p>Any scripts still using the above APIs should be converted to use the
  817. <a href="https://matrix-org.github.io/synapse/latest/admin_api/rooms.html#delete-room-api">Delete Room API</a>.</p>
  818. <h2 id="user-interactive-authentication-fallback-templates-can-now-display-errors"><a class="header" href="#user-interactive-authentication-fallback-templates-can-now-display-errors">User-interactive authentication fallback templates can now display errors</a></h2>
  819. <p>This may affect you if you make use of custom HTML templates for the
  820. <a href="https://github.com/matrix-org/synapse/tree/develop/synapse/res/templates/recaptcha.html">reCAPTCHA (<code>synapse/res/templates/recaptcha.html</code>)</a> or
  821. <a href="https://github.com/matrix-org/synapse/tree/develop/synapse/res/templates/terms.html">terms (<code>synapse/res/templates/terms.html</code>)</a> fallback pages.</p>
  822. <p>The template is now provided an <code>error</code> variable if the authentication
  823. process failed. See the default templates linked above for an example.</p>
  824. <h2 id="removal-of-out-of-date-email-pushers"><a class="header" href="#removal-of-out-of-date-email-pushers">Removal of out-of-date email pushers</a></h2>
  825. <p>Users will stop receiving message updates via email for addresses that were
  826. once, but not still, linked to their account.</p>
  827. <h1 id="upgrading-to-v1410"><a class="header" href="#upgrading-to-v1410">Upgrading to v1.41.0</a></h1>
  828. <h2 id="add-support-for-routing-outbound-http-requests-via-a-proxy-for-federation"><a class="header" href="#add-support-for-routing-outbound-http-requests-via-a-proxy-for-federation">Add support for routing outbound HTTP requests via a proxy for federation</a></h2>
  829. <p>Since Synapse 1.6.0 (2019-11-26) you can set a proxy for outbound HTTP requests via
  830. http_proxy/https_proxy environment variables. This proxy was set for:</p>
  831. <ul>
  832. <li>push</li>
  833. <li>url previews</li>
  834. <li>phone-home stats</li>
  835. <li>recaptcha validation</li>
  836. <li>CAS auth validation</li>
  837. <li>OpenID Connect</li>
  838. <li>Federation (checking public key revocation)</li>
  839. </ul>
  840. <p>In this version we have added support for outbound requests for:</p>
  841. <ul>
  842. <li>Outbound federation</li>
  843. <li>Downloading remote media</li>
  844. <li>Fetching public keys of other servers</li>
  845. </ul>
  846. <p>These requests use the same proxy configuration. If you have a proxy configuration we
  847. recommend to verify the configuration. It may be necessary to adjust the <code>no_proxy</code>
  848. environment variable.</p>
  849. <p>See <a href="setup/forward_proxy.html">using a forward proxy with Synapse documentation</a> for
  850. details.</p>
  851. <h2 id="deprecation-of-template_dir"><a class="header" href="#deprecation-of-template_dir">Deprecation of <code>template_dir</code></a></h2>
  852. <p>The <code>template_dir</code> settings in the <code>sso</code>, <code>account_validity</code> and <code>email</code> sections of the
  853. configuration file are now deprecated. Server admins should use the new
  854. <code>templates.custom_template_directory</code> setting in the configuration file and use one single
  855. custom template directory for all aforementioned features. Template file names remain
  856. unchanged. See <a href="https://matrix-org.github.io/synapse/latest/templates.html">the related documentation</a>
  857. for more information and examples.</p>
  858. <p>We plan to remove support for these settings in October 2021.</p>
  859. <h2 id="_synapseadminv1usersuseridmedia-must-be-handled-by-media-workers"><a class="header" href="#_synapseadminv1usersuseridmedia-must-be-handled-by-media-workers"><code>/_synapse/admin/v1/users/{userId}/media</code> must be handled by media workers</a></h2>
  860. <p>The <a href="https://matrix-org.github.io/synapse/latest/workers.html#synapseappmedia_repository">media repository worker documentation</a>
  861. has been updated to reflect that calls to <code>/_synapse/admin/v1/users/{userId}/media</code>
  862. must now be handled by media repository workers. This is due to the new <code>DELETE</code> method
  863. of this endpoint modifying the media store.</p>
  864. <h1 id="upgrading-to-v1390"><a class="header" href="#upgrading-to-v1390">Upgrading to v1.39.0</a></h1>
  865. <h2 id="deprecation-of-the-current-third-party-rules-module-interface"><a class="header" href="#deprecation-of-the-current-third-party-rules-module-interface">Deprecation of the current third-party rules module interface</a></h2>
  866. <p>The current third-party rules module interface is deprecated in favour of the new generic
  867. modules system introduced in Synapse v1.37.0. Authors of third-party rules modules can refer
  868. to <a href="modules/porting_legacy_module.html">this documentation</a>
  869. to update their modules. Synapse administrators can refer to <a href="modules/index.html">this documentation</a>
  870. to update their configuration once the modules they are using have been updated.</p>
  871. <p>We plan to remove support for the current third-party rules interface in September 2021.</p>
  872. <h1 id="upgrading-to-v1380"><a class="header" href="#upgrading-to-v1380">Upgrading to v1.38.0</a></h1>
  873. <h2 id="re-indexing-of-events-table-on-postgres-databases"><a class="header" href="#re-indexing-of-events-table-on-postgres-databases">Re-indexing of <code>events</code> table on Postgres databases</a></h2>
  874. <p>This release includes a database schema update which requires re-indexing one of
  875. the larger tables in the database, <code>events</code>. This could result in increased
  876. disk I/O for several hours or days after upgrading while the migration
  877. completes. Furthermore, because we have to keep the old indexes until the new
  878. indexes are ready, it could result in a significant, temporary, increase in
  879. disk space.</p>
  880. <p>To get a rough idea of the disk space required, check the current size of one
  881. of the indexes. For example, from a <code>psql</code> shell, run the following sql:</p>
  882. <pre><code class="language-sql">SELECT pg_size_pretty(pg_relation_size('events_order_room'));
  883. </code></pre>
  884. <p>We need to rebuild <strong>four</strong> indexes, so you will need to multiply this result
  885. by four to give an estimate of the disk space required. For example, on one
  886. particular server:</p>
  887. <pre><code>synapse=# select pg_size_pretty(pg_relation_size('events_order_room'));
  888. pg_size_pretty
  889. ----------------
  890. 288 MB
  891. (1 row)
  892. </code></pre>
  893. <p>On this server, it would be wise to ensure that at least 1152MB are free.</p>
  894. <p>The additional disk space will be freed once the migration completes.</p>
  895. <p>SQLite databases are unaffected by this change.</p>
  896. <h1 id="upgrading-to-v1370"><a class="header" href="#upgrading-to-v1370">Upgrading to v1.37.0</a></h1>
  897. <h2 id="deprecation-of-the-current-spam-checker-interface"><a class="header" href="#deprecation-of-the-current-spam-checker-interface">Deprecation of the current spam checker interface</a></h2>
  898. <p>The current spam checker interface is deprecated in favour of a new generic modules system.
  899. Authors of spam checker modules can refer to [this
  900. documentation](modules/porting_legacy_module.md
  901. to update their modules. Synapse administrators can refer to <a href="modules/index.html">this
  902. documentation</a>
  903. to update their configuration once the modules they are using have been updated.</p>
  904. <p>We plan to remove support for the current spam checker interface in August 2021.</p>
  905. <p>More module interfaces will be ported over to this new generic system in future versions
  906. of Synapse.</p>
  907. <h1 id="upgrading-to-v1340"><a class="header" href="#upgrading-to-v1340">Upgrading to v1.34.0</a></h1>
  908. <h2 id="room_invite_state_types-configuration-setting"><a class="header" href="#room_invite_state_types-configuration-setting"><code>room_invite_state_types</code> configuration setting</a></h2>
  909. <p>The <code>room_invite_state_types</code> configuration setting has been deprecated
  910. and replaced with <code>room_prejoin_state</code>. See the <a href="https://github.com/matrix-org/synapse/blob/v1.34.0/docs/sample_config.yaml#L1515">sample configuration
  911. file</a>.</p>
  912. <p>If you have set <code>room_invite_state_types</code> to the default value you
  913. should simply remove it from your configuration file. The default value
  914. used to be:</p>
  915. <pre><code class="language-yaml">room_invite_state_types:
  916. - &quot;m.room.join_rules&quot;
  917. - &quot;m.room.canonical_alias&quot;
  918. - &quot;m.room.avatar&quot;
  919. - &quot;m.room.encryption&quot;
  920. - &quot;m.room.name&quot;
  921. </code></pre>
  922. <p>If you have customised this value, you should remove
  923. <code>room_invite_state_types</code> and configure <code>room_prejoin_state</code> instead.</p>
  924. <h1 id="upgrading-to-v1330"><a class="header" href="#upgrading-to-v1330">Upgrading to v1.33.0</a></h1>
  925. <h2 id="account-validity-html-templates-can-now-display-a-users-expiration-date"><a class="header" href="#account-validity-html-templates-can-now-display-a-users-expiration-date">Account Validity HTML templates can now display a user's expiration date</a></h2>
  926. <p>This may affect you if you have enabled the account validity feature,
  927. and have made use of a custom HTML template specified by the
  928. <code>account_validity.template_dir</code> or
  929. <code>account_validity.account_renewed_html_path</code> Synapse config options.</p>
  930. <p>The template can now accept an <code>expiration_ts</code> variable, which
  931. represents the unix timestamp in milliseconds for the future date of
  932. which their account has been renewed until. See the <a href="https://github.com/matrix-org/synapse/blob/release-v1.33.0/synapse/res/templates/account_renewed.html">default
  933. template</a>
  934. for an example of usage.</p>
  935. <p>ALso note that a new HTML template, <code>account_previously_renewed.html</code>,
  936. has been added. This is is shown to users when they attempt to renew
  937. their account with a valid renewal token that has already been used
  938. before. The default template contents can been found
  939. <a href="https://github.com/matrix-org/synapse/blob/release-v1.33.0/synapse/res/templates/account_previously_renewed.html">here</a>,
  940. and can also accept an <code>expiration_ts</code> variable. This template replaces
  941. the error message users would previously see upon attempting to use a
  942. valid renewal token more than once.</p>
  943. <h1 id="upgrading-to-v1320"><a class="header" href="#upgrading-to-v1320">Upgrading to v1.32.0</a></h1>
  944. <h2 id="regression-causing-connected-prometheus-instances-to-become-overwhelmed"><a class="header" href="#regression-causing-connected-prometheus-instances-to-become-overwhelmed">Regression causing connected Prometheus instances to become overwhelmed</a></h2>
  945. <p>This release introduces <a href="https://github.com/matrix-org/synapse/issues/9853">a
  946. regression</a> that can
  947. overwhelm connected Prometheus instances. This issue is not present in
  948. Synapse v1.32.0rc1.</p>
  949. <p>If you have been affected, please downgrade to 1.31.0. You then may need
  950. to remove excess writeahead logs in order for Prometheus to recover.
  951. Instructions for doing so are provided
  952. <a href="https://github.com/matrix-org/synapse/pull/9854#issuecomment-823472183">here</a>.</p>
  953. <h2 id="dropping-support-for-old-python-postgres-and-sqlite-versions"><a class="header" href="#dropping-support-for-old-python-postgres-and-sqlite-versions">Dropping support for old Python, Postgres and SQLite versions</a></h2>
  954. <p>In line with our <a href="deprecation_policy.html">deprecation policy</a>,
  955. we've dropped support for Python 3.5 and PostgreSQL 9.5, as they are no
  956. longer supported upstream.</p>
  957. <p>This release of Synapse requires Python 3.6+ and PostgresSQL 9.6+ or
  958. SQLite 3.22+.</p>
  959. <h2 id="removal-of-old-list-accounts-admin-api"><a class="header" href="#removal-of-old-list-accounts-admin-api">Removal of old List Accounts Admin API</a></h2>
  960. <p>The deprecated v1 &quot;list accounts&quot; admin API
  961. (<code>GET /_synapse/admin/v1/users/&lt;user_id&gt;</code>) has been removed in this
  962. version.</p>
  963. <p>The <a href="admin_api/user_admin_api.html#list-accounts">v2 list accounts API</a>
  964. has been available since Synapse 1.7.0 (2019-12-13), and is accessible
  965. under <code>GET /_synapse/admin/v2/users</code>.</p>
  966. <p>The deprecation of the old endpoint was announced with Synapse 1.28.0
  967. (released on 2021-02-25).</p>
  968. <h2 id="application-services-must-use-type-mloginapplication_service-when-registering-users"><a class="header" href="#application-services-must-use-type-mloginapplication_service-when-registering-users">Application Services must use type <code>m.login.application_service</code> when registering users</a></h2>
  969. <p>In compliance with the <a href="https://matrix.org/docs/spec/application_service/r0.1.2#server-admin-style-permissions">Application Service
  970. spec</a>,
  971. Application Services are now required to use the
  972. <code>m.login.application_service</code> type when registering users via the
  973. <code>/_matrix/client/r0/register</code> endpoint. This behaviour was deprecated in
  974. Synapse v1.30.0.</p>
  975. <p>Please ensure your Application Services are up to date.</p>
  976. <h1 id="upgrading-to-v1290"><a class="header" href="#upgrading-to-v1290">Upgrading to v1.29.0</a></h1>
  977. <h2 id="requirement-for-x-forwarded-proto-header"><a class="header" href="#requirement-for-x-forwarded-proto-header">Requirement for X-Forwarded-Proto header</a></h2>
  978. <p>When using Synapse with a reverse proxy (in particular, when using the
  979. <code>x_forwarded</code> option on an HTTP listener), Synapse now
  980. expects to receive an <code>X-Forwarded-Proto</code> header on incoming
  981. HTTP requests. If it is not set, Synapse will log a warning on each
  982. received request.</p>
  983. <p>To avoid the warning, administrators using a reverse proxy should ensure
  984. that the reverse proxy sets <code>X-Forwarded-Proto</code> header to
  985. <code>https</code> or <code>http</code> to indicate the protocol used
  986. by the client.</p>
  987. <p>Synapse also requires the <code>Host</code> header to be preserved.</p>
  988. <p>See the <a href="reverse_proxy.html">reverse proxy documentation</a>, where the
  989. example configurations have been updated to show how to set these
  990. headers.</p>
  991. <p>(Users of <a href="https://caddyserver.com/">Caddy</a> are unaffected, since we
  992. believe it sets <code>X-Forwarded-Proto</code> by default.)</p>
  993. <h1 id="upgrading-to-v1270"><a class="header" href="#upgrading-to-v1270">Upgrading to v1.27.0</a></h1>
  994. <h2 id="changes-to-callback-uri-for-oauth2--openid-connect-and-saml2"><a class="header" href="#changes-to-callback-uri-for-oauth2--openid-connect-and-saml2">Changes to callback URI for OAuth2 / OpenID Connect and SAML2</a></h2>
  995. <p>This version changes the URI used for callbacks from OAuth2 and SAML2
  996. identity providers:</p>
  997. <ul>
  998. <li>
  999. <p>If your server is configured for single sign-on via an OpenID
  1000. Connect or OAuth2 identity provider, you will need to add
  1001. <code>[synapse public baseurl]/_synapse/client/oidc/callback</code> to the list
  1002. of permitted &quot;redirect URIs&quot; at the identity provider.</p>
  1003. <p>See the <a href="openid.html">OpenID docs</a> for more information on setting
  1004. up OpenID Connect.</p>
  1005. </li>
  1006. <li>
  1007. <p>If your server is configured for single sign-on via a SAML2 identity
  1008. provider, you will need to add
  1009. <code>[synapse public baseurl]/_synapse/client/saml2/authn_response</code> as a
  1010. permitted &quot;ACS location&quot; (also known as &quot;allowed callback URLs&quot;)
  1011. at the identity provider.</p>
  1012. <p>The &quot;Issuer&quot; in the &quot;AuthnRequest&quot; to the SAML2 identity
  1013. provider is also updated to
  1014. <code>[synapse public baseurl]/_synapse/client/saml2/metadata.xml</code>. If
  1015. your SAML2 identity provider uses this property to validate or
  1016. otherwise identify Synapse, its configuration will need to be
  1017. updated to use the new URL. Alternatively you could create a new,
  1018. separate &quot;EntityDescriptor&quot; in your SAML2 identity provider with
  1019. the new URLs and leave the URLs in the existing &quot;EntityDescriptor&quot;
  1020. as they were.</p>
  1021. </li>
  1022. </ul>
  1023. <h2 id="changes-to-html-templates"><a class="header" href="#changes-to-html-templates">Changes to HTML templates</a></h2>
  1024. <p>The HTML templates for SSO and email notifications now have <a href="https://jinja.palletsprojects.com/en/2.11.x/api/#autoescaping">Jinja2's
  1025. autoescape</a>
  1026. enabled for files ending in <code>.html</code>, <code>.htm</code>, and <code>.xml</code>. If you have
  1027. customised these templates and see issues when viewing them you might
  1028. need to update them. It is expected that most configurations will need
  1029. no changes.</p>
  1030. <p>If you have customised the templates <em>names</em> for these templates, it is
  1031. recommended to verify they end in <code>.html</code> to ensure autoescape is
  1032. enabled.</p>
  1033. <p>The above applies to the following templates:</p>
  1034. <ul>
  1035. <li><code>add_threepid.html</code></li>
  1036. <li><code>add_threepid_failure.html</code></li>
  1037. <li><code>add_threepid_success.html</code></li>
  1038. <li><code>notice_expiry.html</code></li>
  1039. <li><code>notice_expiry.html</code></li>
  1040. <li><code>notif_mail.html</code> (which, by default, includes <code>room.html</code> and
  1041. <code>notif.html</code>)</li>
  1042. <li><code>password_reset.html</code></li>
  1043. <li><code>password_reset_confirmation.html</code></li>
  1044. <li><code>password_reset_failure.html</code></li>
  1045. <li><code>password_reset_success.html</code></li>
  1046. <li><code>registration.html</code></li>
  1047. <li><code>registration_failure.html</code></li>
  1048. <li><code>registration_success.html</code></li>
  1049. <li><code>sso_account_deactivated.html</code></li>
  1050. <li><code>sso_auth_bad_user.html</code></li>
  1051. <li><code>sso_auth_confirm.html</code></li>
  1052. <li><code>sso_auth_success.html</code></li>
  1053. <li><code>sso_error.html</code></li>
  1054. <li><code>sso_login_idp_picker.html</code></li>
  1055. <li><code>sso_redirect_confirm.html</code></li>
  1056. </ul>
  1057. <h1 id="upgrading-to-v1260"><a class="header" href="#upgrading-to-v1260">Upgrading to v1.26.0</a></h1>
  1058. <h2 id="rolling-back-to-v1250-after-a-failed-upgrade"><a class="header" href="#rolling-back-to-v1250-after-a-failed-upgrade">Rolling back to v1.25.0 after a failed upgrade</a></h2>
  1059. <p>v1.26.0 includes a lot of large changes. If something problematic
  1060. occurs, you may want to roll-back to a previous version of Synapse.
  1061. Because v1.26.0 also includes a new database schema version, reverting
  1062. that version is also required alongside the generic rollback
  1063. instructions mentioned above. In short, to roll back to v1.25.0 you need
  1064. to:</p>
  1065. <ol>
  1066. <li>
  1067. <p>Stop the server</p>
  1068. </li>
  1069. <li>
  1070. <p>Decrease the schema version in the database:</p>
  1071. <pre><code class="language-sql">UPDATE schema_version SET version = 58;
  1072. </code></pre>
  1073. </li>
  1074. <li>
  1075. <p>Delete the ignored users &amp; chain cover data:</p>
  1076. <pre><code class="language-sql">DROP TABLE IF EXISTS ignored_users;
  1077. UPDATE rooms SET has_auth_chain_index = false;
  1078. </code></pre>
  1079. <p>For PostgreSQL run:</p>
  1080. <pre><code class="language-sql">TRUNCATE event_auth_chain_links;
  1081. TRUNCATE event_auth_chains;
  1082. </code></pre>
  1083. <p>For SQLite run:</p>
  1084. <pre><code class="language-sql">DELETE FROM event_auth_chain_links;
  1085. DELETE FROM event_auth_chains;
  1086. </code></pre>
  1087. </li>
  1088. <li>
  1089. <p>Mark the deltas as not run (so they will re-run on upgrade).</p>
  1090. <pre><code class="language-sql">DELETE FROM applied_schema_deltas WHERE version = 59 AND file = &quot;59/01ignored_user.py&quot;;
  1091. DELETE FROM applied_schema_deltas WHERE version = 59 AND file = &quot;59/06chain_cover_index.sql&quot;;
  1092. </code></pre>
  1093. </li>
  1094. <li>
  1095. <p>Downgrade Synapse by following the instructions for your
  1096. installation method in the &quot;Rolling back to older versions&quot;
  1097. section above.</p>
  1098. </li>
  1099. </ol>
  1100. <h1 id="upgrading-to-v1250"><a class="header" href="#upgrading-to-v1250">Upgrading to v1.25.0</a></h1>
  1101. <h2 id="last-release-supporting-python-35"><a class="header" href="#last-release-supporting-python-35">Last release supporting Python 3.5</a></h2>
  1102. <p>This is the last release of Synapse which guarantees support with Python
  1103. 3.5, which passed its upstream End of Life date several months ago.</p>
  1104. <p>We will attempt to maintain support through March 2021, but without
  1105. guarantees.</p>
  1106. <p>In the future, Synapse will follow upstream schedules for ending support
  1107. of older versions of Python and PostgreSQL. Please upgrade to at least
  1108. Python 3.6 and PostgreSQL 9.6 as soon as possible.</p>
  1109. <h2 id="blacklisting-ip-ranges"><a class="header" href="#blacklisting-ip-ranges">Blacklisting IP ranges</a></h2>
  1110. <p>Synapse v1.25.0 includes new settings, <code>ip_range_blacklist</code> and
  1111. <code>ip_range_whitelist</code>, for controlling outgoing requests from Synapse for
  1112. federation, identity servers, push, and for checking key validity for
  1113. third-party invite events. The previous setting,
  1114. <code>federation_ip_range_blacklist</code>, is deprecated. The new
  1115. <code>ip_range_blacklist</code> defaults to private IP ranges if it is not defined.</p>
  1116. <p>If you have never customised <code>federation_ip_range_blacklist</code> it is
  1117. recommended that you remove that setting.</p>
  1118. <p>If you have customised <code>federation_ip_range_blacklist</code> you should update
  1119. the setting name to <code>ip_range_blacklist</code>.</p>
  1120. <p>If you have a custom push server that is reached via private IP space
  1121. you may need to customise <code>ip_range_blacklist</code> or <code>ip_range_whitelist</code>.</p>
  1122. <h1 id="upgrading-to-v1240"><a class="header" href="#upgrading-to-v1240">Upgrading to v1.24.0</a></h1>
  1123. <h2 id="custom-openid-connect-mapping-provider-breaking-change"><a class="header" href="#custom-openid-connect-mapping-provider-breaking-change">Custom OpenID Connect mapping provider breaking change</a></h2>
  1124. <p>This release allows the OpenID Connect mapping provider to perform
  1125. normalisation of the localpart of the Matrix ID. This allows for the
  1126. mapping provider to specify different algorithms, instead of the
  1127. <a href="https://matrix.org/docs/spec/appendices#mapping-from-other-character-sets">default
  1128. way</a>.</p>
  1129. <p>If your Synapse configuration uses a custom mapping provider
  1130. (<code>oidc_config.user_mapping_provider.module</code> is specified and
  1131. not equal to
  1132. <code>synapse.handlers.oidc_handler.JinjaOidcMappingProvider</code>)
  1133. then you <em>must</em> ensure that <code>map_user_attributes</code> of the
  1134. mapping provider performs some normalisation of the
  1135. <code>localpart</code> returned. To match previous behaviour you can
  1136. use the <code>map_username_to_mxid_localpart</code> function provided
  1137. by Synapse. An example is shown below:</p>
  1138. <pre><code class="language-python">from synapse.types import map_username_to_mxid_localpart
  1139. class MyMappingProvider:
  1140. def map_user_attributes(self, userinfo, token):
  1141. # ... your custom logic ...
  1142. sso_user_id = ...
  1143. localpart = map_username_to_mxid_localpart(sso_user_id)
  1144. return {&quot;localpart&quot;: localpart}
  1145. </code></pre>
  1146. <h2 id="removal-historical-synapse-admin-api"><a class="header" href="#removal-historical-synapse-admin-api">Removal historical Synapse Admin API</a></h2>
  1147. <p>Historically, the Synapse Admin API has been accessible under:</p>
  1148. <ul>
  1149. <li><code>/_matrix/client/api/v1/admin</code></li>
  1150. <li><code>/_matrix/client/unstable/admin</code></li>
  1151. <li><code>/_matrix/client/r0/admin</code></li>
  1152. <li><code>/_synapse/admin/v1</code></li>
  1153. </ul>
  1154. <p>The endpoints with <code>/_matrix/client/*</code> prefixes have been removed as of
  1155. v1.24.0. The Admin API is now only accessible under:</p>
  1156. <ul>
  1157. <li><code>/_synapse/admin/v1</code></li>
  1158. </ul>
  1159. <p>The only exception is the <code>/admin/whois</code> endpoint, which is
  1160. <a href="https://matrix.org/docs/spec/client_server/r0.6.1#get-matrix-client-r0-admin-whois-userid">also available via the client-server
  1161. API</a>.</p>
  1162. <p>The deprecation of the old endpoints was announced with Synapse 1.20.0
  1163. (released on 2020-09-22) and makes it easier for homeserver admins to
  1164. lock down external access to the Admin API endpoints.</p>
  1165. <h1 id="upgrading-to-v1230"><a class="header" href="#upgrading-to-v1230">Upgrading to v1.23.0</a></h1>
  1166. <h2 id="structured-logging-configuration-breaking-changes"><a class="header" href="#structured-logging-configuration-breaking-changes">Structured logging configuration breaking changes</a></h2>
  1167. <p>This release deprecates use of the <code>structured: true</code> logging
  1168. configuration for structured logging. If your logging configuration
  1169. contains <code>structured: true</code> then it should be modified based on the
  1170. <a href="https://matrix-org.github.io/synapse/v1.56/structured_logging.html#upgrading-from-legacy-structured-logging-configuration">structured logging documentation</a>.</p>
  1171. <p>The <code>structured</code> and <code>drains</code> logging options are now deprecated and
  1172. should be replaced by standard logging configuration of <code>handlers</code> and
  1173. <code>formatters</code>.</p>
  1174. <p>A future will release of Synapse will make using <code>structured: true</code> an
  1175. error.</p>
  1176. <h1 id="upgrading-to-v1220"><a class="header" href="#upgrading-to-v1220">Upgrading to v1.22.0</a></h1>
  1177. <h2 id="thirdpartyeventrules-breaking-changes"><a class="header" href="#thirdpartyeventrules-breaking-changes">ThirdPartyEventRules breaking changes</a></h2>
  1178. <p>This release introduces a backwards-incompatible change to modules
  1179. making use of <code>ThirdPartyEventRules</code> in Synapse. If you make use of a
  1180. module defined under the <code>third_party_event_rules</code> config option, please
  1181. make sure it is updated to handle the below change:</p>
  1182. <p>The <code>http_client</code> argument is no longer passed to modules as they are
  1183. initialised. Instead, modules are expected to make use of the
  1184. <code>http_client</code> property on the <code>ModuleApi</code> class. Modules are now passed
  1185. a <code>module_api</code> argument during initialisation, which is an instance of
  1186. <code>ModuleApi</code>. <code>ModuleApi</code> instances have a <code>http_client</code> property which
  1187. acts the same as the <code>http_client</code> argument previously passed to
  1188. <code>ThirdPartyEventRules</code> modules.</p>
  1189. <h1 id="upgrading-to-v1210"><a class="header" href="#upgrading-to-v1210">Upgrading to v1.21.0</a></h1>
  1190. <h2 id="forwarding-_synapseclient-through-your-reverse-proxy"><a class="header" href="#forwarding-_synapseclient-through-your-reverse-proxy">Forwarding <code>/_synapse/client</code> through your reverse proxy</a></h2>
  1191. <p>The <a href="reverse_proxy.html">reverse proxy documentation</a>
  1192. has been updated to include reverse proxy directives for
  1193. <code>/_synapse/client/*</code> endpoints. As the user password reset flow now uses
  1194. endpoints under this prefix, <strong>you must update your reverse proxy
  1195. configurations for user password reset to work</strong>.</p>
  1196. <p>Additionally, note that the <a href="workers.html">Synapse worker documentation</a> has been updated to</p>
  1197. <p>: state that the <code>/_synapse/client/password_reset/email/submit_token</code>
  1198. endpoint can be handled</p>
  1199. <p>by all workers. If you make use of Synapse's worker feature, please
  1200. update your reverse proxy configuration to reflect this change.</p>
  1201. <h2 id="new-html-templates"><a class="header" href="#new-html-templates">New HTML templates</a></h2>
  1202. <p>A new HTML template,
  1203. <a href="https://github.com/matrix-org/synapse/blob/develop/synapse/res/templates/password_reset_confirmation.html">password_reset_confirmation.html</a>,
  1204. has been added to the <code>synapse/res/templates</code> directory. If you are
  1205. using a custom template directory, you may want to copy the template
  1206. over and modify it.</p>
  1207. <p>Note that as of v1.20.0, templates do not need to be included in custom
  1208. template directories for Synapse to start. The default templates will be
  1209. used if a custom template cannot be found.</p>
  1210. <p>This page will appear to the user after clicking a password reset link
  1211. that has been emailed to them.</p>
  1212. <p>To complete password reset, the page must include a way to make a
  1213. <code>POST</code> request to
  1214. <code>/_synapse/client/password_reset/{medium}/submit_token</code> with the query
  1215. parameters from the original link, presented as a URL-encoded form. See
  1216. the file itself for more details.</p>
  1217. <h2 id="updated-single-sign-on-html-templates"><a class="header" href="#updated-single-sign-on-html-templates">Updated Single Sign-on HTML Templates</a></h2>
  1218. <p>The <code>saml_error.html</code> template was removed from Synapse and replaced
  1219. with the <code>sso_error.html</code> template. If your Synapse is configured to use
  1220. SAML and a custom <code>sso_redirect_confirm_template_dir</code> configuration then
  1221. any customisations of the <code>saml_error.html</code> template will need to be
  1222. merged into the <code>sso_error.html</code> template. These templates are similar,
  1223. but the parameters are slightly different:</p>
  1224. <ul>
  1225. <li>The <code>msg</code> parameter should be renamed to <code>error_description</code>.</li>
  1226. <li>There is no longer a <code>code</code> parameter for the response code.</li>
  1227. <li>A string <code>error</code> parameter is available that includes a short hint
  1228. of why a user is seeing the error page.</li>
  1229. </ul>
  1230. <h1 id="upgrading-to-v1180"><a class="header" href="#upgrading-to-v1180">Upgrading to v1.18.0</a></h1>
  1231. <h2 id="docker--py3-suffix-will-be-removed-in-future-versions"><a class="header" href="#docker--py3-suffix-will-be-removed-in-future-versions">Docker <code>-py3</code> suffix will be removed in future versions</a></h2>
  1232. <p>From 10th August 2020, we will no longer publish Docker images with the
  1233. <code>-py3</code> tag suffix. The images tagged with the
  1234. <code>-py3</code> suffix have been identical to the non-suffixed tags
  1235. since release 0.99.0, and the suffix is obsolete.</p>
  1236. <p>On 10th August, we will remove the <code>latest-py3</code> tag.
  1237. Existing per-release tags (such as <code>v1.18.0-py3</code> will not
  1238. be removed, but no new <code>-py3</code> tags will be added.</p>
  1239. <p>Scripts relying on the <code>-py3</code> suffix will need to be
  1240. updated.</p>
  1241. <h2 id="redis-replication-is-now-recommended-in-lieu-of-tcp-replication"><a class="header" href="#redis-replication-is-now-recommended-in-lieu-of-tcp-replication">Redis replication is now recommended in lieu of TCP replication</a></h2>
  1242. <p>When setting up worker processes, we now recommend the use of a Redis
  1243. server for replication. <strong>The old direct TCP connection method is
  1244. deprecated and will be removed in a future release.</strong> See
  1245. the <a href="https://matrix-org.github.io/synapse/v1.66/workers.html">worker documentation</a> for more details.</p>
  1246. <h1 id="upgrading-to-v1140"><a class="header" href="#upgrading-to-v1140">Upgrading to v1.14.0</a></h1>
  1247. <p>This version includes a database update which is run as part of the
  1248. upgrade, and which may take a couple of minutes in the case of a large
  1249. server. Synapse will not respond to HTTP requests while this update is
  1250. taking place.</p>
  1251. <h1 id="upgrading-to-v1130"><a class="header" href="#upgrading-to-v1130">Upgrading to v1.13.0</a></h1>
  1252. <h2 id="incorrect-database-migration-in-old-synapse-versions"><a class="header" href="#incorrect-database-migration-in-old-synapse-versions">Incorrect database migration in old synapse versions</a></h2>
  1253. <p>A bug was introduced in Synapse 1.4.0 which could cause the room
  1254. directory to be incomplete or empty if Synapse was upgraded directly
  1255. from v1.2.1 or earlier, to versions between v1.4.0 and v1.12.x.</p>
  1256. <p>This will <em>not</em> be a problem for Synapse installations which were:</p>
  1257. <p>: - created at v1.4.0 or later,
  1258. - upgraded via v1.3.x, or
  1259. - upgraded straight from v1.2.1 or earlier to v1.13.0 or later.</p>
  1260. <p>If completeness of the room directory is a concern, installations which
  1261. are affected can be repaired as follows:</p>
  1262. <ol>
  1263. <li>
  1264. <p>Run the following sql from a <code>psql</code> or
  1265. <code>sqlite3</code> console:</p>
  1266. <pre><code class="language-sql">INSERT INTO background_updates (update_name, progress_json, depends_on) VALUES
  1267. ('populate_stats_process_rooms', '{}', 'current_state_events_membership');
  1268. INSERT INTO background_updates (update_name, progress_json, depends_on) VALUES
  1269. ('populate_stats_process_users', '{}', 'populate_stats_process_rooms');
  1270. </code></pre>
  1271. </li>
  1272. <li>
  1273. <p>Restart synapse.</p>
  1274. </li>
  1275. </ol>
  1276. <h2 id="new-single-sign-on-html-templates"><a class="header" href="#new-single-sign-on-html-templates">New Single Sign-on HTML Templates</a></h2>
  1277. <p>New templates (<code>sso_auth_confirm.html</code>, <code>sso_auth_success.html</code>, and
  1278. <code>sso_account_deactivated.html</code>) were added to Synapse. If your Synapse
  1279. is configured to use SSO and a custom
  1280. <code>sso_redirect_confirm_template_dir</code> configuration then these templates
  1281. will need to be copied from
  1282. <a href="https://github.com/matrix-org/synapse/tree/develop/synapse/res/templates"><code>synapse/res/templates</code></a> into that directory.</p>
  1283. <h2 id="synapse-sso-plugins-method-deprecation"><a class="header" href="#synapse-sso-plugins-method-deprecation">Synapse SSO Plugins Method Deprecation</a></h2>
  1284. <p>Plugins using the <code>complete_sso_login</code> method of
  1285. <code>synapse.module_api.ModuleApi</code> should update to using the async/await
  1286. version <code>complete_sso_login_async</code> which includes additional checks. The
  1287. non-async version is considered deprecated.</p>
  1288. <h2 id="rolling-back-to-v1124-after-a-failed-upgrade"><a class="header" href="#rolling-back-to-v1124-after-a-failed-upgrade">Rolling back to v1.12.4 after a failed upgrade</a></h2>
  1289. <p>v1.13.0 includes a lot of large changes. If something problematic
  1290. occurs, you may want to roll-back to a previous version of Synapse.
  1291. Because v1.13.0 also includes a new database schema version, reverting
  1292. that version is also required alongside the generic rollback
  1293. instructions mentioned above. In short, to roll back to v1.12.4 you need
  1294. to:</p>
  1295. <ol>
  1296. <li>
  1297. <p>Stop the server</p>
  1298. </li>
  1299. <li>
  1300. <p>Decrease the schema version in the database:</p>
  1301. <pre><code class="language-sql">UPDATE schema_version SET version = 57;
  1302. </code></pre>
  1303. </li>
  1304. <li>
  1305. <p>Downgrade Synapse by following the instructions for your
  1306. installation method in the &quot;Rolling back to older versions&quot;
  1307. section above.</p>
  1308. </li>
  1309. </ol>
  1310. <h1 id="upgrading-to-v1120"><a class="header" href="#upgrading-to-v1120">Upgrading to v1.12.0</a></h1>
  1311. <p>This version includes a database update which is run as part of the
  1312. upgrade, and which may take some time (several hours in the case of a
  1313. large server). Synapse will not respond to HTTP requests while this
  1314. update is taking place.</p>
  1315. <p>This is only likely to be a problem in the case of a server which is
  1316. participating in many rooms.</p>
  1317. <ol start="0">
  1318. <li>
  1319. <p>As with all upgrades, it is recommended that you have a recent
  1320. backup of your database which can be used for recovery in the event
  1321. of any problems.</p>
  1322. </li>
  1323. <li>
  1324. <p>As an initial check to see if you will be affected, you can try
  1325. running the following query from the <code>psql</code> or
  1326. <code>sqlite3</code> console. It is safe to run it while Synapse is
  1327. still running.</p>
  1328. <pre><code class="language-sql">SELECT MAX(q.v) FROM (
  1329. SELECT (
  1330. SELECT ej.json AS v
  1331. FROM state_events se INNER JOIN event_json ej USING (event_id)
  1332. WHERE se.room_id=rooms.room_id AND se.type='m.room.create' AND se.state_key=''
  1333. LIMIT 1
  1334. ) FROM rooms WHERE rooms.room_version IS NULL
  1335. ) q;
  1336. </code></pre>
  1337. <p>This query will take about the same amount of time as the upgrade
  1338. process: ie, if it takes 5 minutes, then it is likely that Synapse
  1339. will be unresponsive for 5 minutes during the upgrade.</p>
  1340. <p>If you consider an outage of this duration to be acceptable, no
  1341. further action is necessary and you can simply start Synapse 1.12.0.</p>
  1342. <p>If you would prefer to reduce the downtime, continue with the steps
  1343. below.</p>
  1344. </li>
  1345. <li>
  1346. <p>The easiest workaround for this issue is to manually create a new
  1347. index before upgrading. On PostgreSQL, his can be done as follows:</p>
  1348. <pre><code class="language-sql">CREATE INDEX CONCURRENTLY tmp_upgrade_1_12_0_index
  1349. ON state_events(room_id) WHERE type = 'm.room.create';
  1350. </code></pre>
  1351. <p>The above query may take some time, but is also safe to run while
  1352. Synapse is running.</p>
  1353. <p>We assume that no SQLite users have databases large enough to be
  1354. affected. If you <em>are</em> affected, you can run a similar query,
  1355. omitting the <code>CONCURRENTLY</code> keyword. Note however that this
  1356. operation may in itself cause Synapse to stop running for some time.
  1357. Synapse admins are reminded that <a href="postgres.html">SQLite is not recommended for use
  1358. outside a test environment</a>.</p>
  1359. </li>
  1360. <li>
  1361. <p>Once the index has been created, the <code>SELECT</code> query in step 1 above
  1362. should complete quickly. It is therefore safe to upgrade to Synapse
  1363. 1.12.0.</p>
  1364. </li>
  1365. <li>
  1366. <p>Once Synapse 1.12.0 has successfully started and is responding to
  1367. HTTP requests, the temporary index can be removed:</p>
  1368. <pre><code class="language-sql">DROP INDEX tmp_upgrade_1_12_0_index;
  1369. </code></pre>
  1370. </li>
  1371. </ol>
  1372. <h1 id="upgrading-to-v1100"><a class="header" href="#upgrading-to-v1100">Upgrading to v1.10.0</a></h1>
  1373. <p>Synapse will now log a warning on start up if used with a PostgreSQL
  1374. database that has a non-recommended locale set.</p>
  1375. <p>See <a href="postgres.html">Postgres</a> for details.</p>
  1376. <h1 id="upgrading-to-v180"><a class="header" href="#upgrading-to-v180">Upgrading to v1.8.0</a></h1>
  1377. <p>Specifying a <code>log_file</code> config option will now cause Synapse to refuse
  1378. to start, and should be replaced by with the <code>log_config</code> option.
  1379. Support for the <code>log_file</code> option was removed in v1.3.0 and has since
  1380. had no effect.</p>
  1381. <h1 id="upgrading-to-v170"><a class="header" href="#upgrading-to-v170">Upgrading to v1.7.0</a></h1>
  1382. <p>In an attempt to configure Synapse in a privacy preserving way, the
  1383. default behaviours of <code>allow_public_rooms_without_auth</code> and
  1384. <code>allow_public_rooms_over_federation</code> have been inverted. This means that
  1385. by default, only authenticated users querying the Client/Server API will
  1386. be able to query the room directory, and relatedly that the server will
  1387. not share room directory information with other servers over federation.</p>
  1388. <p>If your installation does not explicitly set these settings one way or
  1389. the other and you want either setting to be <code>true</code> then it will
  1390. necessary to update your homeserver configuration file accordingly.</p>
  1391. <p>For more details on the surrounding context see our
  1392. <a href="https://matrix.org/blog/2019/11/09/avoiding-unwelcome-visitors-on-private-matrix-servers">explainer</a>.</p>
  1393. <h1 id="upgrading-to-v150"><a class="header" href="#upgrading-to-v150">Upgrading to v1.5.0</a></h1>
  1394. <p>This release includes a database migration which may take several
  1395. minutes to complete if there are a large number (more than a million or
  1396. so) of entries in the <code>devices</code> table. This is only likely to a be a
  1397. problem on very large installations.</p>
  1398. <h1 id="upgrading-to-v140"><a class="header" href="#upgrading-to-v140">Upgrading to v1.4.0</a></h1>
  1399. <h2 id="new-custom-templates"><a class="header" href="#new-custom-templates">New custom templates</a></h2>
  1400. <p>If you have configured a custom template directory with the
  1401. <code>email.template_dir</code> option, be aware that there are new templates
  1402. regarding registration and threepid management (see below) that must be
  1403. included.</p>
  1404. <ul>
  1405. <li><code>registration.html</code> and <code>registration.txt</code></li>
  1406. <li><code>registration_success.html</code> and <code>registration_failure.html</code></li>
  1407. <li><code>add_threepid.html</code> and <code>add_threepid.txt</code></li>
  1408. <li><code>add_threepid_failure.html</code> and <code>add_threepid_success.html</code></li>
  1409. </ul>
  1410. <p>Synapse will expect these files to exist inside the configured template
  1411. directory, and <strong>will fail to start</strong> if they are absent. To view the
  1412. default templates, see
  1413. <a href="https://github.com/matrix-org/synapse/tree/master/synapse/res/templates">synapse/res/templates</a>.</p>
  1414. <h2 id="3pid-verification-changes"><a class="header" href="#3pid-verification-changes">3pid verification changes</a></h2>
  1415. <p><strong>Note: As of this release, users will be unable to add phone numbers or
  1416. email addresses to their accounts, without changes to the Synapse
  1417. configuration. This includes adding an email address during
  1418. registration.</strong></p>
  1419. <p>It is possible for a user to associate an email address or phone number
  1420. with their account, for a number of reasons:</p>
  1421. <ul>
  1422. <li>for use when logging in, as an alternative to the user id.</li>
  1423. <li>in the case of email, as an alternative contact to help with account
  1424. recovery.</li>
  1425. <li>in the case of email, to receive notifications of missed messages.</li>
  1426. </ul>
  1427. <p>Before an email address or phone number can be added to a user's
  1428. account, or before such an address is used to carry out a
  1429. password-reset, Synapse must confirm the operation with the owner of the
  1430. email address or phone number. It does this by sending an email or text
  1431. giving the user a link or token to confirm receipt. This process is
  1432. known as '3pid verification'. ('3pid', or 'threepid', stands for
  1433. third-party identifier, and we use it to refer to external identifiers
  1434. such as email addresses and phone numbers.)</p>
  1435. <p>Previous versions of Synapse delegated the task of 3pid verification to
  1436. an identity server by default. In most cases this server is <code>vector.im</code>
  1437. or <code>matrix.org</code>.</p>
  1438. <p>In Synapse 1.4.0, for security and privacy reasons, the homeserver will
  1439. no longer delegate this task to an identity server by default. Instead,
  1440. the server administrator will need to explicitly decide how they would
  1441. like the verification messages to be sent.</p>
  1442. <p>In the medium term, the <code>vector.im</code> and <code>matrix.org</code> identity servers
  1443. will disable support for delegated 3pid verification entirely. However,
  1444. in order to ease the transition, they will retain the capability for a
  1445. limited period. Delegated email verification will be disabled on Monday
  1446. 2nd December 2019 (giving roughly 2 months notice). Disabling delegated
  1447. SMS verification will follow some time after that once SMS verification
  1448. support lands in Synapse.</p>
  1449. <p>Once delegated 3pid verification support has been disabled in the
  1450. <code>vector.im</code> and <code>matrix.org</code> identity servers, all Synapse versions that
  1451. depend on those instances will be unable to verify email and phone
  1452. numbers through them. There are no imminent plans to remove delegated
  1453. 3pid verification from Sydent generally. (Sydent is the identity server
  1454. project that backs the <code>vector.im</code> and <code>matrix.org</code> instances).</p>
  1455. <h3 id="email"><a class="header" href="#email">Email</a></h3>
  1456. <p>Following upgrade, to continue verifying email (e.g. as part of the
  1457. registration process), admins can either:-</p>
  1458. <ul>
  1459. <li>Configure Synapse to use an email server.</li>
  1460. <li>Run or choose an identity server which allows delegated email
  1461. verification and delegate to it.</li>
  1462. </ul>
  1463. <h4 id="configure-smtp-in-synapse"><a class="header" href="#configure-smtp-in-synapse">Configure SMTP in Synapse</a></h4>
  1464. <p>To configure an SMTP server for Synapse, modify the configuration
  1465. section headed <code>email</code>, and be sure to have at least the
  1466. <code>smtp_host, smtp_port</code> and <code>notif_from</code> fields filled out.</p>
  1467. <p>You may also need to set <code>smtp_user</code>, <code>smtp_pass</code>, and
  1468. <code>require_transport_security</code>.</p>
  1469. <p>See the <a href="usage/configuration/homeserver_sample_config.html">sample configuration file</a>
  1470. for more details on these settings.</p>
  1471. <h4 id="delegate-email-to-an-identity-server"><a class="header" href="#delegate-email-to-an-identity-server">Delegate email to an identity server</a></h4>
  1472. <p>Some admins will wish to continue using email verification as part of
  1473. the registration process, but will not immediately have an appropriate
  1474. SMTP server at hand.</p>
  1475. <p>To this end, we will continue to support email verification delegation
  1476. via the <code>vector.im</code> and <code>matrix.org</code> identity servers for two months.
  1477. Support for delegated email verification will be disabled on Monday 2nd
  1478. December.</p>
  1479. <p>The <code>account_threepid_delegates</code> dictionary defines whether the
  1480. homeserver should delegate an external server (typically an <a href="https://matrix.org/docs/spec/identity_service/r0.2.1">identity
  1481. server</a>) to handle
  1482. sending confirmation messages via email and SMS.</p>
  1483. <p>So to delegate email verification, in <code>homeserver.yaml</code>, set
  1484. <code>account_threepid_delegates.email</code> to the base URL of an identity
  1485. server. For example:</p>
  1486. <pre><code class="language-yaml">account_threepid_delegates:
  1487. email: https://example.com # Delegate email sending to example.com
  1488. </code></pre>
  1489. <p>Note that <code>account_threepid_delegates.email</code> replaces the deprecated
  1490. <code>email.trust_identity_server_for_password_resets</code>: if
  1491. <code>email.trust_identity_server_for_password_resets</code> is set to <code>true</code>, and
  1492. <code>account_threepid_delegates.email</code> is not set, then the first entry in
  1493. <code>trusted_third_party_id_servers</code> will be used as the
  1494. <code>account_threepid_delegate</code> for email. This is to ensure compatibility
  1495. with existing Synapse installs that set up external server handling for
  1496. these tasks before v1.4.0. If
  1497. <code>email.trust_identity_server_for_password_resets</code> is <code>true</code> and no
  1498. trusted identity server domains are configured, Synapse will report an
  1499. error and refuse to start.</p>
  1500. <p>If <code>email.trust_identity_server_for_password_resets</code> is <code>false</code> or
  1501. absent and no <code>email</code> delegate is configured in
  1502. <code>account_threepid_delegates</code>, then Synapse will send email verification
  1503. messages itself, using the configured SMTP server (see above). that
  1504. type.</p>
  1505. <h3 id="phone-numbers"><a class="header" href="#phone-numbers">Phone numbers</a></h3>
  1506. <p>Synapse does not support phone-number verification itself, so the only
  1507. way to maintain the ability for users to add phone numbers to their
  1508. accounts will be by continuing to delegate phone number verification to
  1509. the <code>matrix.org</code> and <code>vector.im</code> identity servers (or another identity
  1510. server that supports SMS sending).</p>
  1511. <p>The <code>account_threepid_delegates</code> dictionary defines whether the
  1512. homeserver should delegate an external server (typically an <a href="https://matrix.org/docs/spec/identity_service/r0.2.1">identity
  1513. server</a>) to handle
  1514. sending confirmation messages via email and SMS.</p>
  1515. <p>So to delegate phone number verification, in <code>homeserver.yaml</code>, set
  1516. <code>account_threepid_delegates.msisdn</code> to the base URL of an identity
  1517. server. For example:</p>
  1518. <pre><code class="language-yaml">account_threepid_delegates:
  1519. msisdn: https://example.com # Delegate sms sending to example.com
  1520. </code></pre>
  1521. <p>The <code>matrix.org</code> and <code>vector.im</code> identity servers will continue to
  1522. support delegated phone number verification via SMS until such time as
  1523. it is possible for admins to configure their servers to perform phone
  1524. number verification directly. More details will follow in a future
  1525. release.</p>
  1526. <h2 id="rolling-back-to-v131"><a class="header" href="#rolling-back-to-v131">Rolling back to v1.3.1</a></h2>
  1527. <p>If you encounter problems with v1.4.0, it should be possible to roll
  1528. back to v1.3.1, subject to the following:</p>
  1529. <ul>
  1530. <li>
  1531. <p>The 'room statistics' engine was heavily reworked in this release
  1532. (see <a href="https://github.com/matrix-org/synapse/pull/5971">#5971</a>),
  1533. including significant changes to the database schema, which are not
  1534. easily reverted. This will cause the room statistics engine to stop
  1535. updating when you downgrade.</p>
  1536. <p>The room statistics are essentially unused in v1.3.1 (in future
  1537. versions of Synapse, they will be used to populate the room
  1538. directory), so there should be no loss of functionality. However,
  1539. the statistics engine will write errors to the logs, which can be
  1540. avoided by setting the following in <code>homeserver.yaml</code>:</p>
  1541. <pre><code class="language-yaml">stats:
  1542. enabled: false
  1543. </code></pre>
  1544. <p>Don't forget to re-enable it when you upgrade again, in preparation
  1545. for its use in the room directory!</p>
  1546. </li>
  1547. </ul>
  1548. <h1 id="upgrading-to-v120"><a class="header" href="#upgrading-to-v120">Upgrading to v1.2.0</a></h1>
  1549. <p>Some counter metrics have been renamed, with the old names deprecated.
  1550. See <a href="metrics-howto.html#renaming-of-metrics--deprecation-of-old-names-in-12">the metrics
  1551. documentation</a>
  1552. for details.</p>
  1553. <h1 id="upgrading-to-v110"><a class="header" href="#upgrading-to-v110">Upgrading to v1.1.0</a></h1>
  1554. <p>Synapse v1.1.0 removes support for older Python and PostgreSQL versions,
  1555. as outlined in <a href="https://matrix.org/blog/2019/04/08/synapse-deprecating-postgres-9-4-and-python-2-x">our deprecation
  1556. notice</a>.</p>
  1557. <h2 id="minimum-python-version"><a class="header" href="#minimum-python-version">Minimum Python Version</a></h2>
  1558. <p>Synapse v1.1.0 has a minimum Python requirement of Python 3.5. Python
  1559. 3.6 or Python 3.7 are recommended as they have improved internal string
  1560. handling, significantly reducing memory usage.</p>
  1561. <p>If you use current versions of the Matrix.org-distributed Debian
  1562. packages or Docker images, action is not required.</p>
  1563. <p>If you install Synapse in a Python virtual environment, please see
  1564. &quot;Upgrading to v0.34.0&quot; for notes on setting up a new virtualenv under
  1565. Python 3.</p>
  1566. <h2 id="minimum-postgresql-version"><a class="header" href="#minimum-postgresql-version">Minimum PostgreSQL Version</a></h2>
  1567. <p>If using PostgreSQL under Synapse, you will need to use PostgreSQL 9.5
  1568. or above. Please see the <a href="https://www.postgresql.org/docs/11/upgrading.html">PostgreSQL
  1569. documentation</a> for
  1570. more details on upgrading your database.</p>
  1571. <h1 id="upgrading-to-v10"><a class="header" href="#upgrading-to-v10">Upgrading to v1.0</a></h1>
  1572. <h2 id="validation-of-tls-certificates"><a class="header" href="#validation-of-tls-certificates">Validation of TLS certificates</a></h2>
  1573. <p>Synapse v1.0 is the first release to enforce validation of TLS
  1574. certificates for the federation API. It is therefore essential that your
  1575. certificates are correctly configured.</p>
  1576. <p>Note, v1.0 installations will also no longer be able to federate with
  1577. servers that have not correctly configured their certificates.</p>
  1578. <p>In rare cases, it may be desirable to disable certificate checking: for
  1579. example, it might be essential to be able to federate with a given
  1580. legacy server in a closed federation. This can be done in one of two
  1581. ways:-</p>
  1582. <ul>
  1583. <li>Configure the global switch <code>federation_verify_certificates</code> to
  1584. <code>false</code>.</li>
  1585. <li>Configure a whitelist of server domains to trust via
  1586. <code>federation_certificate_verification_whitelist</code>.</li>
  1587. </ul>
  1588. <p>See the <a href="usage/configuration/homeserver_sample_config.html">sample configuration file</a>
  1589. for more details on these settings.</p>
  1590. <h2 id="email-1"><a class="header" href="#email-1">Email</a></h2>
  1591. <p>When a user requests a password reset, Synapse will send an email to the
  1592. user to confirm the request.</p>
  1593. <p>Previous versions of Synapse delegated the job of sending this email to
  1594. an identity server. If the identity server was somehow malicious or
  1595. became compromised, it would be theoretically possible to hijack an
  1596. account through this means.</p>
  1597. <p>Therefore, by default, Synapse v1.0 will send the confirmation email
  1598. itself. If Synapse is not configured with an SMTP server, password reset
  1599. via email will be disabled.</p>
  1600. <p>To configure an SMTP server for Synapse, modify the configuration
  1601. section headed <code>email</code>, and be sure to have at least the <code>smtp_host</code>,
  1602. <code>smtp_port</code> and <code>notif_from</code> fields filled out. You may also need to set
  1603. <code>smtp_user</code>, <code>smtp_pass</code>, and <code>require_transport_security</code>.</p>
  1604. <p>If you are absolutely certain that you wish to continue using an
  1605. identity server for password resets, set
  1606. <code>trust_identity_server_for_password_resets</code> to <code>true</code>.</p>
  1607. <p>See the <a href="usage/configuration/homeserver_sample_config.html">sample configuration file</a>
  1608. for more details on these settings.</p>
  1609. <h2 id="new-email-templates"><a class="header" href="#new-email-templates">New email templates</a></h2>
  1610. <p>Some new templates have been added to the default template directory for the purpose of
  1611. the homeserver sending its own password reset emails. If you have configured a
  1612. custom <code>template_dir</code> in your Synapse config, these files will need to be added.</p>
  1613. <p><code>password_reset.html</code> and <code>password_reset.txt</code> are HTML and plain text
  1614. templates respectively that contain the contents of what will be emailed
  1615. to the user upon attempting to reset their password via email.
  1616. <code>password_reset_success.html</code> and <code>password_reset_failure.html</code> are HTML
  1617. files that the content of which (assuming no redirect URL is set) will
  1618. be shown to the user after they attempt to click the link in the email
  1619. sent to them.</p>
  1620. <h1 id="upgrading-to-v0990"><a class="header" href="#upgrading-to-v0990">Upgrading to v0.99.0</a></h1>
  1621. <p>Please be aware that, before Synapse v1.0 is released around March 2019,
  1622. you will need to replace any self-signed certificates with those
  1623. verified by a root CA. Information on how to do so can be found at the
  1624. ACME docs.</p>
  1625. <h1 id="upgrading-to-v0340"><a class="header" href="#upgrading-to-v0340">Upgrading to v0.34.0</a></h1>
  1626. <ol>
  1627. <li>
  1628. <p>This release is the first to fully support Python 3. Synapse will
  1629. now run on Python versions 3.5, or 3.6 (as well as 2.7). We
  1630. recommend switching to Python 3, as it has been shown to give
  1631. performance improvements.</p>
  1632. <p>For users who have installed Synapse into a virtualenv, we recommend
  1633. doing this by creating a new virtualenv. For example:</p>
  1634. <pre><code class="language-sh">virtualenv -p python3 ~/synapse/env3
  1635. source ~/synapse/env3/bin/activate
  1636. pip install matrix-synapse
  1637. </code></pre>
  1638. <p>You can then start synapse as normal, having activated the new
  1639. virtualenv:</p>
  1640. <pre><code class="language-sh">cd ~/synapse
  1641. source env3/bin/activate
  1642. synctl start
  1643. </code></pre>
  1644. <p>Users who have installed from distribution packages should see the
  1645. relevant package documentation. See below for notes on Debian
  1646. packages.</p>
  1647. <ul>
  1648. <li>
  1649. <p>When upgrading to Python 3, you <strong>must</strong> make sure that your log
  1650. files are configured as UTF-8, by adding <code>encoding: utf8</code> to the
  1651. <code>RotatingFileHandler</code> configuration (if you have one) in your
  1652. <code>&lt;server&gt;.log.config</code> file. For example, if your <code>log.config</code>
  1653. file contains:</p>
  1654. <pre><code class="language-yaml">handlers:
  1655. file:
  1656. class: logging.handlers.RotatingFileHandler
  1657. formatter: precise
  1658. filename: homeserver.log
  1659. maxBytes: 104857600
  1660. backupCount: 10
  1661. filters: [context]
  1662. console:
  1663. class: logging.StreamHandler
  1664. formatter: precise
  1665. filters: [context]
  1666. </code></pre>
  1667. <p>Then you should update this to be:</p>
  1668. <pre><code class="language-yaml">handlers:
  1669. file:
  1670. class: logging.handlers.RotatingFileHandler
  1671. formatter: precise
  1672. filename: homeserver.log
  1673. maxBytes: 104857600
  1674. backupCount: 10
  1675. filters: [context]
  1676. encoding: utf8
  1677. console:
  1678. class: logging.StreamHandler
  1679. formatter: precise
  1680. filters: [context]
  1681. </code></pre>
  1682. <p>There is no need to revert this change if downgrading to
  1683. Python 2.</p>
  1684. </li>
  1685. </ul>
  1686. <p>We are also making available Debian packages which will run Synapse
  1687. on Python 3. You can switch to these packages with
  1688. <code>apt-get install matrix-synapse-py3</code>, however, please read
  1689. <a href="https://github.com/matrix-org/synapse/blob/release-v0.34.0/debian/NEWS">debian/NEWS</a>
  1690. before doing so. The existing <code>matrix-synapse</code> packages will
  1691. continue to use Python 2 for the time being.</p>
  1692. </li>
  1693. <li>
  1694. <p>This release removes the <code>riot.im</code> from the default list of trusted
  1695. identity servers.</p>
  1696. <p>If <code>riot.im</code> is in your homeserver's list of
  1697. <code>trusted_third_party_id_servers</code>, you should remove it. It was added
  1698. in case a hypothetical future identity server was put there. If you
  1699. don't remove it, users may be unable to deactivate their accounts.</p>
  1700. </li>
  1701. <li>
  1702. <p>This release no longer installs the (unmaintained) Matrix Console
  1703. web client as part of the default installation. It is possible to
  1704. re-enable it by installing it separately and setting the
  1705. <code>web_client_location</code> config option, but please consider switching
  1706. to another client.</p>
  1707. </li>
  1708. </ol>
  1709. <h1 id="upgrading-to-v0337"><a class="header" href="#upgrading-to-v0337">Upgrading to v0.33.7</a></h1>
  1710. <p>This release removes the example email notification templates from
  1711. <code>res/templates</code> (they are now internal to the python package). This
  1712. should only affect you if you (a) deploy your Synapse instance from a
  1713. git checkout or a github snapshot URL, and (b) have email notifications
  1714. enabled.</p>
  1715. <p>If you have email notifications enabled, you should ensure that
  1716. <code>email.template_dir</code> is either configured to point at a directory where
  1717. you have installed customised templates, or leave it unset to use the
  1718. default templates.</p>
  1719. <h1 id="upgrading-to-v0273"><a class="header" href="#upgrading-to-v0273">Upgrading to v0.27.3</a></h1>
  1720. <p>This release expands the anonymous usage stats sent if the opt-in
  1721. <code>report_stats</code> configuration is set to <code>true</code>. We now capture RSS memory
  1722. and cpu use at a very coarse level. This requires administrators to
  1723. install the optional <code>psutil</code> python module.</p>
  1724. <p>We would appreciate it if you could assist by ensuring this module is
  1725. available and <code>report_stats</code> is enabled. This will let us see if
  1726. performance changes to synapse are having an impact to the general
  1727. community.</p>
  1728. <h1 id="upgrading-to-v0150"><a class="header" href="#upgrading-to-v0150">Upgrading to v0.15.0</a></h1>
  1729. <p>If you want to use the new URL previewing API
  1730. (<code>/_matrix/media/r0/preview_url</code>) then you have to explicitly enable it
  1731. in the config and update your dependencies dependencies. See README.rst
  1732. for details.</p>
  1733. <h1 id="upgrading-to-v0110"><a class="header" href="#upgrading-to-v0110">Upgrading to v0.11.0</a></h1>
  1734. <p>This release includes the option to send anonymous usage stats to
  1735. matrix.org, and requires that administrators explictly opt in or out by
  1736. setting the <code>report_stats</code> option to either <code>true</code> or <code>false</code>.</p>
  1737. <p>We would really appreciate it if you could help our project out by
  1738. reporting anonymized usage statistics from your homeserver. Only very
  1739. basic aggregate data (e.g. number of users) will be reported, but it
  1740. helps us to track the growth of the Matrix community, and helps us to
  1741. make Matrix a success, as well as to convince other networks that they
  1742. should peer with us.</p>
  1743. <h1 id="upgrading-to-v090"><a class="header" href="#upgrading-to-v090">Upgrading to v0.9.0</a></h1>
  1744. <p>Application services have had a breaking API change in this version.</p>
  1745. <p>They can no longer register themselves with a home server using the AS
  1746. HTTP API. This decision was made because a compromised application
  1747. service with free reign to register any regex in effect grants full
  1748. read/write access to the home server if a regex of <code>.*</code> is used. An
  1749. attack where a compromised AS re-registers itself with <code>.*</code> was deemed
  1750. too big of a security risk to ignore, and so the ability to register
  1751. with the HS remotely has been removed.</p>
  1752. <p>It has been replaced by specifying a list of application service
  1753. registrations in <code>homeserver.yaml</code>:</p>
  1754. <pre><code class="language-yaml">app_service_config_files: [&quot;registration-01.yaml&quot;, &quot;registration-02.yaml&quot;]
  1755. </code></pre>
  1756. <p>Where <code>registration-01.yaml</code> looks like:</p>
  1757. <pre><code class="language-yaml">url: &lt;String&gt; # e.g. &quot;https://my.application.service.com&quot;
  1758. as_token: &lt;String&gt;
  1759. hs_token: &lt;String&gt;
  1760. sender_localpart: &lt;String&gt; # This is a new field which denotes the user_id localpart when using the AS token
  1761. namespaces:
  1762. users:
  1763. - exclusive: &lt;Boolean&gt;
  1764. regex: &lt;String&gt; # e.g. &quot;@prefix_.*&quot;
  1765. aliases:
  1766. - exclusive: &lt;Boolean&gt;
  1767. regex: &lt;String&gt;
  1768. rooms:
  1769. - exclusive: &lt;Boolean&gt;
  1770. regex: &lt;String&gt;
  1771. </code></pre>
  1772. <h1 id="upgrading-to-v080"><a class="header" href="#upgrading-to-v080">Upgrading to v0.8.0</a></h1>
  1773. <p>Servers which use captchas will need to add their public key to:</p>
  1774. <pre><code>static/client/register/register_config.js
  1775. window.matrixRegistrationConfig = {
  1776. recaptcha_public_key: &quot;YOUR_PUBLIC_KEY&quot;
  1777. };
  1778. </code></pre>
  1779. <p>This is required in order to support registration fallback (typically
  1780. used on mobile devices).</p>
  1781. <h1 id="upgrading-to-v070"><a class="header" href="#upgrading-to-v070">Upgrading to v0.7.0</a></h1>
  1782. <p>New dependencies are:</p>
  1783. <ul>
  1784. <li>pydenticon</li>
  1785. <li>simplejson</li>
  1786. <li>syutil</li>
  1787. <li>matrix-angular-sdk</li>
  1788. </ul>
  1789. <p>To pull in these dependencies in a virtual env, run:</p>
  1790. <pre><code>python synapse/python_dependencies.py | xargs -n 1 pip install
  1791. </code></pre>
  1792. <h1 id="upgrading-to-v060"><a class="header" href="#upgrading-to-v060">Upgrading to v0.6.0</a></h1>
  1793. <p>To pull in new dependencies, run:</p>
  1794. <pre><code>python setup.py develop --user
  1795. </code></pre>
  1796. <p>This update includes a change to the database schema. To upgrade you
  1797. first need to upgrade the database by running:</p>
  1798. <pre><code>python scripts/upgrade_db_to_v0.6.0.py &lt;db&gt; &lt;server_name&gt; &lt;signing_key&gt;
  1799. </code></pre>
  1800. <p>Where <code>&lt;db&gt;</code> is the location of the database,
  1801. <code>&lt;server_name&gt;</code> is the server name as specified in the
  1802. synapse configuration, and <code>&lt;signing_key&gt;</code> is the location
  1803. of the signing key as specified in the synapse configuration.</p>
  1804. <p>This may take some time to complete. Failures of signatures and content
  1805. hashes can safely be ignored.</p>
  1806. <h1 id="upgrading-to-v051"><a class="header" href="#upgrading-to-v051">Upgrading to v0.5.1</a></h1>
  1807. <p>Depending on precisely when you installed v0.5.0 you may have ended up
  1808. with a stale release of the reference matrix webclient installed as a
  1809. python module. To uninstall it and ensure you are depending on the
  1810. latest module, please run:</p>
  1811. <pre><code>$ pip uninstall syweb
  1812. </code></pre>
  1813. <h1 id="upgrading-to-v050"><a class="header" href="#upgrading-to-v050">Upgrading to v0.5.0</a></h1>
  1814. <p>The webclient has been split out into a seperate repository/pacakage in
  1815. this release. Before you restart your homeserver you will need to pull
  1816. in the webclient package by running:</p>
  1817. <pre><code>python setup.py develop --user
  1818. </code></pre>
  1819. <p>This release completely changes the database schema and so requires
  1820. upgrading it before starting the new version of the homeserver.</p>
  1821. <p>The script &quot;database-prepare-for-0.5.0.sh&quot; should be used to upgrade
  1822. the database. This will save all user information, such as logins and
  1823. profiles, but will otherwise purge the database. This includes messages,
  1824. which rooms the home server was a member of and room alias mappings.</p>
  1825. <p>If you would like to keep your history, please take a copy of your
  1826. database file and ask for help in #matrix:matrix.org. The upgrade
  1827. process is, unfortunately, non trivial and requires human intervention
  1828. to resolve any resulting conflicts during the upgrade process.</p>
  1829. <p>Before running the command the homeserver should be first completely
  1830. shutdown. To run it, simply specify the location of the database, e.g.:</p>
  1831. <blockquote>
  1832. <p>./scripts/database-prepare-for-0.5.0.sh &quot;homeserver.db&quot;</p>
  1833. </blockquote>
  1834. <p>Once this has successfully completed it will be safe to restart the
  1835. homeserver. You may notice that the homeserver takes a few seconds
  1836. longer to restart than usual as it reinitializes the database.</p>
  1837. <p>On startup of the new version, users can either rejoin remote rooms
  1838. using room aliases or by being reinvited. Alternatively, if any other
  1839. homeserver sends a message to a room that the homeserver was previously
  1840. in the local HS will automatically rejoin the room.</p>
  1841. <h1 id="upgrading-to-v040"><a class="header" href="#upgrading-to-v040">Upgrading to v0.4.0</a></h1>
  1842. <p>This release needs an updated syutil version. Run:</p>
  1843. <pre><code>python setup.py develop
  1844. </code></pre>
  1845. <p>You will also need to upgrade your configuration as the signing key
  1846. format has changed. Run:</p>
  1847. <pre><code>python -m synapse.app.homeserver --config-path &lt;CONFIG&gt; --generate-config
  1848. </code></pre>
  1849. <h1 id="upgrading-to-v030"><a class="header" href="#upgrading-to-v030">Upgrading to v0.3.0</a></h1>
  1850. <p>This registration API now closely matches the login API. This introduces
  1851. a bit more backwards and forwards between the HS and the client, but
  1852. this improves the overall flexibility of the API. You can now GET on
  1853. /register to retrieve a list of valid registration flows. Upon choosing
  1854. one, they are submitted in the same way as login, e.g:</p>
  1855. <pre><code>{
  1856. type: m.login.password,
  1857. user: foo,
  1858. password: bar
  1859. }
  1860. </code></pre>
  1861. <p>The default HS supports 2 flows, with and without Identity Server email
  1862. authentication. Enabling captcha on the HS will add in an extra step to
  1863. all flows: <code>m.login.recaptcha</code> which must be completed before you can
  1864. transition to the next stage. There is a new login type:
  1865. <code>m.login.email.identity</code> which contains the <code>threepidCreds</code> key which
  1866. were previously sent in the original register request. For more
  1867. information on this, see the specification.</p>
  1868. <h2 id="web-client"><a class="header" href="#web-client">Web Client</a></h2>
  1869. <p>The VoIP specification has changed between v0.2.0 and v0.3.0. Users
  1870. should refresh any browser tabs to get the latest web client code. Users
  1871. on v0.2.0 of the web client will not be able to call those on v0.3.0 and
  1872. vice versa.</p>
  1873. <h1 id="upgrading-to-v020"><a class="header" href="#upgrading-to-v020">Upgrading to v0.2.0</a></h1>
  1874. <p>The home server now requires setting up of SSL config before it can run.
  1875. To automatically generate default config use:</p>
  1876. <pre><code>$ python synapse/app/homeserver.py \
  1877. --server-name machine.my.domain.name \
  1878. --bind-port 8448 \
  1879. --config-path homeserver.config \
  1880. --generate-config
  1881. </code></pre>
  1882. <p>This config can be edited if desired, for example to specify a different
  1883. SSL certificate to use. Once done you can run the home server using:</p>
  1884. <pre><code>$ python synapse/app/homeserver.py --config-path homeserver.config
  1885. </code></pre>
  1886. <p>See the README.rst for more information.</p>
  1887. <p>Also note that some config options have been renamed, including:</p>
  1888. <ul>
  1889. <li>&quot;host&quot; to &quot;server-name&quot;</li>
  1890. <li>&quot;database&quot; to &quot;database-path&quot;</li>
  1891. <li>&quot;port&quot; to &quot;bind-port&quot; and &quot;unsecure-port&quot;</li>
  1892. </ul>
  1893. <h1 id="upgrading-to-v001"><a class="header" href="#upgrading-to-v001">Upgrading to v0.0.1</a></h1>
  1894. <p>This release completely changes the database schema and so requires
  1895. upgrading it before starting the new version of the homeserver.</p>
  1896. <p>The script &quot;database-prepare-for-0.0.1.sh&quot; should be used to upgrade
  1897. the database. This will save all user information, such as logins and
  1898. profiles, but will otherwise purge the database. This includes messages,
  1899. which rooms the home server was a member of and room alias mappings.</p>
  1900. <p>Before running the command the homeserver should be first completely
  1901. shutdown. To run it, simply specify the location of the database, e.g.:</p>
  1902. <blockquote>
  1903. <p>./scripts/database-prepare-for-0.0.1.sh &quot;homeserver.db&quot;</p>
  1904. </blockquote>
  1905. <p>Once this has successfully completed it will be safe to restart the
  1906. homeserver. You may notice that the homeserver takes a few seconds
  1907. longer to restart than usual as it reinitializes the database.</p>
  1908. <p>On startup of the new version, users can either rejoin remote rooms
  1909. using room aliases or by being reinvited. Alternatively, if any other
  1910. homeserver sends a message to a room that the homeserver was previously
  1911. in the local HS will automatically rejoin the room.</p>
  1912. </main>
  1913. <nav class="nav-wrapper" aria-label="Page navigation">
  1914. <!-- Mobile navigation buttons -->
  1915. <a rel="prev" href="delegate.html" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
  1916. <i class="fa fa-angle-left"></i>
  1917. </a>
  1918. <a rel="next" href="federate.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
  1919. <i class="fa fa-angle-right"></i>
  1920. </a>
  1921. <div style="clear: both"></div>
  1922. </nav>
  1923. </div>
  1924. </div>
  1925. <nav class="nav-wide-wrapper" aria-label="Page navigation">
  1926. <a rel="prev" href="delegate.html" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
  1927. <i class="fa fa-angle-left"></i>
  1928. </a>
  1929. <a rel="next" href="federate.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
  1930. <i class="fa fa-angle-right"></i>
  1931. </a>
  1932. </nav>
  1933. </div>
  1934. <script type="text/javascript">
  1935. window.playground_copyable = true;
  1936. </script>
  1937. <script src="elasticlunr.min.js" type="text/javascript" charset="utf-8"></script>
  1938. <script src="mark.min.js" type="text/javascript" charset="utf-8"></script>
  1939. <script src="searcher.js" type="text/javascript" charset="utf-8"></script>
  1940. <script src="clipboard.min.js" type="text/javascript" charset="utf-8"></script>
  1941. <script src="highlight.js" type="text/javascript" charset="utf-8"></script>
  1942. <script src="book.js" type="text/javascript" charset="utf-8"></script>
  1943. <!-- Custom JS scripts -->
  1944. <script type="text/javascript" src="docs/website_files/table-of-contents.js"></script>
  1945. </body>
  1946. </html>