UPGRADE.rst 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970
  1. Upgrading to v1.20.0
  2. ====================
  3. Shared rooms endpoint (MSC2666)
  4. -------------------------------
  5. This release contains a new unstable endpoint `/_matrix/client/unstable/uk.half-shot.msc2666/user/shared_rooms/.*`
  6. for fetching rooms one user has in common with another. This feature requires the
  7. `update_user_directory` config flag to be `True`. If you are you are using a `synapse.app.user_dir`
  8. worker, requests to this endpoint must be handled by that worker.
  9. See `docs/workers.md <docs/workers.md>`_ for more details.
  10. Upgrading Synapse
  11. =================
  12. Before upgrading check if any special steps are required to upgrade from the
  13. version you currently have installed to the current version of Synapse. The extra
  14. instructions that may be required are listed later in this document.
  15. * If Synapse was installed using `prebuilt packages
  16. <INSTALL.md#prebuilt-packages>`_, you will need to follow the normal process
  17. for upgrading those packages.
  18. * If Synapse was installed from source, then:
  19. 1. Activate the virtualenv before upgrading. For example, if Synapse is
  20. installed in a virtualenv in ``~/synapse/env`` then run:
  21. .. code:: bash
  22. source ~/synapse/env/bin/activate
  23. 2. If Synapse was installed using pip then upgrade to the latest version by
  24. running:
  25. .. code:: bash
  26. pip install --upgrade matrix-synapse
  27. If Synapse was installed using git then upgrade to the latest version by
  28. running:
  29. .. code:: bash
  30. git pull
  31. pip install --upgrade .
  32. 3. Restart Synapse:
  33. .. code:: bash
  34. ./synctl restart
  35. To check whether your update was successful, you can check the running server
  36. version with:
  37. .. code:: bash
  38. # you may need to replace 'localhost:8008' if synapse is not configured
  39. # to listen on port 8008.
  40. curl http://localhost:8008/_synapse/admin/v1/server_version
  41. Rolling back to older versions
  42. ------------------------------
  43. Rolling back to previous releases can be difficult, due to database schema
  44. changes between releases. Where we have been able to test the rollback process,
  45. this will be noted below.
  46. In general, you will need to undo any changes made during the upgrade process,
  47. for example:
  48. * pip:
  49. .. code:: bash
  50. source env/bin/activate
  51. # replace `1.3.0` accordingly:
  52. pip install matrix-synapse==1.3.0
  53. * Debian:
  54. .. code:: bash
  55. # replace `1.3.0` and `stretch` accordingly:
  56. wget https://packages.matrix.org/debian/pool/main/m/matrix-synapse-py3/matrix-synapse-py3_1.3.0+stretch1_amd64.deb
  57. dpkg -i matrix-synapse-py3_1.3.0+stretch1_amd64.deb
  58. Upgrading to v1.21.0
  59. ====================
  60. Forwarding ``/_synapse/client`` through your reverse proxy
  61. ----------------------------------------------------------
  62. The `reverse proxy documentation
  63. <https://github.com/matrix-org/synapse/blob/develop/docs/reverse_proxy.md>`_ has been updated
  64. to include reverse proxy directives for ``/_synapse/client/*`` endpoints. As the user password
  65. reset flow now uses endpoints under this prefix, **you must update your reverse proxy
  66. configurations for user password reset to work**.
  67. Additionally, note that the `Synapse worker documentation
  68. <https://github.com/matrix-org/synapse/blob/develop/docs/workers.md>`_ has been updated to
  69. state that the ``/_synapse/client/password_reset/email/submit_token`` endpoint can be handled
  70. by all workers. If you make use of Synapse's worker feature, please update your reverse proxy
  71. configuration to reflect this change.
  72. New HTML templates
  73. ------------------
  74. A new HTML template,
  75. `password_reset_confirmation.html <https://github.com/matrix-org/synapse/blob/develop/synapse/res/templates/password_reset_confirmation.html>`_,
  76. has been added to the ``synapse/res/templates`` directory. If you are using a
  77. custom template directory, you may want to copy the template over and modify it.
  78. Note that as of v1.20.0, templates do not need to be included in custom template
  79. directories for Synapse to start. The default templates will be used if a custom
  80. template cannot be found.
  81. This page will appear to the user after clicking a password reset link that has
  82. been emailed to them.
  83. To complete password reset, the page must include a way to make a `POST`
  84. request to
  85. ``/_synapse/client/password_reset/{medium}/submit_token``
  86. with the query parameters from the original link, presented as a URL-encoded form. See the file
  87. itself for more details.
  88. Upgrading to v1.18.0
  89. ====================
  90. Docker `-py3` suffix will be removed in future versions
  91. -------------------------------------------------------
  92. 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.
  93. 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.
  94. Scripts relying on the `-py3` suffix will need to be updated.
  95. Redis replication is now recommended in lieu of TCP replication
  96. ---------------------------------------------------------------
  97. 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.**
  98. See `docs/workers.md <docs/workers.md>`_ for more details.
  99. Upgrading to v1.14.0
  100. ====================
  101. This version includes a database update which is run as part of the upgrade,
  102. and which may take a couple of minutes in the case of a large server. Synapse
  103. will not respond to HTTP requests while this update is taking place.
  104. Upgrading to v1.13.0
  105. ====================
  106. Incorrect database migration in old synapse versions
  107. ----------------------------------------------------
  108. A bug was introduced in Synapse 1.4.0 which could cause the room directory to
  109. be incomplete or empty if Synapse was upgraded directly from v1.2.1 or
  110. earlier, to versions between v1.4.0 and v1.12.x.
  111. This will *not* be a problem for Synapse installations which were:
  112. * created at v1.4.0 or later,
  113. * upgraded via v1.3.x, or
  114. * upgraded straight from v1.2.1 or earlier to v1.13.0 or later.
  115. If completeness of the room directory is a concern, installations which are
  116. affected can be repaired as follows:
  117. 1. Run the following sql from a `psql` or `sqlite3` console:
  118. .. code:: sql
  119. INSERT INTO background_updates (update_name, progress_json, depends_on) VALUES
  120. ('populate_stats_process_rooms', '{}', 'current_state_events_membership');
  121. INSERT INTO background_updates (update_name, progress_json, depends_on) VALUES
  122. ('populate_stats_process_users', '{}', 'populate_stats_process_rooms');
  123. 2. Restart synapse.
  124. New Single Sign-on HTML Templates
  125. ---------------------------------
  126. New templates (``sso_auth_confirm.html``, ``sso_auth_success.html``, and
  127. ``sso_account_deactivated.html``) were added to Synapse. If your Synapse is
  128. configured to use SSO and a custom ``sso_redirect_confirm_template_dir``
  129. configuration then these templates will need to be copied from
  130. `synapse/res/templates <synapse/res/templates>`_ into that directory.
  131. Synapse SSO Plugins Method Deprecation
  132. --------------------------------------
  133. Plugins using the ``complete_sso_login`` method of
  134. ``synapse.module_api.ModuleApi`` should update to using the async/await
  135. version ``complete_sso_login_async`` which includes additional checks. The
  136. non-async version is considered deprecated.
  137. Rolling back to v1.12.4 after a failed upgrade
  138. ----------------------------------------------
  139. v1.13.0 includes a lot of large changes. If something problematic occurs, you
  140. may want to roll-back to a previous version of Synapse. Because v1.13.0 also
  141. includes a new database schema version, reverting that version is also required
  142. alongside the generic rollback instructions mentioned above. In short, to roll
  143. back to v1.12.4 you need to:
  144. 1. Stop the server
  145. 2. Decrease the schema version in the database:
  146. .. code:: sql
  147. UPDATE schema_version SET version = 57;
  148. 3. Downgrade Synapse by following the instructions for your installation method
  149. in the "Rolling back to older versions" section above.
  150. Upgrading to v1.12.0
  151. ====================
  152. This version includes a database update which is run as part of the upgrade,
  153. and which may take some time (several hours in the case of a large
  154. server). Synapse will not respond to HTTP requests while this update is taking
  155. place.
  156. This is only likely to be a problem in the case of a server which is
  157. participating in many rooms.
  158. 0. As with all upgrades, it is recommended that you have a recent backup of
  159. your database which can be used for recovery in the event of any problems.
  160. 1. As an initial check to see if you will be affected, you can try running the
  161. following query from the `psql` or `sqlite3` console. It is safe to run it
  162. while Synapse is still running.
  163. .. code:: sql
  164. SELECT MAX(q.v) FROM (
  165. SELECT (
  166. SELECT ej.json AS v
  167. FROM state_events se INNER JOIN event_json ej USING (event_id)
  168. WHERE se.room_id=rooms.room_id AND se.type='m.room.create' AND se.state_key=''
  169. LIMIT 1
  170. ) FROM rooms WHERE rooms.room_version IS NULL
  171. ) q;
  172. This query will take about the same amount of time as the upgrade process: ie,
  173. if it takes 5 minutes, then it is likely that Synapse will be unresponsive for
  174. 5 minutes during the upgrade.
  175. If you consider an outage of this duration to be acceptable, no further
  176. action is necessary and you can simply start Synapse 1.12.0.
  177. If you would prefer to reduce the downtime, continue with the steps below.
  178. 2. The easiest workaround for this issue is to manually
  179. create a new index before upgrading. On PostgreSQL, his can be done as follows:
  180. .. code:: sql
  181. CREATE INDEX CONCURRENTLY tmp_upgrade_1_12_0_index
  182. ON state_events(room_id) WHERE type = 'm.room.create';
  183. The above query may take some time, but is also safe to run while Synapse is
  184. running.
  185. We assume that no SQLite users have databases large enough to be
  186. affected. If you *are* affected, you can run a similar query, omitting the
  187. ``CONCURRENTLY`` keyword. Note however that this operation may in itself cause
  188. Synapse to stop running for some time. Synapse admins are reminded that
  189. `SQLite is not recommended for use outside a test
  190. environment <https://github.com/matrix-org/synapse/blob/master/README.rst#using-postgresql>`_.
  191. 3. Once the index has been created, the ``SELECT`` query in step 1 above should
  192. complete quickly. It is therefore safe to upgrade to Synapse 1.12.0.
  193. 4. Once Synapse 1.12.0 has successfully started and is responding to HTTP
  194. requests, the temporary index can be removed:
  195. .. code:: sql
  196. DROP INDEX tmp_upgrade_1_12_0_index;
  197. Upgrading to v1.10.0
  198. ====================
  199. Synapse will now log a warning on start up if used with a PostgreSQL database
  200. that has a non-recommended locale set.
  201. See `docs/postgres.md <docs/postgres.md>`_ for details.
  202. Upgrading to v1.8.0
  203. ===================
  204. Specifying a ``log_file`` config option will now cause Synapse to refuse to
  205. start, and should be replaced by with the ``log_config`` option. Support for
  206. the ``log_file`` option was removed in v1.3.0 and has since had no effect.
  207. Upgrading to v1.7.0
  208. ===================
  209. In an attempt to configure Synapse in a privacy preserving way, the default
  210. behaviours of ``allow_public_rooms_without_auth`` and
  211. ``allow_public_rooms_over_federation`` have been inverted. This means that by
  212. default, only authenticated users querying the Client/Server API will be able
  213. to query the room directory, and relatedly that the server will not share
  214. room directory information with other servers over federation.
  215. If your installation does not explicitly set these settings one way or the other
  216. and you want either setting to be ``true`` then it will necessary to update
  217. your homeserver configuration file accordingly.
  218. For more details on the surrounding context see our `explainer
  219. <https://matrix.org/blog/2019/11/09/avoiding-unwelcome-visitors-on-private-matrix-servers>`_.
  220. Upgrading to v1.5.0
  221. ===================
  222. This release includes a database migration which may take several minutes to
  223. complete if there are a large number (more than a million or so) of entries in
  224. the ``devices`` table. This is only likely to a be a problem on very large
  225. installations.
  226. Upgrading to v1.4.0
  227. ===================
  228. New custom templates
  229. --------------------
  230. If you have configured a custom template directory with the
  231. ``email.template_dir`` option, be aware that there are new templates regarding
  232. registration and threepid management (see below) that must be included.
  233. * ``registration.html`` and ``registration.txt``
  234. * ``registration_success.html`` and ``registration_failure.html``
  235. * ``add_threepid.html`` and ``add_threepid.txt``
  236. * ``add_threepid_failure.html`` and ``add_threepid_success.html``
  237. Synapse will expect these files to exist inside the configured template
  238. directory, and **will fail to start** if they are absent.
  239. To view the default templates, see `synapse/res/templates
  240. <https://github.com/matrix-org/synapse/tree/master/synapse/res/templates>`_.
  241. 3pid verification changes
  242. -------------------------
  243. **Note: As of this release, users will be unable to add phone numbers or email
  244. addresses to their accounts, without changes to the Synapse configuration. This
  245. includes adding an email address during registration.**
  246. It is possible for a user to associate an email address or phone number
  247. with their account, for a number of reasons:
  248. * for use when logging in, as an alternative to the user id.
  249. * in the case of email, as an alternative contact to help with account recovery.
  250. * in the case of email, to receive notifications of missed messages.
  251. Before an email address or phone number can be added to a user's account,
  252. or before such an address is used to carry out a password-reset, Synapse must
  253. confirm the operation with the owner of the email address or phone number.
  254. It does this by sending an email or text giving the user a link or token to confirm
  255. receipt. This process is known as '3pid verification'. ('3pid', or 'threepid',
  256. stands for third-party identifier, and we use it to refer to external
  257. identifiers such as email addresses and phone numbers.)
  258. Previous versions of Synapse delegated the task of 3pid verification to an
  259. identity server by default. In most cases this server is ``vector.im`` or
  260. ``matrix.org``.
  261. In Synapse 1.4.0, for security and privacy reasons, the homeserver will no
  262. longer delegate this task to an identity server by default. Instead,
  263. the server administrator will need to explicitly decide how they would like the
  264. verification messages to be sent.
  265. In the medium term, the ``vector.im`` and ``matrix.org`` identity servers will
  266. disable support for delegated 3pid verification entirely. However, in order to
  267. ease the transition, they will retain the capability for a limited
  268. period. Delegated email verification will be disabled on Monday 2nd December
  269. 2019 (giving roughly 2 months notice). Disabling delegated SMS verification
  270. will follow some time after that once SMS verification support lands in
  271. Synapse.
  272. Once delegated 3pid verification support has been disabled in the ``vector.im`` and
  273. ``matrix.org`` identity servers, all Synapse versions that depend on those
  274. instances will be unable to verify email and phone numbers through them. There
  275. are no imminent plans to remove delegated 3pid verification from Sydent
  276. generally. (Sydent is the identity server project that backs the ``vector.im`` and
  277. ``matrix.org`` instances).
  278. Email
  279. ~~~~~
  280. Following upgrade, to continue verifying email (e.g. as part of the
  281. registration process), admins can either:-
  282. * Configure Synapse to use an email server.
  283. * Run or choose an identity server which allows delegated email verification
  284. and delegate to it.
  285. Configure SMTP in Synapse
  286. +++++++++++++++++++++++++
  287. To configure an SMTP server for Synapse, modify the configuration section
  288. headed ``email``, and be sure to have at least the ``smtp_host, smtp_port``
  289. and ``notif_from`` fields filled out.
  290. You may also need to set ``smtp_user``, ``smtp_pass``, and
  291. ``require_transport_security``.
  292. See the `sample configuration file <docs/sample_config.yaml>`_ for more details
  293. on these settings.
  294. Delegate email to an identity server
  295. ++++++++++++++++++++++++++++++++++++
  296. Some admins will wish to continue using email verification as part of the
  297. registration process, but will not immediately have an appropriate SMTP server
  298. at hand.
  299. To this end, we will continue to support email verification delegation via the
  300. ``vector.im`` and ``matrix.org`` identity servers for two months. Support for
  301. delegated email verification will be disabled on Monday 2nd December.
  302. The ``account_threepid_delegates`` dictionary defines whether the homeserver
  303. should delegate an external server (typically an `identity server
  304. <https://matrix.org/docs/spec/identity_service/r0.2.1>`_) to handle sending
  305. confirmation messages via email and SMS.
  306. So to delegate email verification, in ``homeserver.yaml``, set
  307. ``account_threepid_delegates.email`` to the base URL of an identity server. For
  308. example:
  309. .. code:: yaml
  310. account_threepid_delegates:
  311. email: https://example.com # Delegate email sending to example.com
  312. Note that ``account_threepid_delegates.email`` replaces the deprecated
  313. ``email.trust_identity_server_for_password_resets``: if
  314. ``email.trust_identity_server_for_password_resets`` is set to ``true``, and
  315. ``account_threepid_delegates.email`` is not set, then the first entry in
  316. ``trusted_third_party_id_servers`` will be used as the
  317. ``account_threepid_delegate`` for email. This is to ensure compatibility with
  318. existing Synapse installs that set up external server handling for these tasks
  319. before v1.4.0. If ``email.trust_identity_server_for_password_resets`` is
  320. ``true`` and no trusted identity server domains are configured, Synapse will
  321. report an error and refuse to start.
  322. If ``email.trust_identity_server_for_password_resets`` is ``false`` or absent
  323. and no ``email`` delegate is configured in ``account_threepid_delegates``,
  324. then Synapse will send email verification messages itself, using the configured
  325. SMTP server (see above).
  326. that type.
  327. Phone numbers
  328. ~~~~~~~~~~~~~
  329. Synapse does not support phone-number verification itself, so the only way to
  330. maintain the ability for users to add phone numbers to their accounts will be
  331. by continuing to delegate phone number verification to the ``matrix.org`` and
  332. ``vector.im`` identity servers (or another identity server that supports SMS
  333. sending).
  334. The ``account_threepid_delegates`` dictionary defines whether the homeserver
  335. should delegate an external server (typically an `identity server
  336. <https://matrix.org/docs/spec/identity_service/r0.2.1>`_) to handle sending
  337. confirmation messages via email and SMS.
  338. So to delegate phone number verification, in ``homeserver.yaml``, set
  339. ``account_threepid_delegates.msisdn`` to the base URL of an identity
  340. server. For example:
  341. .. code:: yaml
  342. account_threepid_delegates:
  343. msisdn: https://example.com # Delegate sms sending to example.com
  344. The ``matrix.org`` and ``vector.im`` identity servers will continue to support
  345. delegated phone number verification via SMS until such time as it is possible
  346. for admins to configure their servers to perform phone number verification
  347. directly. More details will follow in a future release.
  348. Rolling back to v1.3.1
  349. ----------------------
  350. If you encounter problems with v1.4.0, it should be possible to roll back to
  351. v1.3.1, subject to the following:
  352. * The 'room statistics' engine was heavily reworked in this release (see
  353. `#5971 <https://github.com/matrix-org/synapse/pull/5971>`_), including
  354. significant changes to the database schema, which are not easily
  355. reverted. This will cause the room statistics engine to stop updating when
  356. you downgrade.
  357. The room statistics are essentially unused in v1.3.1 (in future versions of
  358. Synapse, they will be used to populate the room directory), so there should
  359. be no loss of functionality. However, the statistics engine will write errors
  360. to the logs, which can be avoided by setting the following in
  361. `homeserver.yaml`:
  362. .. code:: yaml
  363. stats:
  364. enabled: false
  365. Don't forget to re-enable it when you upgrade again, in preparation for its
  366. use in the room directory!
  367. Upgrading to v1.2.0
  368. ===================
  369. Some counter metrics have been renamed, with the old names deprecated. See
  370. `the metrics documentation <docs/metrics-howto.md#renaming-of-metrics--deprecation-of-old-names-in-12>`_
  371. for details.
  372. Upgrading to v1.1.0
  373. ===================
  374. Synapse v1.1.0 removes support for older Python and PostgreSQL versions, as
  375. outlined in `our deprecation notice <https://matrix.org/blog/2019/04/08/synapse-deprecating-postgres-9-4-and-python-2-x>`_.
  376. Minimum Python Version
  377. ----------------------
  378. Synapse v1.1.0 has a minimum Python requirement of Python 3.5. Python 3.6 or
  379. Python 3.7 are recommended as they have improved internal string handling,
  380. significantly reducing memory usage.
  381. If you use current versions of the Matrix.org-distributed Debian packages or
  382. Docker images, action is not required.
  383. If you install Synapse in a Python virtual environment, please see "Upgrading to
  384. v0.34.0" for notes on setting up a new virtualenv under Python 3.
  385. Minimum PostgreSQL Version
  386. --------------------------
  387. If using PostgreSQL under Synapse, you will need to use PostgreSQL 9.5 or above.
  388. Please see the
  389. `PostgreSQL documentation <https://www.postgresql.org/docs/11/upgrading.html>`_
  390. for more details on upgrading your database.
  391. Upgrading to v1.0
  392. =================
  393. Validation of TLS certificates
  394. ------------------------------
  395. Synapse v1.0 is the first release to enforce
  396. validation of TLS certificates for the federation API. It is therefore
  397. essential that your certificates are correctly configured. See the `FAQ
  398. <docs/MSC1711_certificates_FAQ.md>`_ for more information.
  399. Note, v1.0 installations will also no longer be able to federate with servers
  400. that have not correctly configured their certificates.
  401. In rare cases, it may be desirable to disable certificate checking: for
  402. example, it might be essential to be able to federate with a given legacy
  403. server in a closed federation. This can be done in one of two ways:-
  404. * Configure the global switch ``federation_verify_certificates`` to ``false``.
  405. * Configure a whitelist of server domains to trust via ``federation_certificate_verification_whitelist``.
  406. See the `sample configuration file <docs/sample_config.yaml>`_
  407. for more details on these settings.
  408. Email
  409. -----
  410. When a user requests a password reset, Synapse will send an email to the
  411. user to confirm the request.
  412. Previous versions of Synapse delegated the job of sending this email to an
  413. identity server. If the identity server was somehow malicious or became
  414. compromised, it would be theoretically possible to hijack an account through
  415. this means.
  416. Therefore, by default, Synapse v1.0 will send the confirmation email itself. If
  417. Synapse is not configured with an SMTP server, password reset via email will be
  418. disabled.
  419. To configure an SMTP server for Synapse, modify the configuration section
  420. headed ``email``, and be sure to have at least the ``smtp_host``, ``smtp_port``
  421. and ``notif_from`` fields filled out. You may also need to set ``smtp_user``,
  422. ``smtp_pass``, and ``require_transport_security``.
  423. If you are absolutely certain that you wish to continue using an identity
  424. server for password resets, set ``trust_identity_server_for_password_resets`` to ``true``.
  425. See the `sample configuration file <docs/sample_config.yaml>`_
  426. for more details on these settings.
  427. New email templates
  428. ---------------
  429. Some new templates have been added to the default template directory for the purpose of the
  430. homeserver sending its own password reset emails. If you have configured a custom
  431. ``template_dir`` in your Synapse config, these files will need to be added.
  432. ``password_reset.html`` and ``password_reset.txt`` are HTML and plain text templates
  433. respectively that contain the contents of what will be emailed to the user upon attempting to
  434. reset their password via email. ``password_reset_success.html`` and
  435. ``password_reset_failure.html`` are HTML files that the content of which (assuming no redirect
  436. URL is set) will be shown to the user after they attempt to click the link in the email sent
  437. to them.
  438. Upgrading to v0.99.0
  439. ====================
  440. Please be aware that, before Synapse v1.0 is released around March 2019, you
  441. will need to replace any self-signed certificates with those verified by a
  442. root CA. Information on how to do so can be found at `the ACME docs
  443. <docs/ACME.md>`_.
  444. For more information on configuring TLS certificates see the `FAQ <docs/MSC1711_certificates_FAQ.md>`_.
  445. Upgrading to v0.34.0
  446. ====================
  447. 1. This release is the first to fully support Python 3. Synapse will now run on
  448. Python versions 3.5, or 3.6 (as well as 2.7). We recommend switching to
  449. Python 3, as it has been shown to give performance improvements.
  450. For users who have installed Synapse into a virtualenv, we recommend doing
  451. this by creating a new virtualenv. For example::
  452. virtualenv -p python3 ~/synapse/env3
  453. source ~/synapse/env3/bin/activate
  454. pip install matrix-synapse
  455. You can then start synapse as normal, having activated the new virtualenv::
  456. cd ~/synapse
  457. source env3/bin/activate
  458. synctl start
  459. Users who have installed from distribution packages should see the relevant
  460. package documentation. See below for notes on Debian packages.
  461. * When upgrading to Python 3, you **must** make sure that your log files are
  462. configured as UTF-8, by adding ``encoding: utf8`` to the
  463. ``RotatingFileHandler`` configuration (if you have one) in your
  464. ``<server>.log.config`` file. For example, if your ``log.config`` file
  465. contains::
  466. handlers:
  467. file:
  468. class: logging.handlers.RotatingFileHandler
  469. formatter: precise
  470. filename: homeserver.log
  471. maxBytes: 104857600
  472. backupCount: 10
  473. filters: [context]
  474. console:
  475. class: logging.StreamHandler
  476. formatter: precise
  477. filters: [context]
  478. Then you should update this to be::
  479. handlers:
  480. file:
  481. class: logging.handlers.RotatingFileHandler
  482. formatter: precise
  483. filename: homeserver.log
  484. maxBytes: 104857600
  485. backupCount: 10
  486. filters: [context]
  487. encoding: utf8
  488. console:
  489. class: logging.StreamHandler
  490. formatter: precise
  491. filters: [context]
  492. There is no need to revert this change if downgrading to Python 2.
  493. We are also making available Debian packages which will run Synapse on
  494. Python 3. You can switch to these packages with ``apt-get install
  495. matrix-synapse-py3``, however, please read `debian/NEWS
  496. <https://github.com/matrix-org/synapse/blob/release-v0.34.0/debian/NEWS>`_
  497. before doing so. The existing ``matrix-synapse`` packages will continue to
  498. use Python 2 for the time being.
  499. 2. This release removes the ``riot.im`` from the default list of trusted
  500. identity servers.
  501. If ``riot.im`` is in your homeserver's list of
  502. ``trusted_third_party_id_servers``, you should remove it. It was added in
  503. case a hypothetical future identity server was put there. If you don't
  504. remove it, users may be unable to deactivate their accounts.
  505. 3. This release no longer installs the (unmaintained) Matrix Console web client
  506. as part of the default installation. It is possible to re-enable it by
  507. installing it separately and setting the ``web_client_location`` config
  508. option, but please consider switching to another client.
  509. Upgrading to v0.33.7
  510. ====================
  511. This release removes the example email notification templates from
  512. ``res/templates`` (they are now internal to the python package). This should
  513. only affect you if you (a) deploy your Synapse instance from a git checkout or
  514. a github snapshot URL, and (b) have email notifications enabled.
  515. If you have email notifications enabled, you should ensure that
  516. ``email.template_dir`` is either configured to point at a directory where you
  517. have installed customised templates, or leave it unset to use the default
  518. templates.
  519. Upgrading to v0.27.3
  520. ====================
  521. This release expands the anonymous usage stats sent if the opt-in
  522. ``report_stats`` configuration is set to ``true``. We now capture RSS memory
  523. and cpu use at a very coarse level. This requires administrators to install
  524. the optional ``psutil`` python module.
  525. We would appreciate it if you could assist by ensuring this module is available
  526. and ``report_stats`` is enabled. This will let us see if performance changes to
  527. synapse are having an impact to the general community.
  528. Upgrading to v0.15.0
  529. ====================
  530. If you want to use the new URL previewing API (/_matrix/media/r0/preview_url)
  531. then you have to explicitly enable it in the config and update your dependencies
  532. dependencies. See README.rst for details.
  533. Upgrading to v0.11.0
  534. ====================
  535. This release includes the option to send anonymous usage stats to matrix.org,
  536. and requires that administrators explictly opt in or out by setting the
  537. ``report_stats`` option to either ``true`` or ``false``.
  538. We would really appreciate it if you could help our project out by reporting
  539. anonymized usage statistics from your homeserver. Only very basic aggregate
  540. data (e.g. number of users) will be reported, but it helps us to track the
  541. growth of the Matrix community, and helps us to make Matrix a success, as well
  542. as to convince other networks that they should peer with us.
  543. Upgrading to v0.9.0
  544. ===================
  545. Application services have had a breaking API change in this version.
  546. They can no longer register themselves with a home server using the AS HTTP API. This
  547. decision was made because a compromised application service with free reign to register
  548. any regex in effect grants full read/write access to the home server if a regex of ``.*``
  549. is used. An attack where a compromised AS re-registers itself with ``.*`` was deemed too
  550. big of a security risk to ignore, and so the ability to register with the HS remotely has
  551. been removed.
  552. It has been replaced by specifying a list of application service registrations in
  553. ``homeserver.yaml``::
  554. app_service_config_files: ["registration-01.yaml", "registration-02.yaml"]
  555. Where ``registration-01.yaml`` looks like::
  556. url: <String> # e.g. "https://my.application.service.com"
  557. as_token: <String>
  558. hs_token: <String>
  559. sender_localpart: <String> # This is a new field which denotes the user_id localpart when using the AS token
  560. namespaces:
  561. users:
  562. - exclusive: <Boolean>
  563. regex: <String> # e.g. "@prefix_.*"
  564. aliases:
  565. - exclusive: <Boolean>
  566. regex: <String>
  567. rooms:
  568. - exclusive: <Boolean>
  569. regex: <String>
  570. Upgrading to v0.8.0
  571. ===================
  572. Servers which use captchas will need to add their public key to::
  573. static/client/register/register_config.js
  574. window.matrixRegistrationConfig = {
  575. recaptcha_public_key: "YOUR_PUBLIC_KEY"
  576. };
  577. This is required in order to support registration fallback (typically used on
  578. mobile devices).
  579. Upgrading to v0.7.0
  580. ===================
  581. New dependencies are:
  582. - pydenticon
  583. - simplejson
  584. - syutil
  585. - matrix-angular-sdk
  586. To pull in these dependencies in a virtual env, run::
  587. python synapse/python_dependencies.py | xargs -n 1 pip install
  588. Upgrading to v0.6.0
  589. ===================
  590. To pull in new dependencies, run::
  591. python setup.py develop --user
  592. This update includes a change to the database schema. To upgrade you first need
  593. to upgrade the database by running::
  594. python scripts/upgrade_db_to_v0.6.0.py <db> <server_name> <signing_key>
  595. Where `<db>` is the location of the database, `<server_name>` is the
  596. server name as specified in the synapse configuration, and `<signing_key>` is
  597. the location of the signing key as specified in the synapse configuration.
  598. This may take some time to complete. Failures of signatures and content hashes
  599. can safely be ignored.
  600. Upgrading to v0.5.1
  601. ===================
  602. Depending on precisely when you installed v0.5.0 you may have ended up with
  603. a stale release of the reference matrix webclient installed as a python module.
  604. To uninstall it and ensure you are depending on the latest module, please run::
  605. $ pip uninstall syweb
  606. Upgrading to v0.5.0
  607. ===================
  608. The webclient has been split out into a seperate repository/pacakage in this
  609. release. Before you restart your homeserver you will need to pull in the
  610. webclient package by running::
  611. python setup.py develop --user
  612. This release completely changes the database schema and so requires upgrading
  613. it before starting the new version of the homeserver.
  614. The script "database-prepare-for-0.5.0.sh" should be used to upgrade the
  615. database. This will save all user information, such as logins and profiles,
  616. but will otherwise purge the database. This includes messages, which
  617. rooms the home server was a member of and room alias mappings.
  618. If you would like to keep your history, please take a copy of your database
  619. file and ask for help in #matrix:matrix.org. The upgrade process is,
  620. unfortunately, non trivial and requires human intervention to resolve any
  621. resulting conflicts during the upgrade process.
  622. Before running the command the homeserver should be first completely
  623. shutdown. To run it, simply specify the location of the database, e.g.:
  624. ./scripts/database-prepare-for-0.5.0.sh "homeserver.db"
  625. Once this has successfully completed it will be safe to restart the
  626. homeserver. You may notice that the homeserver takes a few seconds longer to
  627. restart than usual as it reinitializes the database.
  628. On startup of the new version, users can either rejoin remote rooms using room
  629. aliases or by being reinvited. Alternatively, if any other homeserver sends a
  630. message to a room that the homeserver was previously in the local HS will
  631. automatically rejoin the room.
  632. Upgrading to v0.4.0
  633. ===================
  634. This release needs an updated syutil version. Run::
  635. python setup.py develop
  636. You will also need to upgrade your configuration as the signing key format has
  637. changed. Run::
  638. python -m synapse.app.homeserver --config-path <CONFIG> --generate-config
  639. Upgrading to v0.3.0
  640. ===================
  641. This registration API now closely matches the login API. This introduces a bit
  642. more backwards and forwards between the HS and the client, but this improves
  643. the overall flexibility of the API. You can now GET on /register to retrieve a list
  644. of valid registration flows. Upon choosing one, they are submitted in the same
  645. way as login, e.g::
  646. {
  647. type: m.login.password,
  648. user: foo,
  649. password: bar
  650. }
  651. The default HS supports 2 flows, with and without Identity Server email
  652. authentication. Enabling captcha on the HS will add in an extra step to all
  653. flows: ``m.login.recaptcha`` which must be completed before you can transition
  654. to the next stage. There is a new login type: ``m.login.email.identity`` which
  655. contains the ``threepidCreds`` key which were previously sent in the original
  656. register request. For more information on this, see the specification.
  657. Web Client
  658. ----------
  659. The VoIP specification has changed between v0.2.0 and v0.3.0. Users should
  660. refresh any browser tabs to get the latest web client code. Users on
  661. v0.2.0 of the web client will not be able to call those on v0.3.0 and
  662. vice versa.
  663. Upgrading to v0.2.0
  664. ===================
  665. The home server now requires setting up of SSL config before it can run. To
  666. automatically generate default config use::
  667. $ python synapse/app/homeserver.py \
  668. --server-name machine.my.domain.name \
  669. --bind-port 8448 \
  670. --config-path homeserver.config \
  671. --generate-config
  672. This config can be edited if desired, for example to specify a different SSL
  673. certificate to use. Once done you can run the home server using::
  674. $ python synapse/app/homeserver.py --config-path homeserver.config
  675. See the README.rst for more information.
  676. Also note that some config options have been renamed, including:
  677. - "host" to "server-name"
  678. - "database" to "database-path"
  679. - "port" to "bind-port" and "unsecure-port"
  680. Upgrading to v0.0.1
  681. ===================
  682. This release completely changes the database schema and so requires upgrading
  683. it before starting the new version of the homeserver.
  684. The script "database-prepare-for-0.0.1.sh" should be used to upgrade the
  685. database. This will save all user information, such as logins and profiles,
  686. but will otherwise purge the database. This includes messages, which
  687. rooms the home server was a member of and room alias mappings.
  688. Before running the command the homeserver should be first completely
  689. shutdown. To run it, simply specify the location of the database, e.g.:
  690. ./scripts/database-prepare-for-0.0.1.sh "homeserver.db"
  691. Once this has successfully completed it will be safe to restart the
  692. homeserver. You may notice that the homeserver takes a few seconds longer to
  693. restart than usual as it reinitializes the database.
  694. On startup of the new version, users can either rejoin remote rooms using room
  695. aliases or by being reinvited. Alternatively, if any other homeserver sends a
  696. message to a room that the homeserver was previously in the local HS will
  697. automatically rejoin the room.