UPGRADE.rst 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. Upgrading Synapse
  2. =================
  3. Before upgrading check if any special steps are required to upgrade from the
  4. what you currently have installed to current version of synapse. The extra
  5. instructions that may be required are listed later in this document.
  6. 1. If synapse was installed in a virtualenv then active that virtualenv before
  7. upgrading. If synapse is installed in a virtualenv in ``~/.synapse/`` then
  8. run:
  9. .. code:: bash
  10. source ~/.synapse/bin/activate
  11. 2. If synapse was installed using pip then upgrade to the latest version by
  12. running:
  13. .. code:: bash
  14. pip install --upgrade --process-dependency-links matrix-synapse
  15. # restart synapse
  16. synctl restart
  17. If synapse was installed using git then upgrade to the latest version by
  18. running:
  19. .. code:: bash
  20. # Pull the latest version of the master branch.
  21. git pull
  22. # Update the versions of synapse's python dependencies.
  23. python synapse/python_dependencies.py | xargs pip install --upgrade
  24. # restart synapse
  25. ./synctl restart
  26. To check whether your update was sucessful, you can check the Server header
  27. returned by the Client-Server API:
  28. .. code:: bash
  29. # replace <host.name> with the hostname of your synapse homeserver.
  30. # You may need to specify a port (eg, :8448) if your server is not
  31. # configured on port 443.
  32. curl -kv https://<host.name>/_matrix/client/versions 2>&1 | grep "Server:"
  33. Upgrading to v0.33.7
  34. ====================
  35. This release removes the example email notification templates from
  36. ``res/templates`` (they are now internal to the python package). This should
  37. only affect you if you (a) deploy your Synapse instance from a git checkout or
  38. a github snapshot URL, and (b) have email notifications enabled.
  39. If you have email notifications enabled, you should ensure that
  40. ``email.template_dir`` is either configured to point at a directory where you
  41. have installed customised templates, or leave it unset to use the default
  42. templates.
  43. Upgrading to v0.27.3
  44. ====================
  45. This release expands the anonymous usage stats sent if the opt-in
  46. ``report_stats`` configuration is set to ``true``. We now capture RSS memory
  47. and cpu use at a very coarse level. This requires administrators to install
  48. the optional ``psutil`` python module.
  49. We would appreciate it if you could assist by ensuring this module is available
  50. and ``report_stats`` is enabled. This will let us see if performance changes to
  51. synapse are having an impact to the general community.
  52. Upgrading to v0.15.0
  53. ====================
  54. If you want to use the new URL previewing API (/_matrix/media/r0/preview_url)
  55. then you have to explicitly enable it in the config and update your dependencies
  56. dependencies. See README.rst for details.
  57. Upgrading to v0.11.0
  58. ====================
  59. This release includes the option to send anonymous usage stats to matrix.org,
  60. and requires that administrators explictly opt in or out by setting the
  61. ``report_stats`` option to either ``true`` or ``false``.
  62. We would really appreciate it if you could help our project out by reporting
  63. anonymized usage statistics from your homeserver. Only very basic aggregate
  64. data (e.g. number of users) will be reported, but it helps us to track the
  65. growth of the Matrix community, and helps us to make Matrix a success, as well
  66. as to convince other networks that they should peer with us.
  67. Upgrading to v0.9.0
  68. ===================
  69. Application services have had a breaking API change in this version.
  70. They can no longer register themselves with a home server using the AS HTTP API. This
  71. decision was made because a compromised application service with free reign to register
  72. any regex in effect grants full read/write access to the home server if a regex of ``.*``
  73. is used. An attack where a compromised AS re-registers itself with ``.*`` was deemed too
  74. big of a security risk to ignore, and so the ability to register with the HS remotely has
  75. been removed.
  76. It has been replaced by specifying a list of application service registrations in
  77. ``homeserver.yaml``::
  78. app_service_config_files: ["registration-01.yaml", "registration-02.yaml"]
  79. Where ``registration-01.yaml`` looks like::
  80. url: <String> # e.g. "https://my.application.service.com"
  81. as_token: <String>
  82. hs_token: <String>
  83. sender_localpart: <String> # This is a new field which denotes the user_id localpart when using the AS token
  84. namespaces:
  85. users:
  86. - exclusive: <Boolean>
  87. regex: <String> # e.g. "@prefix_.*"
  88. aliases:
  89. - exclusive: <Boolean>
  90. regex: <String>
  91. rooms:
  92. - exclusive: <Boolean>
  93. regex: <String>
  94. Upgrading to v0.8.0
  95. ===================
  96. Servers which use captchas will need to add their public key to::
  97. static/client/register/register_config.js
  98. window.matrixRegistrationConfig = {
  99. recaptcha_public_key: "YOUR_PUBLIC_KEY"
  100. };
  101. This is required in order to support registration fallback (typically used on
  102. mobile devices).
  103. Upgrading to v0.7.0
  104. ===================
  105. New dependencies are:
  106. - pydenticon
  107. - simplejson
  108. - syutil
  109. - matrix-angular-sdk
  110. To pull in these dependencies in a virtual env, run::
  111. python synapse/python_dependencies.py | xargs -n 1 pip install
  112. Upgrading to v0.6.0
  113. ===================
  114. To pull in new dependencies, run::
  115. python setup.py develop --user
  116. This update includes a change to the database schema. To upgrade you first need
  117. to upgrade the database by running::
  118. python scripts/upgrade_db_to_v0.6.0.py <db> <server_name> <signing_key>
  119. Where `<db>` is the location of the database, `<server_name>` is the
  120. server name as specified in the synapse configuration, and `<signing_key>` is
  121. the location of the signing key as specified in the synapse configuration.
  122. This may take some time to complete. Failures of signatures and content hashes
  123. can safely be ignored.
  124. Upgrading to v0.5.1
  125. ===================
  126. Depending on precisely when you installed v0.5.0 you may have ended up with
  127. a stale release of the reference matrix webclient installed as a python module.
  128. To uninstall it and ensure you are depending on the latest module, please run::
  129. $ pip uninstall syweb
  130. Upgrading to v0.5.0
  131. ===================
  132. The webclient has been split out into a seperate repository/pacakage in this
  133. release. Before you restart your homeserver you will need to pull in the
  134. webclient package by running::
  135. python setup.py develop --user
  136. This release completely changes the database schema and so requires upgrading
  137. it before starting the new version of the homeserver.
  138. The script "database-prepare-for-0.5.0.sh" should be used to upgrade the
  139. database. This will save all user information, such as logins and profiles,
  140. but will otherwise purge the database. This includes messages, which
  141. rooms the home server was a member of and room alias mappings.
  142. If you would like to keep your history, please take a copy of your database
  143. file and ask for help in #matrix:matrix.org. The upgrade process is,
  144. unfortunately, non trivial and requires human intervention to resolve any
  145. resulting conflicts during the upgrade process.
  146. Before running the command the homeserver should be first completely
  147. shutdown. To run it, simply specify the location of the database, e.g.:
  148. ./scripts/database-prepare-for-0.5.0.sh "homeserver.db"
  149. Once this has successfully completed it will be safe to restart the
  150. homeserver. You may notice that the homeserver takes a few seconds longer to
  151. restart than usual as it reinitializes the database.
  152. On startup of the new version, users can either rejoin remote rooms using room
  153. aliases or by being reinvited. Alternatively, if any other homeserver sends a
  154. message to a room that the homeserver was previously in the local HS will
  155. automatically rejoin the room.
  156. Upgrading to v0.4.0
  157. ===================
  158. This release needs an updated syutil version. Run::
  159. python setup.py develop
  160. You will also need to upgrade your configuration as the signing key format has
  161. changed. Run::
  162. python -m synapse.app.homeserver --config-path <CONFIG> --generate-config
  163. Upgrading to v0.3.0
  164. ===================
  165. This registration API now closely matches the login API. This introduces a bit
  166. more backwards and forwards between the HS and the client, but this improves
  167. the overall flexibility of the API. You can now GET on /register to retrieve a list
  168. of valid registration flows. Upon choosing one, they are submitted in the same
  169. way as login, e.g::
  170. {
  171. type: m.login.password,
  172. user: foo,
  173. password: bar
  174. }
  175. The default HS supports 2 flows, with and without Identity Server email
  176. authentication. Enabling captcha on the HS will add in an extra step to all
  177. flows: ``m.login.recaptcha`` which must be completed before you can transition
  178. to the next stage. There is a new login type: ``m.login.email.identity`` which
  179. contains the ``threepidCreds`` key which were previously sent in the original
  180. register request. For more information on this, see the specification.
  181. Web Client
  182. ----------
  183. The VoIP specification has changed between v0.2.0 and v0.3.0. Users should
  184. refresh any browser tabs to get the latest web client code. Users on
  185. v0.2.0 of the web client will not be able to call those on v0.3.0 and
  186. vice versa.
  187. Upgrading to v0.2.0
  188. ===================
  189. The home server now requires setting up of SSL config before it can run. To
  190. automatically generate default config use::
  191. $ python synapse/app/homeserver.py \
  192. --server-name machine.my.domain.name \
  193. --bind-port 8448 \
  194. --config-path homeserver.config \
  195. --generate-config
  196. This config can be edited if desired, for example to specify a different SSL
  197. certificate to use. Once done you can run the home server using::
  198. $ python synapse/app/homeserver.py --config-path homeserver.config
  199. See the README.rst for more information.
  200. Also note that some config options have been renamed, including:
  201. - "host" to "server-name"
  202. - "database" to "database-path"
  203. - "port" to "bind-port" and "unsecure-port"
  204. Upgrading to v0.0.1
  205. ===================
  206. This release completely changes the database schema and so requires upgrading
  207. it before starting the new version of the homeserver.
  208. The script "database-prepare-for-0.0.1.sh" should be used to upgrade the
  209. database. This will save all user information, such as logins and profiles,
  210. but will otherwise purge the database. This includes messages, which
  211. rooms the home server was a member of and room alias mappings.
  212. Before running the command the homeserver should be first completely
  213. shutdown. To run it, simply specify the location of the database, e.g.:
  214. ./scripts/database-prepare-for-0.0.1.sh "homeserver.db"
  215. Once this has successfully completed it will be safe to restart the
  216. homeserver. You may notice that the homeserver takes a few seconds longer to
  217. restart than usual as it reinitializes the database.
  218. On startup of the new version, users can either rejoin remote rooms using room
  219. aliases or by being reinvited. Alternatively, if any other homeserver sends a
  220. message to a room that the homeserver was previously in the local HS will
  221. automatically rejoin the room.