UPGRADE.rst 51 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298
  1. Upgrading Synapse
  2. =================
  3. Before upgrading check if any special steps are required to upgrade from the
  4. version you currently have installed to the current version of Synapse. The extra
  5. instructions that may be required are listed later in this document.
  6. * Check that your versions of Python and PostgreSQL are still supported.
  7. Synapse follows upstream lifecycles for `Python`_ and `PostgreSQL`_, and
  8. removes support for versions which are no longer maintained.
  9. The website https://endoflife.date also offers convenient summaries.
  10. .. _Python: https://devguide.python.org/devcycle/#end-of-life-branches
  11. .. _PostgreSQL: https://www.postgresql.org/support/versioning/
  12. * If Synapse was installed using `prebuilt packages
  13. <INSTALL.md#prebuilt-packages>`_, you will need to follow the normal process
  14. for upgrading those packages.
  15. * If Synapse was installed from source, then:
  16. 1. Activate the virtualenv before upgrading. For example, if Synapse is
  17. installed in a virtualenv in ``~/synapse/env`` then run:
  18. .. code:: bash
  19. source ~/synapse/env/bin/activate
  20. 2. If Synapse was installed using pip then upgrade to the latest version by
  21. running:
  22. .. code:: bash
  23. pip install --upgrade matrix-synapse
  24. If Synapse was installed using git then upgrade to the latest version by
  25. running:
  26. .. code:: bash
  27. git pull
  28. pip install --upgrade .
  29. 3. Restart Synapse:
  30. .. code:: bash
  31. ./synctl restart
  32. To check whether your update was successful, you can check the running server
  33. version with:
  34. .. code:: bash
  35. # you may need to replace 'localhost:8008' if synapse is not configured
  36. # to listen on port 8008.
  37. curl http://localhost:8008/_synapse/admin/v1/server_version
  38. Rolling back to older versions
  39. ------------------------------
  40. Rolling back to previous releases can be difficult, due to database schema
  41. changes between releases. Where we have been able to test the rollback process,
  42. this will be noted below.
  43. In general, you will need to undo any changes made during the upgrade process,
  44. for example:
  45. * pip:
  46. .. code:: bash
  47. source env/bin/activate
  48. # replace `1.3.0` accordingly:
  49. pip install matrix-synapse==1.3.0
  50. * Debian:
  51. .. code:: bash
  52. # replace `1.3.0` and `stretch` accordingly:
  53. wget https://packages.matrix.org/debian/pool/main/m/matrix-synapse-py3/matrix-synapse-py3_1.3.0+stretch1_amd64.deb
  54. dpkg -i matrix-synapse-py3_1.3.0+stretch1_amd64.deb
  55. Upgrading to v1.33.0
  56. ====================
  57. Account Validity HTML templates can now display a user's expiration date
  58. ------------------------------------------------------------------------
  59. This may affect you if you have enabled the account validity feature, and have made use of a
  60. custom HTML template specified by the ``account_validity.template_dir`` or ``account_validity.account_renewed_html_path``
  61. Synapse config options.
  62. The template can now accept an ``expiration_ts`` variable, which represents the unix timestamp in milliseconds for the
  63. future date of which their account has been renewed until. See the
  64. `default template <https://github.com/matrix-org/synapse/blob/release-v1.33.0/synapse/res/templates/account_renewed.html>`_
  65. for an example of usage.
  66. ALso note that a new HTML template, ``account_previously_renewed.html``, has been added. This is is shown to users
  67. when they attempt to renew their account with a valid renewal token that has already been used before. The default
  68. template contents can been found
  69. `here <https://github.com/matrix-org/synapse/blob/release-v1.33.0/synapse/res/templates/account_previously_renewed.html>`_,
  70. and can also accept an ``expiration_ts`` variable. This template replaces the error message users would previously see
  71. upon attempting to use a valid renewal token more than once.
  72. Upgrading to v1.32.0
  73. ====================
  74. Regression causing connected Prometheus instances to become overwhelmed
  75. -----------------------------------------------------------------------
  76. This release introduces `a regression <https://github.com/matrix-org/synapse/issues/9853>`_
  77. that can overwhelm connected Prometheus instances. This issue is not present in
  78. Synapse v1.32.0rc1.
  79. If you have been affected, please downgrade to 1.31.0. You then may need to
  80. remove excess writeahead logs in order for Prometheus to recover. Instructions
  81. for doing so are provided
  82. `here <https://github.com/matrix-org/synapse/pull/9854#issuecomment-823472183>`_.
  83. Dropping support for old Python, Postgres and SQLite versions
  84. -------------------------------------------------------------
  85. In line with our `deprecation policy <https://github.com/matrix-org/synapse/blob/release-v1.32.0/docs/deprecation_policy.md>`_,
  86. we've dropped support for Python 3.5 and PostgreSQL 9.5, as they are no longer supported upstream.
  87. This release of Synapse requires Python 3.6+ and PostgresSQL 9.6+ or SQLite 3.22+.
  88. Removal of old List Accounts Admin API
  89. --------------------------------------
  90. The deprecated v1 "list accounts" admin API (``GET /_synapse/admin/v1/users/<user_id>``) has been removed in this version.
  91. The `v2 list accounts API <https://github.com/matrix-org/synapse/blob/master/docs/admin_api/user_admin_api.rst#list-accounts>`_
  92. has been available since Synapse 1.7.0 (2019-12-13), and is accessible under ``GET /_synapse/admin/v2/users``.
  93. The deprecation of the old endpoint was announced with Synapse 1.28.0 (released on 2021-02-25).
  94. Application Services must use type ``m.login.application_service`` when registering users
  95. -----------------------------------------------------------------------------------------
  96. In compliance with the
  97. `Application Service spec <https://matrix.org/docs/spec/application_service/r0.1.2#server-admin-style-permissions>`_,
  98. Application Services are now required to use the ``m.login.application_service`` type when registering users via the
  99. ``/_matrix/client/r0/register`` endpoint. This behaviour was deprecated in Synapse v1.30.0.
  100. Please ensure your Application Services are up to date.
  101. Upgrading to v1.29.0
  102. ====================
  103. Requirement for X-Forwarded-Proto header
  104. ----------------------------------------
  105. When using Synapse with a reverse proxy (in particular, when using the
  106. `x_forwarded` option on an HTTP listener), Synapse now expects to receive an
  107. `X-Forwarded-Proto` header on incoming HTTP requests. If it is not set, Synapse
  108. will log a warning on each received request.
  109. To avoid the warning, administrators using a reverse proxy should ensure that
  110. the reverse proxy sets `X-Forwarded-Proto` header to `https` or `http` to
  111. indicate the protocol used by the client.
  112. Synapse also requires the `Host` header to be preserved.
  113. See the `reverse proxy documentation <docs/reverse_proxy.md>`_, where the
  114. example configurations have been updated to show how to set these headers.
  115. (Users of `Caddy <https://caddyserver.com/>`_ are unaffected, since we believe it
  116. sets `X-Forwarded-Proto` by default.)
  117. Upgrading to v1.27.0
  118. ====================
  119. Changes to callback URI for OAuth2 / OpenID Connect and SAML2
  120. -------------------------------------------------------------
  121. This version changes the URI used for callbacks from OAuth2 and SAML2 identity providers:
  122. * If your server is configured for single sign-on via an OpenID Connect or OAuth2 identity
  123. provider, you will need to add ``[synapse public baseurl]/_synapse/client/oidc/callback``
  124. to the list of permitted "redirect URIs" at the identity provider.
  125. See `docs/openid.md <docs/openid.md>`_ for more information on setting up OpenID
  126. Connect.
  127. * If your server is configured for single sign-on via a SAML2 identity provider, you will
  128. need to add ``[synapse public baseurl]/_synapse/client/saml2/authn_response`` as a permitted
  129. "ACS location" (also known as "allowed callback URLs") at the identity provider.
  130. The "Issuer" in the "AuthnRequest" to the SAML2 identity provider is also updated to
  131. ``[synapse public baseurl]/_synapse/client/saml2/metadata.xml``. If your SAML2 identity
  132. provider uses this property to validate or otherwise identify Synapse, its configuration
  133. will need to be updated to use the new URL. Alternatively you could create a new, separate
  134. "EntityDescriptor" in your SAML2 identity provider with the new URLs and leave the URLs in
  135. the existing "EntityDescriptor" as they were.
  136. Changes to HTML templates
  137. -------------------------
  138. The HTML templates for SSO and email notifications now have `Jinja2's autoescape <https://jinja.palletsprojects.com/en/2.11.x/api/#autoescaping>`_
  139. enabled for files ending in ``.html``, ``.htm``, and ``.xml``. If you have customised
  140. these templates and see issues when viewing them you might need to update them.
  141. It is expected that most configurations will need no changes.
  142. If you have customised the templates *names* for these templates, it is recommended
  143. to verify they end in ``.html`` to ensure autoescape is enabled.
  144. The above applies to the following templates:
  145. * ``add_threepid.html``
  146. * ``add_threepid_failure.html``
  147. * ``add_threepid_success.html``
  148. * ``notice_expiry.html``
  149. * ``notice_expiry.html``
  150. * ``notif_mail.html`` (which, by default, includes ``room.html`` and ``notif.html``)
  151. * ``password_reset.html``
  152. * ``password_reset_confirmation.html``
  153. * ``password_reset_failure.html``
  154. * ``password_reset_success.html``
  155. * ``registration.html``
  156. * ``registration_failure.html``
  157. * ``registration_success.html``
  158. * ``sso_account_deactivated.html``
  159. * ``sso_auth_bad_user.html``
  160. * ``sso_auth_confirm.html``
  161. * ``sso_auth_success.html``
  162. * ``sso_error.html``
  163. * ``sso_login_idp_picker.html``
  164. * ``sso_redirect_confirm.html``
  165. Upgrading to v1.26.0
  166. ====================
  167. Rolling back to v1.25.0 after a failed upgrade
  168. ----------------------------------------------
  169. v1.26.0 includes a lot of large changes. If something problematic occurs, you
  170. may want to roll-back to a previous version of Synapse. Because v1.26.0 also
  171. includes a new database schema version, reverting that version is also required
  172. alongside the generic rollback instructions mentioned above. In short, to roll
  173. back to v1.25.0 you need to:
  174. 1. Stop the server
  175. 2. Decrease the schema version in the database:
  176. .. code:: sql
  177. UPDATE schema_version SET version = 58;
  178. 3. Delete the ignored users & chain cover data:
  179. .. code:: sql
  180. DROP TABLE IF EXISTS ignored_users;
  181. UPDATE rooms SET has_auth_chain_index = false;
  182. For PostgreSQL run:
  183. .. code:: sql
  184. TRUNCATE event_auth_chain_links;
  185. TRUNCATE event_auth_chains;
  186. For SQLite run:
  187. .. code:: sql
  188. DELETE FROM event_auth_chain_links;
  189. DELETE FROM event_auth_chains;
  190. 4. Mark the deltas as not run (so they will re-run on upgrade).
  191. .. code:: sql
  192. DELETE FROM applied_schema_deltas WHERE version = 59 AND file = "59/01ignored_user.py";
  193. DELETE FROM applied_schema_deltas WHERE version = 59 AND file = "59/06chain_cover_index.sql";
  194. 5. Downgrade Synapse by following the instructions for your installation method
  195. in the "Rolling back to older versions" section above.
  196. Upgrading to v1.25.0
  197. ====================
  198. Last release supporting Python 3.5
  199. ----------------------------------
  200. This is the last release of Synapse which guarantees support with Python 3.5,
  201. which passed its upstream End of Life date several months ago.
  202. We will attempt to maintain support through March 2021, but without guarantees.
  203. In the future, Synapse will follow upstream schedules for ending support of
  204. older versions of Python and PostgreSQL. Please upgrade to at least Python 3.6
  205. and PostgreSQL 9.6 as soon as possible.
  206. Blacklisting IP ranges
  207. ----------------------
  208. Synapse v1.25.0 includes new settings, ``ip_range_blacklist`` and
  209. ``ip_range_whitelist``, for controlling outgoing requests from Synapse for federation,
  210. identity servers, push, and for checking key validity for third-party invite events.
  211. The previous setting, ``federation_ip_range_blacklist``, is deprecated. The new
  212. ``ip_range_blacklist`` defaults to private IP ranges if it is not defined.
  213. If you have never customised ``federation_ip_range_blacklist`` it is recommended
  214. that you remove that setting.
  215. If you have customised ``federation_ip_range_blacklist`` you should update the
  216. setting name to ``ip_range_blacklist``.
  217. If you have a custom push server that is reached via private IP space you may
  218. need to customise ``ip_range_blacklist`` or ``ip_range_whitelist``.
  219. Upgrading to v1.24.0
  220. ====================
  221. Custom OpenID Connect mapping provider breaking change
  222. ------------------------------------------------------
  223. This release allows the OpenID Connect mapping provider to perform normalisation
  224. of the localpart of the Matrix ID. This allows for the mapping provider to
  225. specify different algorithms, instead of the [default way](https://matrix.org/docs/spec/appendices#mapping-from-other-character-sets).
  226. If your Synapse configuration uses a custom mapping provider
  227. (`oidc_config.user_mapping_provider.module` is specified and not equal to
  228. `synapse.handlers.oidc_handler.JinjaOidcMappingProvider`) then you *must* ensure
  229. that `map_user_attributes` of the mapping provider performs some normalisation
  230. of the `localpart` returned. To match previous behaviour you can use the
  231. `map_username_to_mxid_localpart` function provided by Synapse. An example is
  232. shown below:
  233. .. code-block:: python
  234. from synapse.types import map_username_to_mxid_localpart
  235. class MyMappingProvider:
  236. def map_user_attributes(self, userinfo, token):
  237. # ... your custom logic ...
  238. sso_user_id = ...
  239. localpart = map_username_to_mxid_localpart(sso_user_id)
  240. return {"localpart": localpart}
  241. Removal historical Synapse Admin API
  242. ------------------------------------
  243. Historically, the Synapse Admin API has been accessible under:
  244. * ``/_matrix/client/api/v1/admin``
  245. * ``/_matrix/client/unstable/admin``
  246. * ``/_matrix/client/r0/admin``
  247. * ``/_synapse/admin/v1``
  248. The endpoints with ``/_matrix/client/*`` prefixes have been removed as of v1.24.0.
  249. The Admin API is now only accessible under:
  250. * ``/_synapse/admin/v1``
  251. The only exception is the `/admin/whois` endpoint, which is
  252. `also available via the client-server API <https://matrix.org/docs/spec/client_server/r0.6.1#get-matrix-client-r0-admin-whois-userid>`_.
  253. The deprecation of the old endpoints was announced with Synapse 1.20.0 (released
  254. on 2020-09-22) and makes it easier for homeserver admins to lock down external
  255. access to the Admin API endpoints.
  256. Upgrading to v1.23.0
  257. ====================
  258. Structured logging configuration breaking changes
  259. -------------------------------------------------
  260. This release deprecates use of the ``structured: true`` logging configuration for
  261. structured logging. If your logging configuration contains ``structured: true``
  262. then it should be modified based on the `structured logging documentation
  263. <https://github.com/matrix-org/synapse/blob/master/docs/structured_logging.md>`_.
  264. The ``structured`` and ``drains`` logging options are now deprecated and should
  265. be replaced by standard logging configuration of ``handlers`` and ``formatters``.
  266. A future will release of Synapse will make using ``structured: true`` an error.
  267. Upgrading to v1.22.0
  268. ====================
  269. ThirdPartyEventRules breaking changes
  270. -------------------------------------
  271. This release introduces a backwards-incompatible change to modules making use of
  272. ``ThirdPartyEventRules`` in Synapse. If you make use of a module defined under the
  273. ``third_party_event_rules`` config option, please make sure it is updated to handle
  274. the below change:
  275. The ``http_client`` argument is no longer passed to modules as they are initialised. Instead,
  276. modules are expected to make use of the ``http_client`` property on the ``ModuleApi`` class.
  277. Modules are now passed a ``module_api`` argument during initialisation, which is an instance of
  278. ``ModuleApi``. ``ModuleApi`` instances have a ``http_client`` property which acts the same as
  279. the ``http_client`` argument previously passed to ``ThirdPartyEventRules`` modules.
  280. Upgrading to v1.21.0
  281. ====================
  282. Forwarding ``/_synapse/client`` through your reverse proxy
  283. ----------------------------------------------------------
  284. The `reverse proxy documentation
  285. <https://github.com/matrix-org/synapse/blob/develop/docs/reverse_proxy.md>`_ has been updated
  286. to include reverse proxy directives for ``/_synapse/client/*`` endpoints. As the user password
  287. reset flow now uses endpoints under this prefix, **you must update your reverse proxy
  288. configurations for user password reset to work**.
  289. Additionally, note that the `Synapse worker documentation
  290. <https://github.com/matrix-org/synapse/blob/develop/docs/workers.md>`_ has been updated to
  291. state that the ``/_synapse/client/password_reset/email/submit_token`` endpoint can be handled
  292. by all workers. If you make use of Synapse's worker feature, please update your reverse proxy
  293. configuration to reflect this change.
  294. New HTML templates
  295. ------------------
  296. A new HTML template,
  297. `password_reset_confirmation.html <https://github.com/matrix-org/synapse/blob/develop/synapse/res/templates/password_reset_confirmation.html>`_,
  298. has been added to the ``synapse/res/templates`` directory. If you are using a
  299. custom template directory, you may want to copy the template over and modify it.
  300. Note that as of v1.20.0, templates do not need to be included in custom template
  301. directories for Synapse to start. The default templates will be used if a custom
  302. template cannot be found.
  303. This page will appear to the user after clicking a password reset link that has
  304. been emailed to them.
  305. To complete password reset, the page must include a way to make a `POST`
  306. request to
  307. ``/_synapse/client/password_reset/{medium}/submit_token``
  308. with the query parameters from the original link, presented as a URL-encoded form. See the file
  309. itself for more details.
  310. Updated Single Sign-on HTML Templates
  311. -------------------------------------
  312. The ``saml_error.html`` template was removed from Synapse and replaced with the
  313. ``sso_error.html`` template. If your Synapse is configured to use SAML and a
  314. custom ``sso_redirect_confirm_template_dir`` configuration then any customisations
  315. of the ``saml_error.html`` template will need to be merged into the ``sso_error.html``
  316. template. These templates are similar, but the parameters are slightly different:
  317. * The ``msg`` parameter should be renamed to ``error_description``.
  318. * There is no longer a ``code`` parameter for the response code.
  319. * A string ``error`` parameter is available that includes a short hint of why a
  320. user is seeing the error page.
  321. Upgrading to v1.18.0
  322. ====================
  323. Docker `-py3` suffix will be removed in future versions
  324. -------------------------------------------------------
  325. From 10th August 2020, we will no longer publish Docker images with the `-py3` tag suffix. The images tagged with the `-py3` suffix have been identical to the non-suffixed tags since release 0.99.0, and the suffix is obsolete.
  326. On 10th August, we will remove the `latest-py3` tag. Existing per-release tags (such as `v1.18.0-py3`) will not be removed, but no new `-py3` tags will be added.
  327. Scripts relying on the `-py3` suffix will need to be updated.
  328. Redis replication is now recommended in lieu of TCP replication
  329. ---------------------------------------------------------------
  330. When setting up worker processes, we now recommend the use of a Redis server for replication. **The old direct TCP connection method is deprecated and will be removed in a future release.**
  331. See `docs/workers.md <docs/workers.md>`_ for more details.
  332. Upgrading to v1.14.0
  333. ====================
  334. This version includes a database update which is run as part of the upgrade,
  335. and which may take a couple of minutes in the case of a large server. Synapse
  336. will not respond to HTTP requests while this update is taking place.
  337. Upgrading to v1.13.0
  338. ====================
  339. Incorrect database migration in old synapse versions
  340. ----------------------------------------------------
  341. A bug was introduced in Synapse 1.4.0 which could cause the room directory to
  342. be incomplete or empty if Synapse was upgraded directly from v1.2.1 or
  343. earlier, to versions between v1.4.0 and v1.12.x.
  344. This will *not* be a problem for Synapse installations which were:
  345. * created at v1.4.0 or later,
  346. * upgraded via v1.3.x, or
  347. * upgraded straight from v1.2.1 or earlier to v1.13.0 or later.
  348. If completeness of the room directory is a concern, installations which are
  349. affected can be repaired as follows:
  350. 1. Run the following sql from a `psql` or `sqlite3` console:
  351. .. code:: sql
  352. INSERT INTO background_updates (update_name, progress_json, depends_on) VALUES
  353. ('populate_stats_process_rooms', '{}', 'current_state_events_membership');
  354. INSERT INTO background_updates (update_name, progress_json, depends_on) VALUES
  355. ('populate_stats_process_users', '{}', 'populate_stats_process_rooms');
  356. 2. Restart synapse.
  357. New Single Sign-on HTML Templates
  358. ---------------------------------
  359. New templates (``sso_auth_confirm.html``, ``sso_auth_success.html``, and
  360. ``sso_account_deactivated.html``) were added to Synapse. If your Synapse is
  361. configured to use SSO and a custom ``sso_redirect_confirm_template_dir``
  362. configuration then these templates will need to be copied from
  363. `synapse/res/templates <synapse/res/templates>`_ into that directory.
  364. Synapse SSO Plugins Method Deprecation
  365. --------------------------------------
  366. Plugins using the ``complete_sso_login`` method of
  367. ``synapse.module_api.ModuleApi`` should update to using the async/await
  368. version ``complete_sso_login_async`` which includes additional checks. The
  369. non-async version is considered deprecated.
  370. Rolling back to v1.12.4 after a failed upgrade
  371. ----------------------------------------------
  372. v1.13.0 includes a lot of large changes. If something problematic occurs, you
  373. may want to roll-back to a previous version of Synapse. Because v1.13.0 also
  374. includes a new database schema version, reverting that version is also required
  375. alongside the generic rollback instructions mentioned above. In short, to roll
  376. back to v1.12.4 you need to:
  377. 1. Stop the server
  378. 2. Decrease the schema version in the database:
  379. .. code:: sql
  380. UPDATE schema_version SET version = 57;
  381. 3. Downgrade Synapse by following the instructions for your installation method
  382. in the "Rolling back to older versions" section above.
  383. Upgrading to v1.12.0
  384. ====================
  385. This version includes a database update which is run as part of the upgrade,
  386. and which may take some time (several hours in the case of a large
  387. server). Synapse will not respond to HTTP requests while this update is taking
  388. place.
  389. This is only likely to be a problem in the case of a server which is
  390. participating in many rooms.
  391. 0. As with all upgrades, it is recommended that you have a recent backup of
  392. your database which can be used for recovery in the event of any problems.
  393. 1. As an initial check to see if you will be affected, you can try running the
  394. following query from the `psql` or `sqlite3` console. It is safe to run it
  395. while Synapse is still running.
  396. .. code:: sql
  397. SELECT MAX(q.v) FROM (
  398. SELECT (
  399. SELECT ej.json AS v
  400. FROM state_events se INNER JOIN event_json ej USING (event_id)
  401. WHERE se.room_id=rooms.room_id AND se.type='m.room.create' AND se.state_key=''
  402. LIMIT 1
  403. ) FROM rooms WHERE rooms.room_version IS NULL
  404. ) q;
  405. This query will take about the same amount of time as the upgrade process: ie,
  406. if it takes 5 minutes, then it is likely that Synapse will be unresponsive for
  407. 5 minutes during the upgrade.
  408. If you consider an outage of this duration to be acceptable, no further
  409. action is necessary and you can simply start Synapse 1.12.0.
  410. If you would prefer to reduce the downtime, continue with the steps below.
  411. 2. The easiest workaround for this issue is to manually
  412. create a new index before upgrading. On PostgreSQL, his can be done as follows:
  413. .. code:: sql
  414. CREATE INDEX CONCURRENTLY tmp_upgrade_1_12_0_index
  415. ON state_events(room_id) WHERE type = 'm.room.create';
  416. The above query may take some time, but is also safe to run while Synapse is
  417. running.
  418. We assume that no SQLite users have databases large enough to be
  419. affected. If you *are* affected, you can run a similar query, omitting the
  420. ``CONCURRENTLY`` keyword. Note however that this operation may in itself cause
  421. Synapse to stop running for some time. Synapse admins are reminded that
  422. `SQLite is not recommended for use outside a test
  423. environment <https://github.com/matrix-org/synapse/blob/master/README.rst#using-postgresql>`_.
  424. 3. Once the index has been created, the ``SELECT`` query in step 1 above should
  425. complete quickly. It is therefore safe to upgrade to Synapse 1.12.0.
  426. 4. Once Synapse 1.12.0 has successfully started and is responding to HTTP
  427. requests, the temporary index can be removed:
  428. .. code:: sql
  429. DROP INDEX tmp_upgrade_1_12_0_index;
  430. Upgrading to v1.10.0
  431. ====================
  432. Synapse will now log a warning on start up if used with a PostgreSQL database
  433. that has a non-recommended locale set.
  434. See `docs/postgres.md <docs/postgres.md>`_ for details.
  435. Upgrading to v1.8.0
  436. ===================
  437. Specifying a ``log_file`` config option will now cause Synapse to refuse to
  438. start, and should be replaced by with the ``log_config`` option. Support for
  439. the ``log_file`` option was removed in v1.3.0 and has since had no effect.
  440. Upgrading to v1.7.0
  441. ===================
  442. In an attempt to configure Synapse in a privacy preserving way, the default
  443. behaviours of ``allow_public_rooms_without_auth`` and
  444. ``allow_public_rooms_over_federation`` have been inverted. This means that by
  445. default, only authenticated users querying the Client/Server API will be able
  446. to query the room directory, and relatedly that the server will not share
  447. room directory information with other servers over federation.
  448. If your installation does not explicitly set these settings one way or the other
  449. and you want either setting to be ``true`` then it will necessary to update
  450. your homeserver configuration file accordingly.
  451. For more details on the surrounding context see our `explainer
  452. <https://matrix.org/blog/2019/11/09/avoiding-unwelcome-visitors-on-private-matrix-servers>`_.
  453. Upgrading to v1.5.0
  454. ===================
  455. This release includes a database migration which may take several minutes to
  456. complete if there are a large number (more than a million or so) of entries in
  457. the ``devices`` table. This is only likely to a be a problem on very large
  458. installations.
  459. Upgrading to v1.4.0
  460. ===================
  461. New custom templates
  462. --------------------
  463. If you have configured a custom template directory with the
  464. ``email.template_dir`` option, be aware that there are new templates regarding
  465. registration and threepid management (see below) that must be included.
  466. * ``registration.html`` and ``registration.txt``
  467. * ``registration_success.html`` and ``registration_failure.html``
  468. * ``add_threepid.html`` and ``add_threepid.txt``
  469. * ``add_threepid_failure.html`` and ``add_threepid_success.html``
  470. Synapse will expect these files to exist inside the configured template
  471. directory, and **will fail to start** if they are absent.
  472. To view the default templates, see `synapse/res/templates
  473. <https://github.com/matrix-org/synapse/tree/master/synapse/res/templates>`_.
  474. 3pid verification changes
  475. -------------------------
  476. **Note: As of this release, users will be unable to add phone numbers or email
  477. addresses to their accounts, without changes to the Synapse configuration. This
  478. includes adding an email address during registration.**
  479. It is possible for a user to associate an email address or phone number
  480. with their account, for a number of reasons:
  481. * for use when logging in, as an alternative to the user id.
  482. * in the case of email, as an alternative contact to help with account recovery.
  483. * in the case of email, to receive notifications of missed messages.
  484. Before an email address or phone number can be added to a user's account,
  485. or before such an address is used to carry out a password-reset, Synapse must
  486. confirm the operation with the owner of the email address or phone number.
  487. It does this by sending an email or text giving the user a link or token to confirm
  488. receipt. This process is known as '3pid verification'. ('3pid', or 'threepid',
  489. stands for third-party identifier, and we use it to refer to external
  490. identifiers such as email addresses and phone numbers.)
  491. Previous versions of Synapse delegated the task of 3pid verification to an
  492. identity server by default. In most cases this server is ``vector.im`` or
  493. ``matrix.org``.
  494. In Synapse 1.4.0, for security and privacy reasons, the homeserver will no
  495. longer delegate this task to an identity server by default. Instead,
  496. the server administrator will need to explicitly decide how they would like the
  497. verification messages to be sent.
  498. In the medium term, the ``vector.im`` and ``matrix.org`` identity servers will
  499. disable support for delegated 3pid verification entirely. However, in order to
  500. ease the transition, they will retain the capability for a limited
  501. period. Delegated email verification will be disabled on Monday 2nd December
  502. 2019 (giving roughly 2 months notice). Disabling delegated SMS verification
  503. will follow some time after that once SMS verification support lands in
  504. Synapse.
  505. Once delegated 3pid verification support has been disabled in the ``vector.im`` and
  506. ``matrix.org`` identity servers, all Synapse versions that depend on those
  507. instances will be unable to verify email and phone numbers through them. There
  508. are no imminent plans to remove delegated 3pid verification from Sydent
  509. generally. (Sydent is the identity server project that backs the ``vector.im`` and
  510. ``matrix.org`` instances).
  511. Email
  512. ~~~~~
  513. Following upgrade, to continue verifying email (e.g. as part of the
  514. registration process), admins can either:-
  515. * Configure Synapse to use an email server.
  516. * Run or choose an identity server which allows delegated email verification
  517. and delegate to it.
  518. Configure SMTP in Synapse
  519. +++++++++++++++++++++++++
  520. To configure an SMTP server for Synapse, modify the configuration section
  521. headed ``email``, and be sure to have at least the ``smtp_host, smtp_port``
  522. and ``notif_from`` fields filled out.
  523. You may also need to set ``smtp_user``, ``smtp_pass``, and
  524. ``require_transport_security``.
  525. See the `sample configuration file <docs/sample_config.yaml>`_ for more details
  526. on these settings.
  527. Delegate email to an identity server
  528. ++++++++++++++++++++++++++++++++++++
  529. Some admins will wish to continue using email verification as part of the
  530. registration process, but will not immediately have an appropriate SMTP server
  531. at hand.
  532. To this end, we will continue to support email verification delegation via the
  533. ``vector.im`` and ``matrix.org`` identity servers for two months. Support for
  534. delegated email verification will be disabled on Monday 2nd December.
  535. The ``account_threepid_delegates`` dictionary defines whether the homeserver
  536. should delegate an external server (typically an `identity server
  537. <https://matrix.org/docs/spec/identity_service/r0.2.1>`_) to handle sending
  538. confirmation messages via email and SMS.
  539. So to delegate email verification, in ``homeserver.yaml``, set
  540. ``account_threepid_delegates.email`` to the base URL of an identity server. For
  541. example:
  542. .. code:: yaml
  543. account_threepid_delegates:
  544. email: https://example.com # Delegate email sending to example.com
  545. Note that ``account_threepid_delegates.email`` replaces the deprecated
  546. ``email.trust_identity_server_for_password_resets``: if
  547. ``email.trust_identity_server_for_password_resets`` is set to ``true``, and
  548. ``account_threepid_delegates.email`` is not set, then the first entry in
  549. ``trusted_third_party_id_servers`` will be used as the
  550. ``account_threepid_delegate`` for email. This is to ensure compatibility with
  551. existing Synapse installs that set up external server handling for these tasks
  552. before v1.4.0. If ``email.trust_identity_server_for_password_resets`` is
  553. ``true`` and no trusted identity server domains are configured, Synapse will
  554. report an error and refuse to start.
  555. If ``email.trust_identity_server_for_password_resets`` is ``false`` or absent
  556. and no ``email`` delegate is configured in ``account_threepid_delegates``,
  557. then Synapse will send email verification messages itself, using the configured
  558. SMTP server (see above).
  559. that type.
  560. Phone numbers
  561. ~~~~~~~~~~~~~
  562. Synapse does not support phone-number verification itself, so the only way to
  563. maintain the ability for users to add phone numbers to their accounts will be
  564. by continuing to delegate phone number verification to the ``matrix.org`` and
  565. ``vector.im`` identity servers (or another identity server that supports SMS
  566. sending).
  567. The ``account_threepid_delegates`` dictionary defines whether the homeserver
  568. should delegate an external server (typically an `identity server
  569. <https://matrix.org/docs/spec/identity_service/r0.2.1>`_) to handle sending
  570. confirmation messages via email and SMS.
  571. So to delegate phone number verification, in ``homeserver.yaml``, set
  572. ``account_threepid_delegates.msisdn`` to the base URL of an identity
  573. server. For example:
  574. .. code:: yaml
  575. account_threepid_delegates:
  576. msisdn: https://example.com # Delegate sms sending to example.com
  577. The ``matrix.org`` and ``vector.im`` identity servers will continue to support
  578. delegated phone number verification via SMS until such time as it is possible
  579. for admins to configure their servers to perform phone number verification
  580. directly. More details will follow in a future release.
  581. Rolling back to v1.3.1
  582. ----------------------
  583. If you encounter problems with v1.4.0, it should be possible to roll back to
  584. v1.3.1, subject to the following:
  585. * The 'room statistics' engine was heavily reworked in this release (see
  586. `#5971 <https://github.com/matrix-org/synapse/pull/5971>`_), including
  587. significant changes to the database schema, which are not easily
  588. reverted. This will cause the room statistics engine to stop updating when
  589. you downgrade.
  590. The room statistics are essentially unused in v1.3.1 (in future versions of
  591. Synapse, they will be used to populate the room directory), so there should
  592. be no loss of functionality. However, the statistics engine will write errors
  593. to the logs, which can be avoided by setting the following in
  594. `homeserver.yaml`:
  595. .. code:: yaml
  596. stats:
  597. enabled: false
  598. Don't forget to re-enable it when you upgrade again, in preparation for its
  599. use in the room directory!
  600. Upgrading to v1.2.0
  601. ===================
  602. Some counter metrics have been renamed, with the old names deprecated. See
  603. `the metrics documentation <docs/metrics-howto.md#renaming-of-metrics--deprecation-of-old-names-in-12>`_
  604. for details.
  605. Upgrading to v1.1.0
  606. ===================
  607. Synapse v1.1.0 removes support for older Python and PostgreSQL versions, as
  608. outlined in `our deprecation notice <https://matrix.org/blog/2019/04/08/synapse-deprecating-postgres-9-4-and-python-2-x>`_.
  609. Minimum Python Version
  610. ----------------------
  611. Synapse v1.1.0 has a minimum Python requirement of Python 3.5. Python 3.6 or
  612. Python 3.7 are recommended as they have improved internal string handling,
  613. significantly reducing memory usage.
  614. If you use current versions of the Matrix.org-distributed Debian packages or
  615. Docker images, action is not required.
  616. If you install Synapse in a Python virtual environment, please see "Upgrading to
  617. v0.34.0" for notes on setting up a new virtualenv under Python 3.
  618. Minimum PostgreSQL Version
  619. --------------------------
  620. If using PostgreSQL under Synapse, you will need to use PostgreSQL 9.5 or above.
  621. Please see the
  622. `PostgreSQL documentation <https://www.postgresql.org/docs/11/upgrading.html>`_
  623. for more details on upgrading your database.
  624. Upgrading to v1.0
  625. =================
  626. Validation of TLS certificates
  627. ------------------------------
  628. Synapse v1.0 is the first release to enforce
  629. validation of TLS certificates for the federation API. It is therefore
  630. essential that your certificates are correctly configured. See the `FAQ
  631. <docs/MSC1711_certificates_FAQ.md>`_ for more information.
  632. Note, v1.0 installations will also no longer be able to federate with servers
  633. that have not correctly configured their certificates.
  634. In rare cases, it may be desirable to disable certificate checking: for
  635. example, it might be essential to be able to federate with a given legacy
  636. server in a closed federation. This can be done in one of two ways:-
  637. * Configure the global switch ``federation_verify_certificates`` to ``false``.
  638. * Configure a whitelist of server domains to trust via ``federation_certificate_verification_whitelist``.
  639. See the `sample configuration file <docs/sample_config.yaml>`_
  640. for more details on these settings.
  641. Email
  642. -----
  643. When a user requests a password reset, Synapse will send an email to the
  644. user to confirm the request.
  645. Previous versions of Synapse delegated the job of sending this email to an
  646. identity server. If the identity server was somehow malicious or became
  647. compromised, it would be theoretically possible to hijack an account through
  648. this means.
  649. Therefore, by default, Synapse v1.0 will send the confirmation email itself. If
  650. Synapse is not configured with an SMTP server, password reset via email will be
  651. disabled.
  652. To configure an SMTP server for Synapse, modify the configuration section
  653. headed ``email``, and be sure to have at least the ``smtp_host``, ``smtp_port``
  654. and ``notif_from`` fields filled out. You may also need to set ``smtp_user``,
  655. ``smtp_pass``, and ``require_transport_security``.
  656. If you are absolutely certain that you wish to continue using an identity
  657. server for password resets, set ``trust_identity_server_for_password_resets`` to ``true``.
  658. See the `sample configuration file <docs/sample_config.yaml>`_
  659. for more details on these settings.
  660. New email templates
  661. ---------------
  662. Some new templates have been added to the default template directory for the purpose of the
  663. homeserver sending its own password reset emails. If you have configured a custom
  664. ``template_dir`` in your Synapse config, these files will need to be added.
  665. ``password_reset.html`` and ``password_reset.txt`` are HTML and plain text templates
  666. respectively that contain the contents of what will be emailed to the user upon attempting to
  667. reset their password via email. ``password_reset_success.html`` and
  668. ``password_reset_failure.html`` are HTML files that the content of which (assuming no redirect
  669. URL is set) will be shown to the user after they attempt to click the link in the email sent
  670. to them.
  671. Upgrading to v0.99.0
  672. ====================
  673. Please be aware that, before Synapse v1.0 is released around March 2019, you
  674. will need to replace any self-signed certificates with those verified by a
  675. root CA. Information on how to do so can be found at `the ACME docs
  676. <docs/ACME.md>`_.
  677. For more information on configuring TLS certificates see the `FAQ <docs/MSC1711_certificates_FAQ.md>`_.
  678. Upgrading to v0.34.0
  679. ====================
  680. 1. This release is the first to fully support Python 3. Synapse will now run on
  681. Python versions 3.5, or 3.6 (as well as 2.7). We recommend switching to
  682. Python 3, as it has been shown to give performance improvements.
  683. For users who have installed Synapse into a virtualenv, we recommend doing
  684. this by creating a new virtualenv. For example::
  685. virtualenv -p python3 ~/synapse/env3
  686. source ~/synapse/env3/bin/activate
  687. pip install matrix-synapse
  688. You can then start synapse as normal, having activated the new virtualenv::
  689. cd ~/synapse
  690. source env3/bin/activate
  691. synctl start
  692. Users who have installed from distribution packages should see the relevant
  693. package documentation. See below for notes on Debian packages.
  694. * When upgrading to Python 3, you **must** make sure that your log files are
  695. configured as UTF-8, by adding ``encoding: utf8`` to the
  696. ``RotatingFileHandler`` configuration (if you have one) in your
  697. ``<server>.log.config`` file. For example, if your ``log.config`` file
  698. contains::
  699. handlers:
  700. file:
  701. class: logging.handlers.RotatingFileHandler
  702. formatter: precise
  703. filename: homeserver.log
  704. maxBytes: 104857600
  705. backupCount: 10
  706. filters: [context]
  707. console:
  708. class: logging.StreamHandler
  709. formatter: precise
  710. filters: [context]
  711. Then you should update this to be::
  712. handlers:
  713. file:
  714. class: logging.handlers.RotatingFileHandler
  715. formatter: precise
  716. filename: homeserver.log
  717. maxBytes: 104857600
  718. backupCount: 10
  719. filters: [context]
  720. encoding: utf8
  721. console:
  722. class: logging.StreamHandler
  723. formatter: precise
  724. filters: [context]
  725. There is no need to revert this change if downgrading to Python 2.
  726. We are also making available Debian packages which will run Synapse on
  727. Python 3. You can switch to these packages with ``apt-get install
  728. matrix-synapse-py3``, however, please read `debian/NEWS
  729. <https://github.com/matrix-org/synapse/blob/release-v0.34.0/debian/NEWS>`_
  730. before doing so. The existing ``matrix-synapse`` packages will continue to
  731. use Python 2 for the time being.
  732. 2. This release removes the ``riot.im`` from the default list of trusted
  733. identity servers.
  734. If ``riot.im`` is in your homeserver's list of
  735. ``trusted_third_party_id_servers``, you should remove it. It was added in
  736. case a hypothetical future identity server was put there. If you don't
  737. remove it, users may be unable to deactivate their accounts.
  738. 3. This release no longer installs the (unmaintained) Matrix Console web client
  739. as part of the default installation. It is possible to re-enable it by
  740. installing it separately and setting the ``web_client_location`` config
  741. option, but please consider switching to another client.
  742. Upgrading to v0.33.7
  743. ====================
  744. This release removes the example email notification templates from
  745. ``res/templates`` (they are now internal to the python package). This should
  746. only affect you if you (a) deploy your Synapse instance from a git checkout or
  747. a github snapshot URL, and (b) have email notifications enabled.
  748. If you have email notifications enabled, you should ensure that
  749. ``email.template_dir`` is either configured to point at a directory where you
  750. have installed customised templates, or leave it unset to use the default
  751. templates.
  752. Upgrading to v0.27.3
  753. ====================
  754. This release expands the anonymous usage stats sent if the opt-in
  755. ``report_stats`` configuration is set to ``true``. We now capture RSS memory
  756. and cpu use at a very coarse level. This requires administrators to install
  757. the optional ``psutil`` python module.
  758. We would appreciate it if you could assist by ensuring this module is available
  759. and ``report_stats`` is enabled. This will let us see if performance changes to
  760. synapse are having an impact to the general community.
  761. Upgrading to v0.15.0
  762. ====================
  763. If you want to use the new URL previewing API (/_matrix/media/r0/preview_url)
  764. then you have to explicitly enable it in the config and update your dependencies
  765. dependencies. See README.rst for details.
  766. Upgrading to v0.11.0
  767. ====================
  768. This release includes the option to send anonymous usage stats to matrix.org,
  769. and requires that administrators explictly opt in or out by setting the
  770. ``report_stats`` option to either ``true`` or ``false``.
  771. We would really appreciate it if you could help our project out by reporting
  772. anonymized usage statistics from your homeserver. Only very basic aggregate
  773. data (e.g. number of users) will be reported, but it helps us to track the
  774. growth of the Matrix community, and helps us to make Matrix a success, as well
  775. as to convince other networks that they should peer with us.
  776. Upgrading to v0.9.0
  777. ===================
  778. Application services have had a breaking API change in this version.
  779. They can no longer register themselves with a home server using the AS HTTP API. This
  780. decision was made because a compromised application service with free reign to register
  781. any regex in effect grants full read/write access to the home server if a regex of ``.*``
  782. is used. An attack where a compromised AS re-registers itself with ``.*`` was deemed too
  783. big of a security risk to ignore, and so the ability to register with the HS remotely has
  784. been removed.
  785. It has been replaced by specifying a list of application service registrations in
  786. ``homeserver.yaml``::
  787. app_service_config_files: ["registration-01.yaml", "registration-02.yaml"]
  788. Where ``registration-01.yaml`` looks like::
  789. url: <String> # e.g. "https://my.application.service.com"
  790. as_token: <String>
  791. hs_token: <String>
  792. sender_localpart: <String> # This is a new field which denotes the user_id localpart when using the AS token
  793. namespaces:
  794. users:
  795. - exclusive: <Boolean>
  796. regex: <String> # e.g. "@prefix_.*"
  797. aliases:
  798. - exclusive: <Boolean>
  799. regex: <String>
  800. rooms:
  801. - exclusive: <Boolean>
  802. regex: <String>
  803. Upgrading to v0.8.0
  804. ===================
  805. Servers which use captchas will need to add their public key to::
  806. static/client/register/register_config.js
  807. window.matrixRegistrationConfig = {
  808. recaptcha_public_key: "YOUR_PUBLIC_KEY"
  809. };
  810. This is required in order to support registration fallback (typically used on
  811. mobile devices).
  812. Upgrading to v0.7.0
  813. ===================
  814. New dependencies are:
  815. - pydenticon
  816. - simplejson
  817. - syutil
  818. - matrix-angular-sdk
  819. To pull in these dependencies in a virtual env, run::
  820. python synapse/python_dependencies.py | xargs -n 1 pip install
  821. Upgrading to v0.6.0
  822. ===================
  823. To pull in new dependencies, run::
  824. python setup.py develop --user
  825. This update includes a change to the database schema. To upgrade you first need
  826. to upgrade the database by running::
  827. python scripts/upgrade_db_to_v0.6.0.py <db> <server_name> <signing_key>
  828. Where `<db>` is the location of the database, `<server_name>` is the
  829. server name as specified in the synapse configuration, and `<signing_key>` is
  830. the location of the signing key as specified in the synapse configuration.
  831. This may take some time to complete. Failures of signatures and content hashes
  832. can safely be ignored.
  833. Upgrading to v0.5.1
  834. ===================
  835. Depending on precisely when you installed v0.5.0 you may have ended up with
  836. a stale release of the reference matrix webclient installed as a python module.
  837. To uninstall it and ensure you are depending on the latest module, please run::
  838. $ pip uninstall syweb
  839. Upgrading to v0.5.0
  840. ===================
  841. The webclient has been split out into a seperate repository/pacakage in this
  842. release. Before you restart your homeserver you will need to pull in the
  843. webclient package by running::
  844. python setup.py develop --user
  845. This release completely changes the database schema and so requires upgrading
  846. it before starting the new version of the homeserver.
  847. The script "database-prepare-for-0.5.0.sh" should be used to upgrade the
  848. database. This will save all user information, such as logins and profiles,
  849. but will otherwise purge the database. This includes messages, which
  850. rooms the home server was a member of and room alias mappings.
  851. If you would like to keep your history, please take a copy of your database
  852. file and ask for help in #matrix:matrix.org. The upgrade process is,
  853. unfortunately, non trivial and requires human intervention to resolve any
  854. resulting conflicts during the upgrade process.
  855. Before running the command the homeserver should be first completely
  856. shutdown. To run it, simply specify the location of the database, e.g.:
  857. ./scripts/database-prepare-for-0.5.0.sh "homeserver.db"
  858. Once this has successfully completed it will be safe to restart the
  859. homeserver. You may notice that the homeserver takes a few seconds longer to
  860. restart than usual as it reinitializes the database.
  861. On startup of the new version, users can either rejoin remote rooms using room
  862. aliases or by being reinvited. Alternatively, if any other homeserver sends a
  863. message to a room that the homeserver was previously in the local HS will
  864. automatically rejoin the room.
  865. Upgrading to v0.4.0
  866. ===================
  867. This release needs an updated syutil version. Run::
  868. python setup.py develop
  869. You will also need to upgrade your configuration as the signing key format has
  870. changed. Run::
  871. python -m synapse.app.homeserver --config-path <CONFIG> --generate-config
  872. Upgrading to v0.3.0
  873. ===================
  874. This registration API now closely matches the login API. This introduces a bit
  875. more backwards and forwards between the HS and the client, but this improves
  876. the overall flexibility of the API. You can now GET on /register to retrieve a list
  877. of valid registration flows. Upon choosing one, they are submitted in the same
  878. way as login, e.g::
  879. {
  880. type: m.login.password,
  881. user: foo,
  882. password: bar
  883. }
  884. The default HS supports 2 flows, with and without Identity Server email
  885. authentication. Enabling captcha on the HS will add in an extra step to all
  886. flows: ``m.login.recaptcha`` which must be completed before you can transition
  887. to the next stage. There is a new login type: ``m.login.email.identity`` which
  888. contains the ``threepidCreds`` key which were previously sent in the original
  889. register request. For more information on this, see the specification.
  890. Web Client
  891. ----------
  892. The VoIP specification has changed between v0.2.0 and v0.3.0. Users should
  893. refresh any browser tabs to get the latest web client code. Users on
  894. v0.2.0 of the web client will not be able to call those on v0.3.0 and
  895. vice versa.
  896. Upgrading to v0.2.0
  897. ===================
  898. The home server now requires setting up of SSL config before it can run. To
  899. automatically generate default config use::
  900. $ python synapse/app/homeserver.py \
  901. --server-name machine.my.domain.name \
  902. --bind-port 8448 \
  903. --config-path homeserver.config \
  904. --generate-config
  905. This config can be edited if desired, for example to specify a different SSL
  906. certificate to use. Once done you can run the home server using::
  907. $ python synapse/app/homeserver.py --config-path homeserver.config
  908. See the README.rst for more information.
  909. Also note that some config options have been renamed, including:
  910. - "host" to "server-name"
  911. - "database" to "database-path"
  912. - "port" to "bind-port" and "unsecure-port"
  913. Upgrading to v0.0.1
  914. ===================
  915. This release completely changes the database schema and so requires upgrading
  916. it before starting the new version of the homeserver.
  917. The script "database-prepare-for-0.0.1.sh" should be used to upgrade the
  918. database. This will save all user information, such as logins and profiles,
  919. but will otherwise purge the database. This includes messages, which
  920. rooms the home server was a member of and room alias mappings.
  921. Before running the command the homeserver should be first completely
  922. shutdown. To run it, simply specify the location of the database, e.g.:
  923. ./scripts/database-prepare-for-0.0.1.sh "homeserver.db"
  924. Once this has successfully completed it will be safe to restart the
  925. homeserver. You may notice that the homeserver takes a few seconds longer to
  926. restart than usual as it reinitializes the database.
  927. On startup of the new version, users can either rejoin remote rooms using room
  928. aliases or by being reinvited. Alternatively, if any other homeserver sends a
  929. message to a room that the homeserver was previously in the local HS will
  930. automatically rejoin the room.