UPGRADE.rst 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  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. If synapse was installed in a virtualenv then active that virtualenv before
  7. upgrading. If synapse is installed in a virtualenv in ``~/.synapse/`` then run:
  8. .. code:: bash
  9. source ~/.synapse/bin/activate
  10. If synapse was installed using pip then upgrade to the latest version by
  11. running:
  12. .. code:: bash
  13. pip install --upgrade --process-dependency-links https://github.com/matrix-org/synapse/tarball/master
  14. If synapse was installed using git then upgrade to the latest version by
  15. running:
  16. .. code:: bash
  17. # Pull the latest version of the master branch.
  18. git pull
  19. # Update the versions of synapse's python dependencies.
  20. python synapse/python_dependencies.py | xargs -n1 pip install
  21. Upgrading to v0.9.0
  22. ===================
  23. Application services have had a breaking API change in this version.
  24. They can no longer register themselves with a home server using the AS HTTP API. This
  25. decision was made because a compromised application service with free reign to register
  26. any regex in effect grants full read/write access to the home server if a regex of ``.*``
  27. is used. An attack where a compromised AS re-registers itself with ``.*`` was deemed too
  28. big of a security risk to ignore, and so the ability to register with the HS remotely has
  29. been removed.
  30. It has been replaced by specifying a list of application service registrations in
  31. ``homeserver.yaml``::
  32. app_service_config_files: ["registration-01.yaml", "registration-02.yaml"]
  33. Where ``registration-01.yaml`` looks like::
  34. url: <String> # e.g. "https://my.application.service.com"
  35. as_token: <String>
  36. hs_token: <String>
  37. sender_localpart: <String> # This is a new field which denotes the user_id localpart when using the AS token
  38. namespaces:
  39. users:
  40. - exclusive: <Boolean>
  41. regex: <String> # e.g. "@prefix_.*"
  42. aliases:
  43. - exclusive: <Boolean>
  44. regex: <String>
  45. rooms:
  46. - exclusive: <Boolean>
  47. regex: <String>
  48. Upgrading to v0.8.0
  49. ===================
  50. Servers which use captchas will need to add their public key to::
  51. static/client/register/register_config.js
  52. window.matrixRegistrationConfig = {
  53. recaptcha_public_key: "YOUR_PUBLIC_KEY"
  54. };
  55. This is required in order to support registration fallback (typically used on
  56. mobile devices).
  57. Upgrading to v0.7.0
  58. ===================
  59. New dependencies are:
  60. - pydenticon
  61. - simplejson
  62. - syutil
  63. - matrix-angular-sdk
  64. To pull in these dependencies in a virtual env, run::
  65. python synapse/python_dependencies.py | xargs -n 1 pip install
  66. Upgrading to v0.6.0
  67. ===================
  68. To pull in new dependencies, run::
  69. python setup.py develop --user
  70. This update includes a change to the database schema. To upgrade you first need
  71. to upgrade the database by running::
  72. python scripts/upgrade_db_to_v0.6.0.py <db> <server_name> <signing_key>
  73. Where `<db>` is the location of the database, `<server_name>` is the
  74. server name as specified in the synapse configuration, and `<signing_key>` is
  75. the location of the signing key as specified in the synapse configuration.
  76. This may take some time to complete. Failures of signatures and content hashes
  77. can safely be ignored.
  78. Upgrading to v0.5.1
  79. ===================
  80. Depending on precisely when you installed v0.5.0 you may have ended up with
  81. a stale release of the reference matrix webclient installed as a python module.
  82. To uninstall it and ensure you are depending on the latest module, please run::
  83. $ pip uninstall syweb
  84. Upgrading to v0.5.0
  85. ===================
  86. The webclient has been split out into a seperate repository/pacakage in this
  87. release. Before you restart your homeserver you will need to pull in the
  88. webclient package by running::
  89. python setup.py develop --user
  90. This release completely changes the database schema and so requires upgrading
  91. it before starting the new version of the homeserver.
  92. The script "database-prepare-for-0.5.0.sh" should be used to upgrade the
  93. database. This will save all user information, such as logins and profiles,
  94. but will otherwise purge the database. This includes messages, which
  95. rooms the home server was a member of and room alias mappings.
  96. If you would like to keep your history, please take a copy of your database
  97. file and ask for help in #matrix:matrix.org. The upgrade process is,
  98. unfortunately, non trivial and requires human intervention to resolve any
  99. resulting conflicts during the upgrade process.
  100. Before running the command the homeserver should be first completely
  101. shutdown. To run it, simply specify the location of the database, e.g.:
  102. ./scripts/database-prepare-for-0.5.0.sh "homeserver.db"
  103. Once this has successfully completed it will be safe to restart the
  104. homeserver. You may notice that the homeserver takes a few seconds longer to
  105. restart than usual as it reinitializes the database.
  106. On startup of the new version, users can either rejoin remote rooms using room
  107. aliases or by being reinvited. Alternatively, if any other homeserver sends a
  108. message to a room that the homeserver was previously in the local HS will
  109. automatically rejoin the room.
  110. Upgrading to v0.4.0
  111. ===================
  112. This release needs an updated syutil version. Run::
  113. python setup.py develop
  114. You will also need to upgrade your configuration as the signing key format has
  115. changed. Run::
  116. python -m synapse.app.homeserver --config-path <CONFIG> --generate-config
  117. Upgrading to v0.3.0
  118. ===================
  119. This registration API now closely matches the login API. This introduces a bit
  120. more backwards and forwards between the HS and the client, but this improves
  121. the overall flexibility of the API. You can now GET on /register to retrieve a list
  122. of valid registration flows. Upon choosing one, they are submitted in the same
  123. way as login, e.g::
  124. {
  125. type: m.login.password,
  126. user: foo,
  127. password: bar
  128. }
  129. The default HS supports 2 flows, with and without Identity Server email
  130. authentication. Enabling captcha on the HS will add in an extra step to all
  131. flows: ``m.login.recaptcha`` which must be completed before you can transition
  132. to the next stage. There is a new login type: ``m.login.email.identity`` which
  133. contains the ``threepidCreds`` key which were previously sent in the original
  134. register request. For more information on this, see the specification.
  135. Web Client
  136. ----------
  137. The VoIP specification has changed between v0.2.0 and v0.3.0. Users should
  138. refresh any browser tabs to get the latest web client code. Users on
  139. v0.2.0 of the web client will not be able to call those on v0.3.0 and
  140. vice versa.
  141. Upgrading to v0.2.0
  142. ===================
  143. The home server now requires setting up of SSL config before it can run. To
  144. automatically generate default config use::
  145. $ python synapse/app/homeserver.py \
  146. --server-name machine.my.domain.name \
  147. --bind-port 8448 \
  148. --config-path homeserver.config \
  149. --generate-config
  150. This config can be edited if desired, for example to specify a different SSL
  151. certificate to use. Once done you can run the home server using::
  152. $ python synapse/app/homeserver.py --config-path homeserver.config
  153. See the README.rst for more information.
  154. Also note that some config options have been renamed, including:
  155. - "host" to "server-name"
  156. - "database" to "database-path"
  157. - "port" to "bind-port" and "unsecure-port"
  158. Upgrading to v0.0.1
  159. ===================
  160. This release completely changes the database schema and so requires upgrading
  161. it before starting the new version of the homeserver.
  162. The script "database-prepare-for-0.0.1.sh" should be used to upgrade the
  163. database. This will save all user information, such as logins and profiles,
  164. but will otherwise purge the database. This includes messages, which
  165. rooms the home server was a member of and room alias mappings.
  166. Before running the command the homeserver should be first completely
  167. shutdown. To run it, simply specify the location of the database, e.g.:
  168. ./scripts/database-prepare-for-0.0.1.sh "homeserver.db"
  169. Once this has successfully completed it will be safe to restart the
  170. homeserver. You may notice that the homeserver takes a few seconds longer to
  171. restart than usual as it reinitializes the database.
  172. On startup of the new version, users can either rejoin remote rooms using room
  173. aliases or by being reinvited. Alternatively, if any other homeserver sends a
  174. message to a room that the homeserver was previously in the local HS will
  175. automatically rejoin the room.