upgrade.html 120 KB

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