upgrade.html 83 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388
  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="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 "><a href="MSC1711_certificates_FAQ.html">Upgrading from pre-Synapse 1.0</a></li><li class="chapter-item expanded affix "><li class="part-title">Usage</li><li class="chapter-item expanded "><a href="federate.html">Federation</a></li><li class="chapter-item expanded "><a href="usage/configuration/index.html">Configuration</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="usage/configuration/homeserver_sample_config.html">Homeserver Sample Config File</a></li><li class="chapter-item expanded "><a href="usage/configuration/logging_sample_config.html">Logging Sample Config File</a></li><li class="chapter-item expanded "><a href="structured_logging.html">Structured Logging</a></li><li class="chapter-item expanded "><a href="usage/configuration/user_authentication/index.html">User Authentication</a></li><li><ol class="section"><li class="chapter-item expanded "><div>Single-Sign On</div></li><li><ol class="section"><li class="chapter-item expanded "><a href="openid.html">OpenID Connect</a></li><li class="chapter-item expanded "><div>SAML</div></li><li class="chapter-item expanded "><div>CAS</div></li><li class="chapter-item expanded "><a href="sso_mapping_providers.html">SSO Mapping Providers</a></li></ol></li><li class="chapter-item expanded "><a href="password_auth_providers.html">Password Auth Providers</a></li><li class="chapter-item expanded "><a href="jwt.html">JSON Web Tokens</a></li></ol></li><li class="chapter-item expanded "><a href="CAPTCHA_SETUP.html">Registration Captcha</a></li><li class="chapter-item expanded "><a href="application_services.html">Application Services</a></li><li class="chapter-item expanded "><a href="server_notices.html">Server Notices</a></li><li class="chapter-item expanded "><a href="consent_tracking.html">Consent Tracking</a></li><li class="chapter-item expanded "><a href="url_previews.html">URL Previews</a></li><li class="chapter-item expanded "><a href="user_directory.html">User Directory</a></li><li class="chapter-item expanded "><a href="message_retention_policies.html">Message Retention Policies</a></li><li class="chapter-item expanded "><a href="modules.html">Pluggable Modules</a></li><li><ol class="section"><li class="chapter-item expanded "><div>Third Party Rules</div></li><li class="chapter-item expanded "><a href="spam_checker.html">Spam Checker</a></li><li class="chapter-item expanded "><a href="presence_router_module.html">Presence Router</a></li><li class="chapter-item expanded "><div>Media Storage Providers</div></li></ol></li><li class="chapter-item expanded "><a href="workers.html">Workers</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="synctl_workers.html">Using synctl with Workers</a></li><li class="chapter-item expanded "><a href="systemd-with-workers/index.html">Systemd</a></li></ol></li></ol></li><li class="chapter-item expanded "><a href="usage/administration/index.html">Administration</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="usage/administration/admin_api/index.html">Admin API</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="admin_api/account_validity.html">Account Validity</a></li><li class="chapter-item expanded "><a href="admin_api/delete_group.html">Delete Group</a></li><li class="chapter-item expanded "><a href="admin_api/event_reports.html">Event Reports</a></li><li class="chapter-item expanded "><a href="admin_api/media_admin_api.html">Media</a></li><li class="chapter-item expanded "><a href="admin_api/purge_history_api.html">Purge History</a></li><li class="chapter-item expanded "><a href="admin_api/purge_room.html">Purge Rooms</a></li><li class="chapter-item expanded "><a href="admin_api/register_api.html">Register Users</a></li><li class="chapter-item expanded "><a href="admin_api/room_membership.html">Manipulate Room Membership</a></li><li class="chapter-item expanded "><a href="admin_api/rooms.html">Rooms</a></li><li class="chapter-item expanded "><a href="admin_api/server_notices.html">Server Notices</a></li><li class="chapter-item expanded "><a href="admin_api/shutdown_room.html">Shutdown Room</a></li><li class="chapter-item expanded "><a href="admin_api/statistics.html">Statistics</a></li><li class="chapter-item expanded "><a href="admin_api/user_admin_api.html">Users</a></li><li class="chapter-item expanded "><a href="admin_api/version_api.html">Server Version</a></li></ol></li><li class="chapter-item expanded "><a href="manhole.html">Manhole</a></li><li class="chapter-item expanded "><a href="metrics-howto.html">Monitoring</a></li><li class="chapter-item expanded "><a href="usage/administration/request_log.html">Request log format</a></li><li class="chapter-item expanded "><div>Scripts</div></li></ol></li><li class="chapter-item expanded "><li class="part-title">Development</li><li class="chapter-item expanded "><a href="development/contributing_guide.html">Contributing Guide</a></li><li class="chapter-item expanded "><a href="code_style.html">Code Style</a></li><li class="chapter-item expanded "><a href="development/git.html">Git Usage</a></li><li class="chapter-item expanded "><div>Testing</div></li><li class="chapter-item expanded "><a href="opentracing.html">OpenTracing</a></li><li class="chapter-item expanded "><a href="development/database_schema.html">Database Schemas</a></li><li class="chapter-item expanded "><div>Synapse Architecture</div></li><li><ol class="section"><li class="chapter-item expanded "><a href="log_contexts.html">Log Contexts</a></li><li class="chapter-item expanded "><a href="replication.html">Replication</a></li><li class="chapter-item expanded "><a href="tcp_replication.html">TCP Replication</a></li></ol></li><li class="chapter-item expanded "><a href="development/internal_documentation/index.html">Internal Documentation</a></li><li><ol class="section"><li class="chapter-item expanded "><div>Single Sign-On</div></li><li><ol class="section"><li class="chapter-item expanded "><a href="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></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 from source, then:</p>
  158. <ol>
  159. <li>
  160. <p>Activate the virtualenv before upgrading. For example, if
  161. Synapse is installed in a virtualenv in <code>~/synapse/env</code> then
  162. run:</p>
  163. <pre><code class="language-bash">source ~/synapse/env/bin/activate
  164. </code></pre>
  165. </li>
  166. <li>
  167. <p>If Synapse was installed using pip then upgrade to the latest
  168. version by running:</p>
  169. <pre><code class="language-bash">pip install --upgrade matrix-synapse
  170. </code></pre>
  171. <p>If Synapse was installed using git then upgrade to the latest
  172. version by running:</p>
  173. <pre><code class="language-bash">git pull
  174. pip install --upgrade .
  175. </code></pre>
  176. </li>
  177. <li>
  178. <p>Restart Synapse:</p>
  179. <pre><code class="language-bash">./synctl restart
  180. </code></pre>
  181. </li>
  182. </ol>
  183. </li>
  184. </ul>
  185. <p>To check whether your update was successful, you can check the running
  186. server version with:</p>
  187. <pre><code class="language-bash"># you may need to replace 'localhost:8008' if synapse is not configured
  188. # to listen on port 8008.
  189. curl http://localhost:8008/_synapse/admin/v1/server_version
  190. </code></pre>
  191. <h2 id="rolling-back-to-older-versions"><a class="header" href="#rolling-back-to-older-versions">Rolling back to older versions</a></h2>
  192. <p>Rolling back to previous releases can be difficult, due to database
  193. schema changes between releases. Where we have been able to test the
  194. rollback process, this will be noted below.</p>
  195. <p>In general, you will need to undo any changes made during the upgrade
  196. process, for example:</p>
  197. <ul>
  198. <li>
  199. <p>pip:</p>
  200. <pre><code class="language-bash">source env/bin/activate
  201. # replace `1.3.0` accordingly:
  202. pip install matrix-synapse==1.3.0
  203. </code></pre>
  204. </li>
  205. <li>
  206. <p>Debian:</p>
  207. <pre><code class="language-bash"># replace `1.3.0` and `stretch` accordingly:
  208. wget https://packages.matrix.org/debian/pool/main/m/matrix-synapse-py3/matrix-synapse-py3_1.3.0+stretch1_amd64.deb
  209. dpkg -i matrix-synapse-py3_1.3.0+stretch1_amd64.deb
  210. </code></pre>
  211. </li>
  212. </ul>
  213. <h1 id="upgrading-to-v1390"><a class="header" href="#upgrading-to-v1390">Upgrading to v1.39.0</a></h1>
  214. <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>
  215. <p>The current third-party rules module interface is deprecated in favour of the new generic
  216. modules system introduced in Synapse v1.37.0. Authors of third-party rules modules can refer
  217. to <a href="modules.html#porting-an-existing-module-that-uses-the-old-interface">this documentation</a>
  218. to update their modules. Synapse administrators can refer to <a href="modules.html#using-modules">this documentation</a>
  219. to update their configuration once the modules they are using have been updated.</p>
  220. <p>We plan to remove support for the current third-party rules interface in September 2021.</p>
  221. <h1 id="upgrading-to-v1380"><a class="header" href="#upgrading-to-v1380">Upgrading to v1.38.0</a></h1>
  222. <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>
  223. <p>This release includes a database schema update which requires re-indexing one of
  224. the larger tables in the database, <code>events</code>. This could result in increased
  225. disk I/O for several hours or days after upgrading while the migration
  226. completes. Furthermore, because we have to keep the old indexes until the new
  227. indexes are ready, it could result in a significant, temporary, increase in
  228. disk space.</p>
  229. <p>To get a rough idea of the disk space required, check the current size of one
  230. of the indexes. For example, from a <code>psql</code> shell, run the following sql:</p>
  231. <pre><code class="language-sql">SELECT pg_size_pretty(pg_relation_size('events_order_room'));
  232. </code></pre>
  233. <p>We need to rebuild <strong>four</strong> indexes, so you will need to multiply this result
  234. by four to give an estimate of the disk space required. For example, on one
  235. particular server:</p>
  236. <pre><code>synapse=# select pg_size_pretty(pg_relation_size('events_order_room'));
  237. pg_size_pretty
  238. ----------------
  239. 288 MB
  240. (1 row)
  241. </code></pre>
  242. <p>On this server, it would be wise to ensure that at least 1152MB are free.</p>
  243. <p>The additional disk space will be freed once the migration completes.</p>
  244. <p>SQLite databases are unaffected by this change.</p>
  245. <h1 id="upgrading-to-v1370"><a class="header" href="#upgrading-to-v1370">Upgrading to v1.37.0</a></h1>
  246. <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>
  247. <p>The current spam checker interface is deprecated in favour of a new generic modules system.
  248. Authors of spam checker modules can refer to <a href="modules.html#porting-an-existing-module-that-uses-the-old-interface">this
  249. documentation</a>
  250. to update their modules. Synapse administrators can refer to <a href="modules.html#using-modules">this
  251. documentation</a>
  252. to update their configuration once the modules they are using have been updated.</p>
  253. <p>We plan to remove support for the current spam checker interface in August 2021.</p>
  254. <p>More module interfaces will be ported over to this new generic system in future versions
  255. of Synapse.</p>
  256. <h1 id="upgrading-to-v1340"><a class="header" href="#upgrading-to-v1340">Upgrading to v1.34.0</a></h1>
  257. <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>
  258. <p>The <code>room_invite_state_types</code> configuration setting has been deprecated
  259. 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
  260. file</a>.</p>
  261. <p>If you have set <code>room_invite_state_types</code> to the default value you
  262. should simply remove it from your configuration file. The default value
  263. used to be:</p>
  264. <pre><code class="language-yaml">room_invite_state_types:
  265. - &quot;m.room.join_rules&quot;
  266. - &quot;m.room.canonical_alias&quot;
  267. - &quot;m.room.avatar&quot;
  268. - &quot;m.room.encryption&quot;
  269. - &quot;m.room.name&quot;
  270. </code></pre>
  271. <p>If you have customised this value, you should remove
  272. <code>room_invite_state_types</code> and configure <code>room_prejoin_state</code> instead.</p>
  273. <h1 id="upgrading-to-v1330"><a class="header" href="#upgrading-to-v1330">Upgrading to v1.33.0</a></h1>
  274. <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>
  275. <p>This may affect you if you have enabled the account validity feature,
  276. and have made use of a custom HTML template specified by the
  277. <code>account_validity.template_dir</code> or
  278. <code>account_validity.account_renewed_html_path</code> Synapse config options.</p>
  279. <p>The template can now accept an <code>expiration_ts</code> variable, which
  280. represents the unix timestamp in milliseconds for the future date of
  281. 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
  282. template</a>
  283. for an example of usage.</p>
  284. <p>ALso note that a new HTML template, <code>account_previously_renewed.html</code>,
  285. has been added. This is is shown to users when they attempt to renew
  286. their account with a valid renewal token that has already been used
  287. before. The default template contents can been found
  288. <a href="https://github.com/matrix-org/synapse/blob/release-v1.33.0/synapse/res/templates/account_previously_renewed.html">here</a>,
  289. and can also accept an <code>expiration_ts</code> variable. This template replaces
  290. the error message users would previously see upon attempting to use a
  291. valid renewal token more than once.</p>
  292. <h1 id="upgrading-to-v1320"><a class="header" href="#upgrading-to-v1320">Upgrading to v1.32.0</a></h1>
  293. <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>
  294. <p>This release introduces <a href="https://github.com/matrix-org/synapse/issues/9853">a
  295. regression</a> that can
  296. overwhelm connected Prometheus instances. This issue is not present in
  297. Synapse v1.32.0rc1.</p>
  298. <p>If you have been affected, please downgrade to 1.31.0. You then may need
  299. to remove excess writeahead logs in order for Prometheus to recover.
  300. Instructions for doing so are provided
  301. <a href="https://github.com/matrix-org/synapse/pull/9854#issuecomment-823472183">here</a>.</p>
  302. <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>
  303. <p>In line with our <a href="deprecation_policy.html">deprecation policy</a>,
  304. we've dropped support for Python 3.5 and PostgreSQL 9.5, as they are no
  305. longer supported upstream.</p>
  306. <p>This release of Synapse requires Python 3.6+ and PostgresSQL 9.6+ or
  307. SQLite 3.22+.</p>
  308. <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>
  309. <p>The deprecated v1 &quot;list accounts&quot; admin API
  310. (<code>GET /_synapse/admin/v1/users/&lt;user_id&gt;</code>) has been removed in this
  311. version.</p>
  312. <p>The <a href="admin_api/user_admin_api.html#list-accounts">v2 list accounts API</a>
  313. has been available since Synapse 1.7.0 (2019-12-13), and is accessible
  314. under <code>GET /_synapse/admin/v2/users</code>.</p>
  315. <p>The deprecation of the old endpoint was announced with Synapse 1.28.0
  316. (released on 2021-02-25).</p>
  317. <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>
  318. <p>In compliance with the <a href="https://matrix.org/docs/spec/application_service/r0.1.2#server-admin-style-permissions">Application Service
  319. spec</a>,
  320. Application Services are now required to use the
  321. <code>m.login.application_service</code> type when registering users via the
  322. <code>/_matrix/client/r0/register</code> endpoint. This behaviour was deprecated in
  323. Synapse v1.30.0.</p>
  324. <p>Please ensure your Application Services are up to date.</p>
  325. <h1 id="upgrading-to-v1290"><a class="header" href="#upgrading-to-v1290">Upgrading to v1.29.0</a></h1>
  326. <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>
  327. <p>When using Synapse with a reverse proxy (in particular, when using the
  328. [x_forwarded]{.title-ref} option on an HTTP listener), Synapse now
  329. expects to receive an [X-Forwarded-Proto]{.title-ref} header on incoming
  330. HTTP requests. If it is not set, Synapse will log a warning on each
  331. received request.</p>
  332. <p>To avoid the warning, administrators using a reverse proxy should ensure
  333. that the reverse proxy sets [X-Forwarded-Proto]{.title-ref} header to
  334. [https]{.title-ref} or [http]{.title-ref} to indicate the protocol used
  335. by the client.</p>
  336. <p>Synapse also requires the [Host]{.title-ref} header to be preserved.</p>
  337. <p>See the <a href="reverse_proxy.html">reverse proxy documentation</a>, where the
  338. example configurations have been updated to show how to set these
  339. headers.</p>
  340. <p>(Users of <a href="https://caddyserver.com/">Caddy</a> are unaffected, since we
  341. believe it sets [X-Forwarded-Proto]{.title-ref} by default.)</p>
  342. <h1 id="upgrading-to-v1270"><a class="header" href="#upgrading-to-v1270">Upgrading to v1.27.0</a></h1>
  343. <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>
  344. <p>This version changes the URI used for callbacks from OAuth2 and SAML2
  345. identity providers:</p>
  346. <ul>
  347. <li>
  348. <p>If your server is configured for single sign-on via an OpenID
  349. Connect or OAuth2 identity provider, you will need to add
  350. <code>[synapse public baseurl]/_synapse/client/oidc/callback</code> to the list
  351. of permitted &quot;redirect URIs&quot; at the identity provider.</p>
  352. <p>See the <a href="openid.html">OpenID docs</a> for more information on setting
  353. up OpenID Connect.</p>
  354. </li>
  355. <li>
  356. <p>If your server is configured for single sign-on via a SAML2 identity
  357. provider, you will need to add
  358. <code>[synapse public baseurl]/_synapse/client/saml2/authn_response</code> as a
  359. permitted &quot;ACS location&quot; (also known as &quot;allowed callback URLs&quot;)
  360. at the identity provider.</p>
  361. <p>The &quot;Issuer&quot; in the &quot;AuthnRequest&quot; to the SAML2 identity
  362. provider is also updated to
  363. <code>[synapse public baseurl]/_synapse/client/saml2/metadata.xml</code>. If
  364. your SAML2 identity provider uses this property to validate or
  365. otherwise identify Synapse, its configuration will need to be
  366. updated to use the new URL. Alternatively you could create a new,
  367. separate &quot;EntityDescriptor&quot; in your SAML2 identity provider with
  368. the new URLs and leave the URLs in the existing &quot;EntityDescriptor&quot;
  369. as they were.</p>
  370. </li>
  371. </ul>
  372. <h2 id="changes-to-html-templates"><a class="header" href="#changes-to-html-templates">Changes to HTML templates</a></h2>
  373. <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
  374. autoescape</a>
  375. enabled for files ending in <code>.html</code>, <code>.htm</code>, and <code>.xml</code>. If you have
  376. customised these templates and see issues when viewing them you might
  377. need to update them. It is expected that most configurations will need
  378. no changes.</p>
  379. <p>If you have customised the templates <em>names</em> for these templates, it is
  380. recommended to verify they end in <code>.html</code> to ensure autoescape is
  381. enabled.</p>
  382. <p>The above applies to the following templates:</p>
  383. <ul>
  384. <li><code>add_threepid.html</code></li>
  385. <li><code>add_threepid_failure.html</code></li>
  386. <li><code>add_threepid_success.html</code></li>
  387. <li><code>notice_expiry.html</code></li>
  388. <li><code>notice_expiry.html</code></li>
  389. <li><code>notif_mail.html</code> (which, by default, includes <code>room.html</code> and
  390. <code>notif.html</code>)</li>
  391. <li><code>password_reset.html</code></li>
  392. <li><code>password_reset_confirmation.html</code></li>
  393. <li><code>password_reset_failure.html</code></li>
  394. <li><code>password_reset_success.html</code></li>
  395. <li><code>registration.html</code></li>
  396. <li><code>registration_failure.html</code></li>
  397. <li><code>registration_success.html</code></li>
  398. <li><code>sso_account_deactivated.html</code></li>
  399. <li><code>sso_auth_bad_user.html</code></li>
  400. <li><code>sso_auth_confirm.html</code></li>
  401. <li><code>sso_auth_success.html</code></li>
  402. <li><code>sso_error.html</code></li>
  403. <li><code>sso_login_idp_picker.html</code></li>
  404. <li><code>sso_redirect_confirm.html</code></li>
  405. </ul>
  406. <h1 id="upgrading-to-v1260"><a class="header" href="#upgrading-to-v1260">Upgrading to v1.26.0</a></h1>
  407. <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>
  408. <p>v1.26.0 includes a lot of large changes. If something problematic
  409. occurs, you may want to roll-back to a previous version of Synapse.
  410. Because v1.26.0 also includes a new database schema version, reverting
  411. that version is also required alongside the generic rollback
  412. instructions mentioned above. In short, to roll back to v1.25.0 you need
  413. to:</p>
  414. <ol>
  415. <li>
  416. <p>Stop the server</p>
  417. </li>
  418. <li>
  419. <p>Decrease the schema version in the database:</p>
  420. <pre><code class="language-sql">UPDATE schema_version SET version = 58;
  421. </code></pre>
  422. </li>
  423. <li>
  424. <p>Delete the ignored users &amp; chain cover data:</p>
  425. <pre><code class="language-sql">DROP TABLE IF EXISTS ignored_users;
  426. UPDATE rooms SET has_auth_chain_index = false;
  427. </code></pre>
  428. <p>For PostgreSQL run:</p>
  429. <pre><code class="language-sql">TRUNCATE event_auth_chain_links;
  430. TRUNCATE event_auth_chains;
  431. </code></pre>
  432. <p>For SQLite run:</p>
  433. <pre><code class="language-sql">DELETE FROM event_auth_chain_links;
  434. DELETE FROM event_auth_chains;
  435. </code></pre>
  436. </li>
  437. <li>
  438. <p>Mark the deltas as not run (so they will re-run on upgrade).</p>
  439. <pre><code class="language-sql">DELETE FROM applied_schema_deltas WHERE version = 59 AND file = &quot;59/01ignored_user.py&quot;;
  440. DELETE FROM applied_schema_deltas WHERE version = 59 AND file = &quot;59/06chain_cover_index.sql&quot;;
  441. </code></pre>
  442. </li>
  443. <li>
  444. <p>Downgrade Synapse by following the instructions for your
  445. installation method in the &quot;Rolling back to older versions&quot;
  446. section above.</p>
  447. </li>
  448. </ol>
  449. <h1 id="upgrading-to-v1250"><a class="header" href="#upgrading-to-v1250">Upgrading to v1.25.0</a></h1>
  450. <h2 id="last-release-supporting-python-35"><a class="header" href="#last-release-supporting-python-35">Last release supporting Python 3.5</a></h2>
  451. <p>This is the last release of Synapse which guarantees support with Python
  452. 3.5, which passed its upstream End of Life date several months ago.</p>
  453. <p>We will attempt to maintain support through March 2021, but without
  454. guarantees.</p>
  455. <p>In the future, Synapse will follow upstream schedules for ending support
  456. of older versions of Python and PostgreSQL. Please upgrade to at least
  457. Python 3.6 and PostgreSQL 9.6 as soon as possible.</p>
  458. <h2 id="blacklisting-ip-ranges"><a class="header" href="#blacklisting-ip-ranges">Blacklisting IP ranges</a></h2>
  459. <p>Synapse v1.25.0 includes new settings, <code>ip_range_blacklist</code> and
  460. <code>ip_range_whitelist</code>, for controlling outgoing requests from Synapse for
  461. federation, identity servers, push, and for checking key validity for
  462. third-party invite events. The previous setting,
  463. <code>federation_ip_range_blacklist</code>, is deprecated. The new
  464. <code>ip_range_blacklist</code> defaults to private IP ranges if it is not defined.</p>
  465. <p>If you have never customised <code>federation_ip_range_blacklist</code> it is
  466. recommended that you remove that setting.</p>
  467. <p>If you have customised <code>federation_ip_range_blacklist</code> you should update
  468. the setting name to <code>ip_range_blacklist</code>.</p>
  469. <p>If you have a custom push server that is reached via private IP space
  470. you may need to customise <code>ip_range_blacklist</code> or <code>ip_range_whitelist</code>.</p>
  471. <h1 id="upgrading-to-v1240"><a class="header" href="#upgrading-to-v1240">Upgrading to v1.24.0</a></h1>
  472. <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>
  473. <p>This release allows the OpenID Connect mapping provider to perform
  474. normalisation of the localpart of the Matrix ID. This allows for the
  475. mapping provider to specify different algorithms, instead of the
  476. <a href="https://matrix.org/docs/spec/appendices#mapping-from-other-character-sets">default
  477. way</a>.</p>
  478. <p>If your Synapse configuration uses a custom mapping provider
  479. ([oidc_config.user_mapping_provider.module]{.title-ref} is specified and
  480. not equal to
  481. [synapse.handlers.oidc_handler.JinjaOidcMappingProvider]{.title-ref})
  482. then you <em>must</em> ensure that [map_user_attributes]{.title-ref} of the
  483. mapping provider performs some normalisation of the
  484. [localpart]{.title-ref} returned. To match previous behaviour you can
  485. use the [map_username_to_mxid_localpart]{.title-ref} function provided
  486. by Synapse. An example is shown below:</p>
  487. <pre><code class="language-python">from synapse.types import map_username_to_mxid_localpart
  488. class MyMappingProvider:
  489. def map_user_attributes(self, userinfo, token):
  490. # ... your custom logic ...
  491. sso_user_id = ...
  492. localpart = map_username_to_mxid_localpart(sso_user_id)
  493. return {&quot;localpart&quot;: localpart}
  494. </code></pre>
  495. <h2 id="removal-historical-synapse-admin-api"><a class="header" href="#removal-historical-synapse-admin-api">Removal historical Synapse Admin API</a></h2>
  496. <p>Historically, the Synapse Admin API has been accessible under:</p>
  497. <ul>
  498. <li><code>/_matrix/client/api/v1/admin</code></li>
  499. <li><code>/_matrix/client/unstable/admin</code></li>
  500. <li><code>/_matrix/client/r0/admin</code></li>
  501. <li><code>/_synapse/admin/v1</code></li>
  502. </ul>
  503. <p>The endpoints with <code>/_matrix/client/*</code> prefixes have been removed as of
  504. v1.24.0. The Admin API is now only accessible under:</p>
  505. <ul>
  506. <li><code>/_synapse/admin/v1</code></li>
  507. </ul>
  508. <p>The only exception is the [/admin/whois]{.title-ref} endpoint, which is
  509. <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
  510. API</a>.</p>
  511. <p>The deprecation of the old endpoints was announced with Synapse 1.20.0
  512. (released on 2020-09-22) and makes it easier for homeserver admins to
  513. lock down external access to the Admin API endpoints.</p>
  514. <h1 id="upgrading-to-v1230"><a class="header" href="#upgrading-to-v1230">Upgrading to v1.23.0</a></h1>
  515. <h2 id="structured-logging-configuration-breaking-changes"><a class="header" href="#structured-logging-configuration-breaking-changes">Structured logging configuration breaking changes</a></h2>
  516. <p>This release deprecates use of the <code>structured: true</code> logging
  517. configuration for structured logging. If your logging configuration
  518. contains <code>structured: true</code> then it should be modified based on the
  519. <a href="structured_logging.html">structured logging documentation</a>.</p>
  520. <p>The <code>structured</code> and <code>drains</code> logging options are now deprecated and
  521. should be replaced by standard logging configuration of <code>handlers</code> and
  522. <code>formatters</code>.</p>
  523. <p>A future will release of Synapse will make using <code>structured: true</code> an
  524. error.</p>
  525. <h1 id="upgrading-to-v1220"><a class="header" href="#upgrading-to-v1220">Upgrading to v1.22.0</a></h1>
  526. <h2 id="thirdpartyeventrules-breaking-changes"><a class="header" href="#thirdpartyeventrules-breaking-changes">ThirdPartyEventRules breaking changes</a></h2>
  527. <p>This release introduces a backwards-incompatible change to modules
  528. making use of <code>ThirdPartyEventRules</code> in Synapse. If you make use of a
  529. module defined under the <code>third_party_event_rules</code> config option, please
  530. make sure it is updated to handle the below change:</p>
  531. <p>The <code>http_client</code> argument is no longer passed to modules as they are
  532. initialised. Instead, modules are expected to make use of the
  533. <code>http_client</code> property on the <code>ModuleApi</code> class. Modules are now passed
  534. a <code>module_api</code> argument during initialisation, which is an instance of
  535. <code>ModuleApi</code>. <code>ModuleApi</code> instances have a <code>http_client</code> property which
  536. acts the same as the <code>http_client</code> argument previously passed to
  537. <code>ThirdPartyEventRules</code> modules.</p>
  538. <h1 id="upgrading-to-v1210"><a class="header" href="#upgrading-to-v1210">Upgrading to v1.21.0</a></h1>
  539. <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>
  540. <p>The <a href="reverse_proxy.html">reverse proxy documentation</a>
  541. has been updated to include reverse proxy directives for
  542. <code>/_synapse/client/*</code> endpoints. As the user password reset flow now uses
  543. endpoints under this prefix, <strong>you must update your reverse proxy
  544. configurations for user password reset to work</strong>.</p>
  545. <p>Additionally, note that the <a href="workers.html">Synapse worker documentation</a> has been updated to</p>
  546. <p>: state that the <code>/_synapse/client/password_reset/email/submit_token</code>
  547. endpoint can be handled</p>
  548. <p>by all workers. If you make use of Synapse's worker feature, please
  549. update your reverse proxy configuration to reflect this change.</p>
  550. <h2 id="new-html-templates"><a class="header" href="#new-html-templates">New HTML templates</a></h2>
  551. <p>A new HTML template,
  552. <a href="https://github.com/matrix-org/synapse/blob/develop/synapse/res/templates/password_reset_confirmation.html">password_reset_confirmation.html</a>,
  553. has been added to the <code>synapse/res/templates</code> directory. If you are
  554. using a custom template directory, you may want to copy the template
  555. over and modify it.</p>
  556. <p>Note that as of v1.20.0, templates do not need to be included in custom
  557. template directories for Synapse to start. The default templates will be
  558. used if a custom template cannot be found.</p>
  559. <p>This page will appear to the user after clicking a password reset link
  560. that has been emailed to them.</p>
  561. <p>To complete password reset, the page must include a way to make a
  562. [POST]{.title-ref} request to
  563. <code>/_synapse/client/password_reset/{medium}/submit_token</code> with the query
  564. parameters from the original link, presented as a URL-encoded form. See
  565. the file itself for more details.</p>
  566. <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>
  567. <p>The <code>saml_error.html</code> template was removed from Synapse and replaced
  568. with the <code>sso_error.html</code> template. If your Synapse is configured to use
  569. SAML and a custom <code>sso_redirect_confirm_template_dir</code> configuration then
  570. any customisations of the <code>saml_error.html</code> template will need to be
  571. merged into the <code>sso_error.html</code> template. These templates are similar,
  572. but the parameters are slightly different:</p>
  573. <ul>
  574. <li>The <code>msg</code> parameter should be renamed to <code>error_description</code>.</li>
  575. <li>There is no longer a <code>code</code> parameter for the response code.</li>
  576. <li>A string <code>error</code> parameter is available that includes a short hint
  577. of why a user is seeing the error page.</li>
  578. </ul>
  579. <h1 id="upgrading-to-v1180"><a class="header" href="#upgrading-to-v1180">Upgrading to v1.18.0</a></h1>
  580. <h2 id="docker--py3title-ref-suffix-will-be-removed-in-future-versions"><a class="header" href="#docker--py3title-ref-suffix-will-be-removed-in-future-versions">Docker [-py3]{.title-ref} suffix will be removed in future versions</a></h2>
  581. <p>From 10th August 2020, we will no longer publish Docker images with the
  582. [-py3]{.title-ref} tag suffix. The images tagged with the
  583. [-py3]{.title-ref} suffix have been identical to the non-suffixed tags
  584. since release 0.99.0, and the suffix is obsolete.</p>
  585. <p>On 10th August, we will remove the [latest-py3]{.title-ref} tag.
  586. Existing per-release tags (such as [v1.18.0-py3]{.title-ref}) will not
  587. be removed, but no new [-py3]{.title-ref} tags will be added.</p>
  588. <p>Scripts relying on the [-py3]{.title-ref} suffix will need to be
  589. updated.</p>
  590. <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>
  591. <p>When setting up worker processes, we now recommend the use of a Redis
  592. server for replication. <strong>The old direct TCP connection method is
  593. deprecated and will be removed in a future release.</strong> See
  594. <a href="workers.html">workers</a> for more details.</p>
  595. <h1 id="upgrading-to-v1140"><a class="header" href="#upgrading-to-v1140">Upgrading to v1.14.0</a></h1>
  596. <p>This version includes a database update which is run as part of the
  597. upgrade, and which may take a couple of minutes in the case of a large
  598. server. Synapse will not respond to HTTP requests while this update is
  599. taking place.</p>
  600. <h1 id="upgrading-to-v1130"><a class="header" href="#upgrading-to-v1130">Upgrading to v1.13.0</a></h1>
  601. <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>
  602. <p>A bug was introduced in Synapse 1.4.0 which could cause the room
  603. directory to be incomplete or empty if Synapse was upgraded directly
  604. from v1.2.1 or earlier, to versions between v1.4.0 and v1.12.x.</p>
  605. <p>This will <em>not</em> be a problem for Synapse installations which were:</p>
  606. <p>: - created at v1.4.0 or later,
  607. - upgraded via v1.3.x, or
  608. - upgraded straight from v1.2.1 or earlier to v1.13.0 or later.</p>
  609. <p>If completeness of the room directory is a concern, installations which
  610. are affected can be repaired as follows:</p>
  611. <ol>
  612. <li>
  613. <p>Run the following sql from a [psql]{.title-ref} or
  614. [sqlite3]{.title-ref} console:</p>
  615. <pre><code class="language-sql">INSERT INTO background_updates (update_name, progress_json, depends_on) VALUES
  616. ('populate_stats_process_rooms', '{}', 'current_state_events_membership');
  617. INSERT INTO background_updates (update_name, progress_json, depends_on) VALUES
  618. ('populate_stats_process_users', '{}', 'populate_stats_process_rooms');
  619. </code></pre>
  620. </li>
  621. <li>
  622. <p>Restart synapse.</p>
  623. </li>
  624. </ol>
  625. <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>
  626. <p>New templates (<code>sso_auth_confirm.html</code>, <code>sso_auth_success.html</code>, and
  627. <code>sso_account_deactivated.html</code>) were added to Synapse. If your Synapse
  628. is configured to use SSO and a custom
  629. <code>sso_redirect_confirm_template_dir</code> configuration then these templates
  630. will need to be copied from
  631. <a href="synapse/res/templates">synapse/res/templates</a> into that directory.</p>
  632. <h2 id="synapse-sso-plugins-method-deprecation"><a class="header" href="#synapse-sso-plugins-method-deprecation">Synapse SSO Plugins Method Deprecation</a></h2>
  633. <p>Plugins using the <code>complete_sso_login</code> method of
  634. <code>synapse.module_api.ModuleApi</code> should update to using the async/await
  635. version <code>complete_sso_login_async</code> which includes additional checks. The
  636. non-async version is considered deprecated.</p>
  637. <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>
  638. <p>v1.13.0 includes a lot of large changes. If something problematic
  639. occurs, you may want to roll-back to a previous version of Synapse.
  640. Because v1.13.0 also includes a new database schema version, reverting
  641. that version is also required alongside the generic rollback
  642. instructions mentioned above. In short, to roll back to v1.12.4 you need
  643. to:</p>
  644. <ol>
  645. <li>
  646. <p>Stop the server</p>
  647. </li>
  648. <li>
  649. <p>Decrease the schema version in the database:</p>
  650. <pre><code class="language-sql">UPDATE schema_version SET version = 57;
  651. </code></pre>
  652. </li>
  653. <li>
  654. <p>Downgrade Synapse by following the instructions for your
  655. installation method in the &quot;Rolling back to older versions&quot;
  656. section above.</p>
  657. </li>
  658. </ol>
  659. <h1 id="upgrading-to-v1120"><a class="header" href="#upgrading-to-v1120">Upgrading to v1.12.0</a></h1>
  660. <p>This version includes a database update which is run as part of the
  661. upgrade, and which may take some time (several hours in the case of a
  662. large server). Synapse will not respond to HTTP requests while this
  663. update is taking place.</p>
  664. <p>This is only likely to be a problem in the case of a server which is
  665. participating in many rooms.</p>
  666. <ol start="0">
  667. <li>
  668. <p>As with all upgrades, it is recommended that you have a recent
  669. backup of your database which can be used for recovery in the event
  670. of any problems.</p>
  671. </li>
  672. <li>
  673. <p>As an initial check to see if you will be affected, you can try
  674. running the following query from the [psql]{.title-ref} or
  675. [sqlite3]{.title-ref} console. It is safe to run it while Synapse is
  676. still running.</p>
  677. <pre><code class="language-sql">SELECT MAX(q.v) FROM (
  678. SELECT (
  679. SELECT ej.json AS v
  680. FROM state_events se INNER JOIN event_json ej USING (event_id)
  681. WHERE se.room_id=rooms.room_id AND se.type='m.room.create' AND se.state_key=''
  682. LIMIT 1
  683. ) FROM rooms WHERE rooms.room_version IS NULL
  684. ) q;
  685. </code></pre>
  686. <p>This query will take about the same amount of time as the upgrade
  687. process: ie, if it takes 5 minutes, then it is likely that Synapse
  688. will be unresponsive for 5 minutes during the upgrade.</p>
  689. <p>If you consider an outage of this duration to be acceptable, no
  690. further action is necessary and you can simply start Synapse 1.12.0.</p>
  691. <p>If you would prefer to reduce the downtime, continue with the steps
  692. below.</p>
  693. </li>
  694. <li>
  695. <p>The easiest workaround for this issue is to manually create a new
  696. index before upgrading. On PostgreSQL, his can be done as follows:</p>
  697. <pre><code class="language-sql">CREATE INDEX CONCURRENTLY tmp_upgrade_1_12_0_index
  698. ON state_events(room_id) WHERE type = 'm.room.create';
  699. </code></pre>
  700. <p>The above query may take some time, but is also safe to run while
  701. Synapse is running.</p>
  702. <p>We assume that no SQLite users have databases large enough to be
  703. affected. If you <em>are</em> affected, you can run a similar query,
  704. omitting the <code>CONCURRENTLY</code> keyword. Note however that this
  705. operation may in itself cause Synapse to stop running for some time.
  706. Synapse admins are reminded that <a href="postgres.html">SQLite is not recommended for use
  707. outside a test environment</a>.</p>
  708. </li>
  709. <li>
  710. <p>Once the index has been created, the <code>SELECT</code> query in step 1 above
  711. should complete quickly. It is therefore safe to upgrade to Synapse
  712. 1.12.0.</p>
  713. </li>
  714. <li>
  715. <p>Once Synapse 1.12.0 has successfully started and is responding to
  716. HTTP requests, the temporary index can be removed:</p>
  717. <pre><code class="language-sql">DROP INDEX tmp_upgrade_1_12_0_index;
  718. </code></pre>
  719. </li>
  720. </ol>
  721. <h1 id="upgrading-to-v1100"><a class="header" href="#upgrading-to-v1100">Upgrading to v1.10.0</a></h1>
  722. <p>Synapse will now log a warning on start up if used with a PostgreSQL
  723. database that has a non-recommended locale set.</p>
  724. <p>See <a href="postgres.html">Postgres</a> for details.</p>
  725. <h1 id="upgrading-to-v180"><a class="header" href="#upgrading-to-v180">Upgrading to v1.8.0</a></h1>
  726. <p>Specifying a <code>log_file</code> config option will now cause Synapse to refuse
  727. to start, and should be replaced by with the <code>log_config</code> option.
  728. Support for the <code>log_file</code> option was removed in v1.3.0 and has since
  729. had no effect.</p>
  730. <h1 id="upgrading-to-v170"><a class="header" href="#upgrading-to-v170">Upgrading to v1.7.0</a></h1>
  731. <p>In an attempt to configure Synapse in a privacy preserving way, the
  732. default behaviours of <code>allow_public_rooms_without_auth</code> and
  733. <code>allow_public_rooms_over_federation</code> have been inverted. This means that
  734. by default, only authenticated users querying the Client/Server API will
  735. be able to query the room directory, and relatedly that the server will
  736. not share room directory information with other servers over federation.</p>
  737. <p>If your installation does not explicitly set these settings one way or
  738. the other and you want either setting to be <code>true</code> then it will
  739. necessary to update your homeserver configuration file accordingly.</p>
  740. <p>For more details on the surrounding context see our
  741. <a href="https://matrix.org/blog/2019/11/09/avoiding-unwelcome-visitors-on-private-matrix-servers">explainer</a>.</p>
  742. <h1 id="upgrading-to-v150"><a class="header" href="#upgrading-to-v150">Upgrading to v1.5.0</a></h1>
  743. <p>This release includes a database migration which may take several
  744. minutes to complete if there are a large number (more than a million or
  745. so) of entries in the <code>devices</code> table. This is only likely to a be a
  746. problem on very large installations.</p>
  747. <h1 id="upgrading-to-v140"><a class="header" href="#upgrading-to-v140">Upgrading to v1.4.0</a></h1>
  748. <h2 id="new-custom-templates"><a class="header" href="#new-custom-templates">New custom templates</a></h2>
  749. <p>If you have configured a custom template directory with the
  750. <code>email.template_dir</code> option, be aware that there are new templates
  751. regarding registration and threepid management (see below) that must be
  752. included.</p>
  753. <ul>
  754. <li><code>registration.html</code> and <code>registration.txt</code></li>
  755. <li><code>registration_success.html</code> and <code>registration_failure.html</code></li>
  756. <li><code>add_threepid.html</code> and <code>add_threepid.txt</code></li>
  757. <li><code>add_threepid_failure.html</code> and <code>add_threepid_success.html</code></li>
  758. </ul>
  759. <p>Synapse will expect these files to exist inside the configured template
  760. directory, and <strong>will fail to start</strong> if they are absent. To view the
  761. default templates, see
  762. <a href="https://github.com/matrix-org/synapse/tree/master/synapse/res/templates">synapse/res/templates</a>.</p>
  763. <h2 id="3pid-verification-changes"><a class="header" href="#3pid-verification-changes">3pid verification changes</a></h2>
  764. <p><strong>Note: As of this release, users will be unable to add phone numbers or
  765. email addresses to their accounts, without changes to the Synapse
  766. configuration. This includes adding an email address during
  767. registration.</strong></p>
  768. <p>It is possible for a user to associate an email address or phone number
  769. with their account, for a number of reasons:</p>
  770. <ul>
  771. <li>for use when logging in, as an alternative to the user id.</li>
  772. <li>in the case of email, as an alternative contact to help with account
  773. recovery.</li>
  774. <li>in the case of email, to receive notifications of missed messages.</li>
  775. </ul>
  776. <p>Before an email address or phone number can be added to a user's
  777. account, or before such an address is used to carry out a
  778. password-reset, Synapse must confirm the operation with the owner of the
  779. email address or phone number. It does this by sending an email or text
  780. giving the user a link or token to confirm receipt. This process is
  781. known as '3pid verification'. ('3pid', or 'threepid', stands for
  782. third-party identifier, and we use it to refer to external identifiers
  783. such as email addresses and phone numbers.)</p>
  784. <p>Previous versions of Synapse delegated the task of 3pid verification to
  785. an identity server by default. In most cases this server is <code>vector.im</code>
  786. or <code>matrix.org</code>.</p>
  787. <p>In Synapse 1.4.0, for security and privacy reasons, the homeserver will
  788. no longer delegate this task to an identity server by default. Instead,
  789. the server administrator will need to explicitly decide how they would
  790. like the verification messages to be sent.</p>
  791. <p>In the medium term, the <code>vector.im</code> and <code>matrix.org</code> identity servers
  792. will disable support for delegated 3pid verification entirely. However,
  793. in order to ease the transition, they will retain the capability for a
  794. limited period. Delegated email verification will be disabled on Monday
  795. 2nd December 2019 (giving roughly 2 months notice). Disabling delegated
  796. SMS verification will follow some time after that once SMS verification
  797. support lands in Synapse.</p>
  798. <p>Once delegated 3pid verification support has been disabled in the
  799. <code>vector.im</code> and <code>matrix.org</code> identity servers, all Synapse versions that
  800. depend on those instances will be unable to verify email and phone
  801. numbers through them. There are no imminent plans to remove delegated
  802. 3pid verification from Sydent generally. (Sydent is the identity server
  803. project that backs the <code>vector.im</code> and <code>matrix.org</code> instances).</p>
  804. <h3 id="email"><a class="header" href="#email">Email</a></h3>
  805. <p>Following upgrade, to continue verifying email (e.g. as part of the
  806. registration process), admins can either:-</p>
  807. <ul>
  808. <li>Configure Synapse to use an email server.</li>
  809. <li>Run or choose an identity server which allows delegated email
  810. verification and delegate to it.</li>
  811. </ul>
  812. <h4 id="configure-smtp-in-synapse"><a class="header" href="#configure-smtp-in-synapse">Configure SMTP in Synapse</a></h4>
  813. <p>To configure an SMTP server for Synapse, modify the configuration
  814. section headed <code>email</code>, and be sure to have at least the
  815. <code>smtp_host, smtp_port</code> and <code>notif_from</code> fields filled out.</p>
  816. <p>You may also need to set <code>smtp_user</code>, <code>smtp_pass</code>, and
  817. <code>require_transport_security</code>.</p>
  818. <p>See the <a href="usage/configuration/homeserver_sample_config.html">sample configuration file</a>
  819. for more details on these settings.</p>
  820. <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>
  821. <p>Some admins will wish to continue using email verification as part of
  822. the registration process, but will not immediately have an appropriate
  823. SMTP server at hand.</p>
  824. <p>To this end, we will continue to support email verification delegation
  825. via the <code>vector.im</code> and <code>matrix.org</code> identity servers for two months.
  826. Support for delegated email verification will be disabled on Monday 2nd
  827. December.</p>
  828. <p>The <code>account_threepid_delegates</code> dictionary defines whether the
  829. homeserver should delegate an external server (typically an <a href="https://matrix.org/docs/spec/identity_service/r0.2.1">identity
  830. server</a>) to handle
  831. sending confirmation messages via email and SMS.</p>
  832. <p>So to delegate email verification, in <code>homeserver.yaml</code>, set
  833. <code>account_threepid_delegates.email</code> to the base URL of an identity
  834. server. For example:</p>
  835. <pre><code class="language-yaml">account_threepid_delegates:
  836. email: https://example.com # Delegate email sending to example.com
  837. </code></pre>
  838. <p>Note that <code>account_threepid_delegates.email</code> replaces the deprecated
  839. <code>email.trust_identity_server_for_password_resets</code>: if
  840. <code>email.trust_identity_server_for_password_resets</code> is set to <code>true</code>, and
  841. <code>account_threepid_delegates.email</code> is not set, then the first entry in
  842. <code>trusted_third_party_id_servers</code> will be used as the
  843. <code>account_threepid_delegate</code> for email. This is to ensure compatibility
  844. with existing Synapse installs that set up external server handling for
  845. these tasks before v1.4.0. If
  846. <code>email.trust_identity_server_for_password_resets</code> is <code>true</code> and no
  847. trusted identity server domains are configured, Synapse will report an
  848. error and refuse to start.</p>
  849. <p>If <code>email.trust_identity_server_for_password_resets</code> is <code>false</code> or
  850. absent and no <code>email</code> delegate is configured in
  851. <code>account_threepid_delegates</code>, then Synapse will send email verification
  852. messages itself, using the configured SMTP server (see above). that
  853. type.</p>
  854. <h3 id="phone-numbers"><a class="header" href="#phone-numbers">Phone numbers</a></h3>
  855. <p>Synapse does not support phone-number verification itself, so the only
  856. way to maintain the ability for users to add phone numbers to their
  857. accounts will be by continuing to delegate phone number verification to
  858. the <code>matrix.org</code> and <code>vector.im</code> identity servers (or another identity
  859. server that supports SMS sending).</p>
  860. <p>The <code>account_threepid_delegates</code> dictionary defines whether the
  861. homeserver should delegate an external server (typically an <a href="https://matrix.org/docs/spec/identity_service/r0.2.1">identity
  862. server</a>) to handle
  863. sending confirmation messages via email and SMS.</p>
  864. <p>So to delegate phone number verification, in <code>homeserver.yaml</code>, set
  865. <code>account_threepid_delegates.msisdn</code> to the base URL of an identity
  866. server. For example:</p>
  867. <pre><code class="language-yaml">account_threepid_delegates:
  868. msisdn: https://example.com # Delegate sms sending to example.com
  869. </code></pre>
  870. <p>The <code>matrix.org</code> and <code>vector.im</code> identity servers will continue to
  871. support delegated phone number verification via SMS until such time as
  872. it is possible for admins to configure their servers to perform phone
  873. number verification directly. More details will follow in a future
  874. release.</p>
  875. <h2 id="rolling-back-to-v131"><a class="header" href="#rolling-back-to-v131">Rolling back to v1.3.1</a></h2>
  876. <p>If you encounter problems with v1.4.0, it should be possible to roll
  877. back to v1.3.1, subject to the following:</p>
  878. <ul>
  879. <li>
  880. <p>The 'room statistics' engine was heavily reworked in this release
  881. (see <a href="https://github.com/matrix-org/synapse/pull/5971">#5971</a>),
  882. including significant changes to the database schema, which are not
  883. easily reverted. This will cause the room statistics engine to stop
  884. updating when you downgrade.</p>
  885. <p>The room statistics are essentially unused in v1.3.1 (in future
  886. versions of Synapse, they will be used to populate the room
  887. directory), so there should be no loss of functionality. However,
  888. the statistics engine will write errors to the logs, which can be
  889. avoided by setting the following in <code>homeserver.yaml</code>:</p>
  890. <pre><code class="language-yaml">stats:
  891. enabled: false
  892. </code></pre>
  893. <p>Don't forget to re-enable it when you upgrade again, in preparation
  894. for its use in the room directory!</p>
  895. </li>
  896. </ul>
  897. <h1 id="upgrading-to-v120"><a class="header" href="#upgrading-to-v120">Upgrading to v1.2.0</a></h1>
  898. <p>Some counter metrics have been renamed, with the old names deprecated.
  899. See <a href="metrics-howto.html#renaming-of-metrics--deprecation-of-old-names-in-12">the metrics
  900. documentation</a>
  901. for details.</p>
  902. <h1 id="upgrading-to-v110"><a class="header" href="#upgrading-to-v110">Upgrading to v1.1.0</a></h1>
  903. <p>Synapse v1.1.0 removes support for older Python and PostgreSQL versions,
  904. as outlined in <a href="https://matrix.org/blog/2019/04/08/synapse-deprecating-postgres-9-4-and-python-2-x">our deprecation
  905. notice</a>.</p>
  906. <h2 id="minimum-python-version"><a class="header" href="#minimum-python-version">Minimum Python Version</a></h2>
  907. <p>Synapse v1.1.0 has a minimum Python requirement of Python 3.5. Python
  908. 3.6 or Python 3.7 are recommended as they have improved internal string
  909. handling, significantly reducing memory usage.</p>
  910. <p>If you use current versions of the Matrix.org-distributed Debian
  911. packages or Docker images, action is not required.</p>
  912. <p>If you install Synapse in a Python virtual environment, please see
  913. &quot;Upgrading to v0.34.0&quot; for notes on setting up a new virtualenv under
  914. Python 3.</p>
  915. <h2 id="minimum-postgresql-version"><a class="header" href="#minimum-postgresql-version">Minimum PostgreSQL Version</a></h2>
  916. <p>If using PostgreSQL under Synapse, you will need to use PostgreSQL 9.5
  917. or above. Please see the <a href="https://www.postgresql.org/docs/11/upgrading.html">PostgreSQL
  918. documentation</a> for
  919. more details on upgrading your database.</p>
  920. <h1 id="upgrading-to-v10"><a class="header" href="#upgrading-to-v10">Upgrading to v1.0</a></h1>
  921. <h2 id="validation-of-tls-certificates"><a class="header" href="#validation-of-tls-certificates">Validation of TLS certificates</a></h2>
  922. <p>Synapse v1.0 is the first release to enforce validation of TLS
  923. certificates for the federation API. It is therefore essential that your
  924. certificates are correctly configured. See the
  925. <a href="MSC1711_certificates_FAQ.html">FAQ</a> for more information.</p>
  926. <p>Note, v1.0 installations will also no longer be able to federate with
  927. servers that have not correctly configured their certificates.</p>
  928. <p>In rare cases, it may be desirable to disable certificate checking: for
  929. example, it might be essential to be able to federate with a given
  930. legacy server in a closed federation. This can be done in one of two
  931. ways:-</p>
  932. <ul>
  933. <li>Configure the global switch <code>federation_verify_certificates</code> to
  934. <code>false</code>.</li>
  935. <li>Configure a whitelist of server domains to trust via
  936. <code>federation_certificate_verification_whitelist</code>.</li>
  937. </ul>
  938. <p>See the <a href="usage/configuration/homeserver_sample_config.html">sample configuration file</a>
  939. for more details on these settings.</p>
  940. <h2 id="email-1"><a class="header" href="#email-1">Email</a></h2>
  941. <p>When a user requests a password reset, Synapse will send an email to the
  942. user to confirm the request.</p>
  943. <p>Previous versions of Synapse delegated the job of sending this email to
  944. an identity server. If the identity server was somehow malicious or
  945. became compromised, it would be theoretically possible to hijack an
  946. account through this means.</p>
  947. <p>Therefore, by default, Synapse v1.0 will send the confirmation email
  948. itself. If Synapse is not configured with an SMTP server, password reset
  949. via email will be disabled.</p>
  950. <p>To configure an SMTP server for Synapse, modify the configuration
  951. section headed <code>email</code>, and be sure to have at least the <code>smtp_host</code>,
  952. <code>smtp_port</code> and <code>notif_from</code> fields filled out. You may also need to set
  953. <code>smtp_user</code>, <code>smtp_pass</code>, and <code>require_transport_security</code>.</p>
  954. <p>If you are absolutely certain that you wish to continue using an
  955. identity server for password resets, set
  956. <code>trust_identity_server_for_password_resets</code> to <code>true</code>.</p>
  957. <p>See the <a href="usage/configuration/homeserver_sample_config.html">sample configuration file</a>
  958. for more details on these settings.</p>
  959. <h2 id="new-email-templates"><a class="header" href="#new-email-templates">New email templates</a></h2>
  960. <p>Some new templates have been added to the default template directory for the purpose of
  961. the homeserver sending its own password reset emails. If you have configured a
  962. custom <code>template_dir</code> in your Synapse config, these files will need to be added.</p>
  963. <p><code>password_reset.html</code> and <code>password_reset.txt</code> are HTML and plain text
  964. templates respectively that contain the contents of what will be emailed
  965. to the user upon attempting to reset their password via email.
  966. <code>password_reset_success.html</code> and <code>password_reset_failure.html</code> are HTML
  967. files that the content of which (assuming no redirect URL is set) will
  968. be shown to the user after they attempt to click the link in the email
  969. sent to them.</p>
  970. <h1 id="upgrading-to-v0990"><a class="header" href="#upgrading-to-v0990">Upgrading to v0.99.0</a></h1>
  971. <p>Please be aware that, before Synapse v1.0 is released around March 2019,
  972. you will need to replace any self-signed certificates with those
  973. verified by a root CA. Information on how to do so can be found at the
  974. ACME docs.</p>
  975. <p>For more information on configuring TLS certificates see the
  976. <a href="MSC1711_certificates_FAQ.html">FAQ</a>.</p>
  977. <h1 id="upgrading-to-v0340"><a class="header" href="#upgrading-to-v0340">Upgrading to v0.34.0</a></h1>
  978. <ol>
  979. <li>
  980. <p>This release is the first to fully support Python 3. Synapse will
  981. now run on Python versions 3.5, or 3.6 (as well as 2.7). We
  982. recommend switching to Python 3, as it has been shown to give
  983. performance improvements.</p>
  984. <p>For users who have installed Synapse into a virtualenv, we recommend
  985. doing this by creating a new virtualenv. For example:</p>
  986. <pre><code>virtualenv -p python3 ~/synapse/env3
  987. source ~/synapse/env3/bin/activate
  988. pip install matrix-synapse
  989. </code></pre>
  990. <p>You can then start synapse as normal, having activated the new
  991. virtualenv:</p>
  992. <pre><code>cd ~/synapse
  993. source env3/bin/activate
  994. synctl start
  995. </code></pre>
  996. <p>Users who have installed from distribution packages should see the
  997. relevant package documentation. See below for notes on Debian
  998. packages.</p>
  999. <ul>
  1000. <li>
  1001. <p>When upgrading to Python 3, you <strong>must</strong> make sure that your log
  1002. files are configured as UTF-8, by adding <code>encoding: utf8</code> to the
  1003. <code>RotatingFileHandler</code> configuration (if you have one) in your
  1004. <code>&lt;server&gt;.log.config</code> file. For example, if your <code>log.config</code>
  1005. file contains:</p>
  1006. <pre><code>handlers:
  1007. file:
  1008. class: logging.handlers.RotatingFileHandler
  1009. formatter: precise
  1010. filename: homeserver.log
  1011. maxBytes: 104857600
  1012. backupCount: 10
  1013. filters: [context]
  1014. console:
  1015. class: logging.StreamHandler
  1016. formatter: precise
  1017. filters: [context]
  1018. </code></pre>
  1019. <p>Then you should update this to be:</p>
  1020. <pre><code>handlers:
  1021. file:
  1022. class: logging.handlers.RotatingFileHandler
  1023. formatter: precise
  1024. filename: homeserver.log
  1025. maxBytes: 104857600
  1026. backupCount: 10
  1027. filters: [context]
  1028. encoding: utf8
  1029. console:
  1030. class: logging.StreamHandler
  1031. formatter: precise
  1032. filters: [context]
  1033. </code></pre>
  1034. <p>There is no need to revert this change if downgrading to
  1035. Python 2.</p>
  1036. </li>
  1037. </ul>
  1038. <p>We are also making available Debian packages which will run Synapse
  1039. on Python 3. You can switch to these packages with
  1040. <code>apt-get install matrix-synapse-py3</code>, however, please read
  1041. <a href="https://github.com/matrix-org/synapse/blob/release-v0.34.0/debian/NEWS">debian/NEWS</a>
  1042. before doing so. The existing <code>matrix-synapse</code> packages will
  1043. continue to use Python 2 for the time being.</p>
  1044. </li>
  1045. <li>
  1046. <p>This release removes the <code>riot.im</code> from the default list of trusted
  1047. identity servers.</p>
  1048. <p>If <code>riot.im</code> is in your homeserver's list of
  1049. <code>trusted_third_party_id_servers</code>, you should remove it. It was added
  1050. in case a hypothetical future identity server was put there. If you
  1051. don't remove it, users may be unable to deactivate their accounts.</p>
  1052. </li>
  1053. <li>
  1054. <p>This release no longer installs the (unmaintained) Matrix Console
  1055. web client as part of the default installation. It is possible to
  1056. re-enable it by installing it separately and setting the
  1057. <code>web_client_location</code> config option, but please consider switching
  1058. to another client.</p>
  1059. </li>
  1060. </ol>
  1061. <h1 id="upgrading-to-v0337"><a class="header" href="#upgrading-to-v0337">Upgrading to v0.33.7</a></h1>
  1062. <p>This release removes the example email notification templates from
  1063. <code>res/templates</code> (they are now internal to the python package). This
  1064. should only affect you if you (a) deploy your Synapse instance from a
  1065. git checkout or a github snapshot URL, and (b) have email notifications
  1066. enabled.</p>
  1067. <p>If you have email notifications enabled, you should ensure that
  1068. <code>email.template_dir</code> is either configured to point at a directory where
  1069. you have installed customised templates, or leave it unset to use the
  1070. default templates.</p>
  1071. <h1 id="upgrading-to-v0273"><a class="header" href="#upgrading-to-v0273">Upgrading to v0.27.3</a></h1>
  1072. <p>This release expands the anonymous usage stats sent if the opt-in
  1073. <code>report_stats</code> configuration is set to <code>true</code>. We now capture RSS memory
  1074. and cpu use at a very coarse level. This requires administrators to
  1075. install the optional <code>psutil</code> python module.</p>
  1076. <p>We would appreciate it if you could assist by ensuring this module is
  1077. available and <code>report_stats</code> is enabled. This will let us see if
  1078. performance changes to synapse are having an impact to the general
  1079. community.</p>
  1080. <h1 id="upgrading-to-v0150"><a class="header" href="#upgrading-to-v0150">Upgrading to v0.15.0</a></h1>
  1081. <p>If you want to use the new URL previewing API
  1082. (<code>/_matrix/media/r0/preview_url</code>) then you have to explicitly enable it
  1083. in the config and update your dependencies dependencies. See README.rst
  1084. for details.</p>
  1085. <h1 id="upgrading-to-v0110"><a class="header" href="#upgrading-to-v0110">Upgrading to v0.11.0</a></h1>
  1086. <p>This release includes the option to send anonymous usage stats to
  1087. matrix.org, and requires that administrators explictly opt in or out by
  1088. setting the <code>report_stats</code> option to either <code>true</code> or <code>false</code>.</p>
  1089. <p>We would really appreciate it if you could help our project out by
  1090. reporting anonymized usage statistics from your homeserver. Only very
  1091. basic aggregate data (e.g. number of users) will be reported, but it
  1092. helps us to track the growth of the Matrix community, and helps us to
  1093. make Matrix a success, as well as to convince other networks that they
  1094. should peer with us.</p>
  1095. <h1 id="upgrading-to-v090"><a class="header" href="#upgrading-to-v090">Upgrading to v0.9.0</a></h1>
  1096. <p>Application services have had a breaking API change in this version.</p>
  1097. <p>They can no longer register themselves with a home server using the AS
  1098. HTTP API. This decision was made because a compromised application
  1099. service with free reign to register any regex in effect grants full
  1100. read/write access to the home server if a regex of <code>.*</code> is used. An
  1101. attack where a compromised AS re-registers itself with <code>.*</code> was deemed
  1102. too big of a security risk to ignore, and so the ability to register
  1103. with the HS remotely has been removed.</p>
  1104. <p>It has been replaced by specifying a list of application service
  1105. registrations in <code>homeserver.yaml</code>:</p>
  1106. <pre><code>app_service_config_files: [&quot;registration-01.yaml&quot;, &quot;registration-02.yaml&quot;]
  1107. </code></pre>
  1108. <p>Where <code>registration-01.yaml</code> looks like:</p>
  1109. <pre><code>url: &lt;String&gt; # e.g. &quot;https://my.application.service.com&quot;
  1110. as_token: &lt;String&gt;
  1111. hs_token: &lt;String&gt;
  1112. sender_localpart: &lt;String&gt; # This is a new field which denotes the user_id localpart when using the AS token
  1113. namespaces:
  1114. users:
  1115. - exclusive: &lt;Boolean&gt;
  1116. regex: &lt;String&gt; # e.g. &quot;@prefix_.*&quot;
  1117. aliases:
  1118. - exclusive: &lt;Boolean&gt;
  1119. regex: &lt;String&gt;
  1120. rooms:
  1121. - exclusive: &lt;Boolean&gt;
  1122. regex: &lt;String&gt;
  1123. </code></pre>
  1124. <h1 id="upgrading-to-v080"><a class="header" href="#upgrading-to-v080">Upgrading to v0.8.0</a></h1>
  1125. <p>Servers which use captchas will need to add their public key to:</p>
  1126. <pre><code>static/client/register/register_config.js
  1127. window.matrixRegistrationConfig = {
  1128. recaptcha_public_key: &quot;YOUR_PUBLIC_KEY&quot;
  1129. };
  1130. </code></pre>
  1131. <p>This is required in order to support registration fallback (typically
  1132. used on mobile devices).</p>
  1133. <h1 id="upgrading-to-v070"><a class="header" href="#upgrading-to-v070">Upgrading to v0.7.0</a></h1>
  1134. <p>New dependencies are:</p>
  1135. <ul>
  1136. <li>pydenticon</li>
  1137. <li>simplejson</li>
  1138. <li>syutil</li>
  1139. <li>matrix-angular-sdk</li>
  1140. </ul>
  1141. <p>To pull in these dependencies in a virtual env, run:</p>
  1142. <pre><code>python synapse/python_dependencies.py | xargs -n 1 pip install
  1143. </code></pre>
  1144. <h1 id="upgrading-to-v060"><a class="header" href="#upgrading-to-v060">Upgrading to v0.6.0</a></h1>
  1145. <p>To pull in new dependencies, run:</p>
  1146. <pre><code>python setup.py develop --user
  1147. </code></pre>
  1148. <p>This update includes a change to the database schema. To upgrade you
  1149. first need to upgrade the database by running:</p>
  1150. <pre><code>python scripts/upgrade_db_to_v0.6.0.py &lt;db&gt; &lt;server_name&gt; &lt;signing_key&gt;
  1151. </code></pre>
  1152. <p>Where [<db>]{.title-ref} is the location of the database,
  1153. [&lt;server_name&gt;]{.title-ref} is the server name as specified in the
  1154. synapse configuration, and [&lt;signing_key&gt;]{.title-ref} is the location
  1155. of the signing key as specified in the synapse configuration.</p>
  1156. <p>This may take some time to complete. Failures of signatures and content
  1157. hashes can safely be ignored.</p>
  1158. <h1 id="upgrading-to-v051"><a class="header" href="#upgrading-to-v051">Upgrading to v0.5.1</a></h1>
  1159. <p>Depending on precisely when you installed v0.5.0 you may have ended up
  1160. with a stale release of the reference matrix webclient installed as a
  1161. python module. To uninstall it and ensure you are depending on the
  1162. latest module, please run:</p>
  1163. <pre><code>$ pip uninstall syweb
  1164. </code></pre>
  1165. <h1 id="upgrading-to-v050"><a class="header" href="#upgrading-to-v050">Upgrading to v0.5.0</a></h1>
  1166. <p>The webclient has been split out into a seperate repository/pacakage in
  1167. this release. Before you restart your homeserver you will need to pull
  1168. in the webclient package by running:</p>
  1169. <pre><code>python setup.py develop --user
  1170. </code></pre>
  1171. <p>This release completely changes the database schema and so requires
  1172. upgrading it before starting the new version of the homeserver.</p>
  1173. <p>The script &quot;database-prepare-for-0.5.0.sh&quot; should be used to upgrade
  1174. the database. This will save all user information, such as logins and
  1175. profiles, but will otherwise purge the database. This includes messages,
  1176. which rooms the home server was a member of and room alias mappings.</p>
  1177. <p>If you would like to keep your history, please take a copy of your
  1178. database file and ask for help in #matrix:matrix.org. The upgrade
  1179. process is, unfortunately, non trivial and requires human intervention
  1180. to resolve any resulting conflicts during the upgrade process.</p>
  1181. <p>Before running the command the homeserver should be first completely
  1182. shutdown. To run it, simply specify the location of the database, e.g.:</p>
  1183. <blockquote>
  1184. <p>./scripts/database-prepare-for-0.5.0.sh &quot;homeserver.db&quot;</p>
  1185. </blockquote>
  1186. <p>Once this has successfully completed it will be safe to restart the
  1187. homeserver. You may notice that the homeserver takes a few seconds
  1188. longer to restart than usual as it reinitializes the database.</p>
  1189. <p>On startup of the new version, users can either rejoin remote rooms
  1190. using room aliases or by being reinvited. Alternatively, if any other
  1191. homeserver sends a message to a room that the homeserver was previously
  1192. in the local HS will automatically rejoin the room.</p>
  1193. <h1 id="upgrading-to-v040"><a class="header" href="#upgrading-to-v040">Upgrading to v0.4.0</a></h1>
  1194. <p>This release needs an updated syutil version. Run:</p>
  1195. <pre><code>python setup.py develop
  1196. </code></pre>
  1197. <p>You will also need to upgrade your configuration as the signing key
  1198. format has changed. Run:</p>
  1199. <pre><code>python -m synapse.app.homeserver --config-path &lt;CONFIG&gt; --generate-config
  1200. </code></pre>
  1201. <h1 id="upgrading-to-v030"><a class="header" href="#upgrading-to-v030">Upgrading to v0.3.0</a></h1>
  1202. <p>This registration API now closely matches the login API. This introduces
  1203. a bit more backwards and forwards between the HS and the client, but
  1204. this improves the overall flexibility of the API. You can now GET on
  1205. /register to retrieve a list of valid registration flows. Upon choosing
  1206. one, they are submitted in the same way as login, e.g:</p>
  1207. <pre><code>{
  1208. type: m.login.password,
  1209. user: foo,
  1210. password: bar
  1211. }
  1212. </code></pre>
  1213. <p>The default HS supports 2 flows, with and without Identity Server email
  1214. authentication. Enabling captcha on the HS will add in an extra step to
  1215. all flows: <code>m.login.recaptcha</code> which must be completed before you can
  1216. transition to the next stage. There is a new login type:
  1217. <code>m.login.email.identity</code> which contains the <code>threepidCreds</code> key which
  1218. were previously sent in the original register request. For more
  1219. information on this, see the specification.</p>
  1220. <h2 id="web-client"><a class="header" href="#web-client">Web Client</a></h2>
  1221. <p>The VoIP specification has changed between v0.2.0 and v0.3.0. Users
  1222. should refresh any browser tabs to get the latest web client code. Users
  1223. on v0.2.0 of the web client will not be able to call those on v0.3.0 and
  1224. vice versa.</p>
  1225. <h1 id="upgrading-to-v020"><a class="header" href="#upgrading-to-v020">Upgrading to v0.2.0</a></h1>
  1226. <p>The home server now requires setting up of SSL config before it can run.
  1227. To automatically generate default config use:</p>
  1228. <pre><code>$ python synapse/app/homeserver.py \
  1229. --server-name machine.my.domain.name \
  1230. --bind-port 8448 \
  1231. --config-path homeserver.config \
  1232. --generate-config
  1233. </code></pre>
  1234. <p>This config can be edited if desired, for example to specify a different
  1235. SSL certificate to use. Once done you can run the home server using:</p>
  1236. <pre><code>$ python synapse/app/homeserver.py --config-path homeserver.config
  1237. </code></pre>
  1238. <p>See the README.rst for more information.</p>
  1239. <p>Also note that some config options have been renamed, including:</p>
  1240. <ul>
  1241. <li>&quot;host&quot; to &quot;server-name&quot;</li>
  1242. <li>&quot;database&quot; to &quot;database-path&quot;</li>
  1243. <li>&quot;port&quot; to &quot;bind-port&quot; and &quot;unsecure-port&quot;</li>
  1244. </ul>
  1245. <h1 id="upgrading-to-v001"><a class="header" href="#upgrading-to-v001">Upgrading to v0.0.1</a></h1>
  1246. <p>This release completely changes the database schema and so requires
  1247. upgrading it before starting the new version of the homeserver.</p>
  1248. <p>The script &quot;database-prepare-for-0.0.1.sh&quot; should be used to upgrade
  1249. the database. This will save all user information, such as logins and
  1250. profiles, but will otherwise purge the database. This includes messages,
  1251. which rooms the home server was a member of and room alias mappings.</p>
  1252. <p>Before running the command the homeserver should be first completely
  1253. shutdown. To run it, simply specify the location of the database, e.g.:</p>
  1254. <blockquote>
  1255. <p>./scripts/database-prepare-for-0.0.1.sh &quot;homeserver.db&quot;</p>
  1256. </blockquote>
  1257. <p>Once this has successfully completed it will be safe to restart the
  1258. homeserver. You may notice that the homeserver takes a few seconds
  1259. longer to restart than usual as it reinitializes the database.</p>
  1260. <p>On startup of the new version, users can either rejoin remote rooms
  1261. using room aliases or by being reinvited. Alternatively, if any other
  1262. homeserver sends a message to a room that the homeserver was previously
  1263. in the local HS will automatically rejoin the room.</p>
  1264. </main>
  1265. <nav class="nav-wrapper" aria-label="Page navigation">
  1266. <!-- Mobile navigation buttons -->
  1267. <a rel="prev" href="delegate.html" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
  1268. <i class="fa fa-angle-left"></i>
  1269. </a>
  1270. <a rel="next" href="MSC1711_certificates_FAQ.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
  1271. <i class="fa fa-angle-right"></i>
  1272. </a>
  1273. <div style="clear: both"></div>
  1274. </nav>
  1275. </div>
  1276. </div>
  1277. <nav class="nav-wide-wrapper" aria-label="Page navigation">
  1278. <a rel="prev" href="delegate.html" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
  1279. <i class="fa fa-angle-left"></i>
  1280. </a>
  1281. <a rel="next" href="MSC1711_certificates_FAQ.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
  1282. <i class="fa fa-angle-right"></i>
  1283. </a>
  1284. </nav>
  1285. </div>
  1286. <script type="text/javascript">
  1287. window.playground_copyable = true;
  1288. </script>
  1289. <script src="elasticlunr.min.js" type="text/javascript" charset="utf-8"></script>
  1290. <script src="mark.min.js" type="text/javascript" charset="utf-8"></script>
  1291. <script src="searcher.js" type="text/javascript" charset="utf-8"></script>
  1292. <script src="clipboard.min.js" type="text/javascript" charset="utf-8"></script>
  1293. <script src="highlight.js" type="text/javascript" charset="utf-8"></script>
  1294. <script src="book.js" type="text/javascript" charset="utf-8"></script>
  1295. <!-- Custom JS scripts -->
  1296. <script type="text/javascript" src="docs/website_files/table-of-contents.js"></script>
  1297. </body>
  1298. </html>