UPGRADE.rst 51 KB

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