1
0

UPGRADE.rst 52 KB

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