UPGRADE.rst 32 KB

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