UPGRADE.rst 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399
  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.34.0
  34. ====================
  35. 1. This release is the first to fully support Python 3. Synapse will now run on
  36. Python versions 3.5, or 3.6 (as well as 2.7). We recommend switching to
  37. Python 3, as it has been shown to give performance improvements.
  38. For users who have installed Synapse into a virtualenv, we recommend doing
  39. this by creating a new virtualenv. For example::
  40. virtualenv -p python3 ~/synapse/env3
  41. source ~/synapse/env3/bin/activate
  42. pip install matrix-synapse
  43. You can then start synapse as normal, having activated the new virtualenv::
  44. cd ~/synapse
  45. source env3/bin/activate
  46. synctl start
  47. Users who have installed from distribution packages should see the relevant
  48. package documentation. See below for notes on Debian packages.
  49. * When upgrading to Python 3, you **must** make sure that your log files are
  50. configured as UTF-8, by adding ``encoding: utf8`` to the
  51. ``RotatingFileHandler`` configuration (if you have one) in your
  52. ``<server>.log.config`` file. For example, if your ``log.config`` file
  53. contains::
  54. handlers:
  55. file:
  56. class: logging.handlers.RotatingFileHandler
  57. formatter: precise
  58. filename: homeserver.log
  59. maxBytes: 104857600
  60. backupCount: 10
  61. filters: [context]
  62. console:
  63. class: logging.StreamHandler
  64. formatter: precise
  65. filters: [context]
  66. Then you should update this to be::
  67. handlers:
  68. file:
  69. class: logging.handlers.RotatingFileHandler
  70. formatter: precise
  71. filename: homeserver.log
  72. maxBytes: 104857600
  73. backupCount: 10
  74. filters: [context]
  75. encoding: utf8
  76. console:
  77. class: logging.StreamHandler
  78. formatter: precise
  79. filters: [context]
  80. There is no need to revert this change if downgrading to Python 2.
  81. We are also making available Debian packages which will run Synapse on
  82. Python 3. You can switch to these packages with ``apt-get install
  83. matrix-synapse-py3``, however, please read `debian/NEWS
  84. <https://github.com/matrix-org/synapse/blob/release-v0.34.0/debian/NEWS>`_
  85. before doing so. The existing ``matrix-synapse`` packages will continue to
  86. use Python 2 for the time being.
  87. 2. This release removes the ``riot.im`` from the default list of trusted
  88. identity servers.
  89. If ``riot.im`` is in your homeserver's list of
  90. ``trusted_third_party_id_servers``, you should remove it. It was added in
  91. case a hypothetical future identity server was put there. If you don't
  92. remove it, users may be unable to deactivate their accounts.
  93. 3. This release no longer installs the (unmaintained) Matrix Console web client
  94. as part of the default installation. It is possible to re-enable it by
  95. installing it separately and setting the ``web_client_location`` config
  96. option, but please consider switching to another client.
  97. Upgrading to v0.33.7
  98. ====================
  99. This release removes the example email notification templates from
  100. ``res/templates`` (they are now internal to the python package). This should
  101. only affect you if you (a) deploy your Synapse instance from a git checkout or
  102. a github snapshot URL, and (b) have email notifications enabled.
  103. If you have email notifications enabled, you should ensure that
  104. ``email.template_dir`` is either configured to point at a directory where you
  105. have installed customised templates, or leave it unset to use the default
  106. templates.
  107. Upgrading to v0.27.3
  108. ====================
  109. This release expands the anonymous usage stats sent if the opt-in
  110. ``report_stats`` configuration is set to ``true``. We now capture RSS memory
  111. and cpu use at a very coarse level. This requires administrators to install
  112. the optional ``psutil`` python module.
  113. We would appreciate it if you could assist by ensuring this module is available
  114. and ``report_stats`` is enabled. This will let us see if performance changes to
  115. synapse are having an impact to the general community.
  116. Upgrading to v0.15.0
  117. ====================
  118. If you want to use the new URL previewing API (/_matrix/media/r0/preview_url)
  119. then you have to explicitly enable it in the config and update your dependencies
  120. dependencies. See README.rst for details.
  121. Upgrading to v0.11.0
  122. ====================
  123. This release includes the option to send anonymous usage stats to matrix.org,
  124. and requires that administrators explictly opt in or out by setting the
  125. ``report_stats`` option to either ``true`` or ``false``.
  126. We would really appreciate it if you could help our project out by reporting
  127. anonymized usage statistics from your homeserver. Only very basic aggregate
  128. data (e.g. number of users) will be reported, but it helps us to track the
  129. growth of the Matrix community, and helps us to make Matrix a success, as well
  130. as to convince other networks that they should peer with us.
  131. Upgrading to v0.9.0
  132. ===================
  133. Application services have had a breaking API change in this version.
  134. They can no longer register themselves with a home server using the AS HTTP API. This
  135. decision was made because a compromised application service with free reign to register
  136. any regex in effect grants full read/write access to the home server if a regex of ``.*``
  137. is used. An attack where a compromised AS re-registers itself with ``.*`` was deemed too
  138. big of a security risk to ignore, and so the ability to register with the HS remotely has
  139. been removed.
  140. It has been replaced by specifying a list of application service registrations in
  141. ``homeserver.yaml``::
  142. app_service_config_files: ["registration-01.yaml", "registration-02.yaml"]
  143. Where ``registration-01.yaml`` looks like::
  144. url: <String> # e.g. "https://my.application.service.com"
  145. as_token: <String>
  146. hs_token: <String>
  147. sender_localpart: <String> # This is a new field which denotes the user_id localpart when using the AS token
  148. namespaces:
  149. users:
  150. - exclusive: <Boolean>
  151. regex: <String> # e.g. "@prefix_.*"
  152. aliases:
  153. - exclusive: <Boolean>
  154. regex: <String>
  155. rooms:
  156. - exclusive: <Boolean>
  157. regex: <String>
  158. Upgrading to v0.8.0
  159. ===================
  160. Servers which use captchas will need to add their public key to::
  161. static/client/register/register_config.js
  162. window.matrixRegistrationConfig = {
  163. recaptcha_public_key: "YOUR_PUBLIC_KEY"
  164. };
  165. This is required in order to support registration fallback (typically used on
  166. mobile devices).
  167. Upgrading to v0.7.0
  168. ===================
  169. New dependencies are:
  170. - pydenticon
  171. - simplejson
  172. - syutil
  173. - matrix-angular-sdk
  174. To pull in these dependencies in a virtual env, run::
  175. python synapse/python_dependencies.py | xargs -n 1 pip install
  176. Upgrading to v0.6.0
  177. ===================
  178. To pull in new dependencies, run::
  179. python setup.py develop --user
  180. This update includes a change to the database schema. To upgrade you first need
  181. to upgrade the database by running::
  182. python scripts/upgrade_db_to_v0.6.0.py <db> <server_name> <signing_key>
  183. Where `<db>` is the location of the database, `<server_name>` is the
  184. server name as specified in the synapse configuration, and `<signing_key>` is
  185. the location of the signing key as specified in the synapse configuration.
  186. This may take some time to complete. Failures of signatures and content hashes
  187. can safely be ignored.
  188. Upgrading to v0.5.1
  189. ===================
  190. Depending on precisely when you installed v0.5.0 you may have ended up with
  191. a stale release of the reference matrix webclient installed as a python module.
  192. To uninstall it and ensure you are depending on the latest module, please run::
  193. $ pip uninstall syweb
  194. Upgrading to v0.5.0
  195. ===================
  196. The webclient has been split out into a seperate repository/pacakage in this
  197. release. Before you restart your homeserver you will need to pull in the
  198. webclient package by running::
  199. python setup.py develop --user
  200. This release completely changes the database schema and so requires upgrading
  201. it before starting the new version of the homeserver.
  202. The script "database-prepare-for-0.5.0.sh" should be used to upgrade the
  203. database. This will save all user information, such as logins and profiles,
  204. but will otherwise purge the database. This includes messages, which
  205. rooms the home server was a member of and room alias mappings.
  206. If you would like to keep your history, please take a copy of your database
  207. file and ask for help in #matrix:matrix.org. The upgrade process is,
  208. unfortunately, non trivial and requires human intervention to resolve any
  209. resulting conflicts during the upgrade process.
  210. Before running the command the homeserver should be first completely
  211. shutdown. To run it, simply specify the location of the database, e.g.:
  212. ./scripts/database-prepare-for-0.5.0.sh "homeserver.db"
  213. Once this has successfully completed it will be safe to restart the
  214. homeserver. You may notice that the homeserver takes a few seconds longer to
  215. restart than usual as it reinitializes the database.
  216. On startup of the new version, users can either rejoin remote rooms using room
  217. aliases or by being reinvited. Alternatively, if any other homeserver sends a
  218. message to a room that the homeserver was previously in the local HS will
  219. automatically rejoin the room.
  220. Upgrading to v0.4.0
  221. ===================
  222. This release needs an updated syutil version. Run::
  223. python setup.py develop
  224. You will also need to upgrade your configuration as the signing key format has
  225. changed. Run::
  226. python -m synapse.app.homeserver --config-path <CONFIG> --generate-config
  227. Upgrading to v0.3.0
  228. ===================
  229. This registration API now closely matches the login API. This introduces a bit
  230. more backwards and forwards between the HS and the client, but this improves
  231. the overall flexibility of the API. You can now GET on /register to retrieve a list
  232. of valid registration flows. Upon choosing one, they are submitted in the same
  233. way as login, e.g::
  234. {
  235. type: m.login.password,
  236. user: foo,
  237. password: bar
  238. }
  239. The default HS supports 2 flows, with and without Identity Server email
  240. authentication. Enabling captcha on the HS will add in an extra step to all
  241. flows: ``m.login.recaptcha`` which must be completed before you can transition
  242. to the next stage. There is a new login type: ``m.login.email.identity`` which
  243. contains the ``threepidCreds`` key which were previously sent in the original
  244. register request. For more information on this, see the specification.
  245. Web Client
  246. ----------
  247. The VoIP specification has changed between v0.2.0 and v0.3.0. Users should
  248. refresh any browser tabs to get the latest web client code. Users on
  249. v0.2.0 of the web client will not be able to call those on v0.3.0 and
  250. vice versa.
  251. Upgrading to v0.2.0
  252. ===================
  253. The home server now requires setting up of SSL config before it can run. To
  254. automatically generate default config use::
  255. $ python synapse/app/homeserver.py \
  256. --server-name machine.my.domain.name \
  257. --bind-port 8448 \
  258. --config-path homeserver.config \
  259. --generate-config
  260. This config can be edited if desired, for example to specify a different SSL
  261. certificate to use. Once done you can run the home server using::
  262. $ python synapse/app/homeserver.py --config-path homeserver.config
  263. See the README.rst for more information.
  264. Also note that some config options have been renamed, including:
  265. - "host" to "server-name"
  266. - "database" to "database-path"
  267. - "port" to "bind-port" and "unsecure-port"
  268. Upgrading to v0.0.1
  269. ===================
  270. This release completely changes the database schema and so requires upgrading
  271. it before starting the new version of the homeserver.
  272. The script "database-prepare-for-0.0.1.sh" should be used to upgrade the
  273. database. This will save all user information, such as logins and profiles,
  274. but will otherwise purge the database. This includes messages, which
  275. rooms the home server was a member of and room alias mappings.
  276. Before running the command the homeserver should be first completely
  277. shutdown. To run it, simply specify the location of the database, e.g.:
  278. ./scripts/database-prepare-for-0.0.1.sh "homeserver.db"
  279. Once this has successfully completed it will be safe to restart the
  280. homeserver. You may notice that the homeserver takes a few seconds longer to
  281. restart than usual as it reinitializes the database.
  282. On startup of the new version, users can either rejoin remote rooms using room
  283. aliases or by being reinvited. Alternatively, if any other homeserver sends a
  284. message to a room that the homeserver was previously in the local HS will
  285. automatically rejoin the room.