README.rst 11 KB

  1. =========================================================================
  2. Synapse |support| |development| |documentation| |license| |pypi| |python|
  3. =========================================================================
  4. Synapse is an open-source `Matrix <>`_ homeserver written and
  5. maintained by the Foundation. We began rapid development in 2014,
  6. reaching v1.0.0 in 2019. Development on Synapse and the Matrix protocol itself continues
  7. in earnest today.
  8. Briefly, Matrix is an open standard for communications on the internet, supporting
  9. federation, encryption and VoIP. has more to say about the `goals of the
  10. Matrix project <>`_, and the `formal specification
  11. <>`_ describes the technical details.
  12. .. contents::
  13. Installing and configuration
  14. ============================
  15. The Synapse documentation describes `how to install Synapse <>`_. We recommend using
  16. `Docker images <>`_ or `Debian packages from
  17. <>`_.
  18. .. _federation:
  19. Synapse has a variety of `config options
  20. <>`_
  21. which can be used to customise its behaviour after installation.
  22. There are additional details on how to `configure Synapse for federation here
  23. <>`_.
  24. .. _reverse-proxy:
  25. Using a reverse proxy with Synapse
  26. ----------------------------------
  27. It is recommended to put a reverse proxy such as
  28. `nginx <>`_,
  29. `Apache <>`_,
  30. `Caddy <>`_,
  31. `HAProxy <>`_ or
  32. `relayd <>`_ in front of Synapse. One advantage of
  33. doing so is that it means that you can expose the default https port (443) to
  34. Matrix clients without needing to run Synapse with root privileges.
  35. For information on configuring one, see `the reverse proxy docs
  36. <>`_.
  37. Upgrading an existing Synapse
  38. -----------------------------
  39. The instructions for upgrading Synapse are in `the upgrade notes`_.
  40. Please check these instructions as upgrading may require extra steps for some
  41. versions of Synapse.
  42. .. _the upgrade notes:
  43. Platform dependencies
  44. ---------------------
  45. Synapse uses a number of platform dependencies such as Python and PostgreSQL,
  46. and aims to follow supported upstream versions. See the
  47. `deprecation policy <>`_
  48. for more details.
  49. Security note
  50. -------------
  51. Matrix serves raw, user-supplied data in some APIs -- specifically the `content
  52. repository endpoints`_.
  53. .. _content repository endpoints:
  54. Whilst we make a reasonable effort to mitigate against XSS attacks (for
  55. instance, by using `CSP`_), a Matrix homeserver should not be hosted on a
  56. domain hosting other web applications. This especially applies to sharing
  57. the domain with Matrix web clients and other sensitive applications like
  58. webmail. See
  59. for more
  60. information.
  61. .. _CSP:
  62. Ideally, the homeserver should not simply be on a different subdomain, but on
  63. a completely different `registered domain`_ (also known as top-level site or
  64. eTLD+1). This is because `some attacks`_ are still possible as long as the two
  65. applications share the same registered domain.
  66. .. _registered domain:
  67. .. _some attacks:
  68. To illustrate this with an example, if your Element Web or other sensitive web
  69. application is hosted on ````, you should ideally host Synapse on
  70. ````. Some amount of protection is offered by hosting on
  71. ```` instead, so this is also acceptable in some scenarios.
  72. However, you should *not* host your Synapse on ````.
  73. Note that all of the above refers exclusively to the domain used in Synapse's
  74. ``public_baseurl`` setting. In particular, it has no bearing on the domain
  75. mentioned in MXIDs hosted on that server.
  76. Following this advice ensures that even if an XSS is found in Synapse, the
  77. impact to other applications will be minimal.
  78. Testing a new installation
  79. ==========================
  80. The easiest way to try out your new Synapse installation is by connecting to it
  81. from a web client.
  82. Unless you are running a test instance of Synapse on your local machine, in
  83. general, you will need to enable TLS support before you can successfully
  84. connect from a client: see
  85. `TLS certificates <>`_.
  86. An easy way to get started is to login or register via Element at
  87. or respectively.
  88. You will need to change the server you are logging into from ````
  89. and instead specify a Homeserver URL of ``https://<server_name>:8448``
  90. (or just ``https://<server_name>`` if you are using a reverse proxy).
  91. If you prefer to use another client, refer to our
  92. `client breakdown <>`_.
  93. If all goes well you should at least be able to log in, create a room, and
  94. start sending messages.
  95. .. _`client-user-reg`:
  96. Registering a new user from a client
  97. ------------------------------------
  98. By default, registration of new users via Matrix clients is disabled. To enable
  99. it:
  100. 1. In the
  101. `registration config section <>`_
  102. set ``enable_registration: true`` in ``homeserver.yaml``.
  103. 2. Then **either**:
  104. a. set up a `CAPTCHA <>`_, or
  105. b. set ``enable_registration_without_verification: true`` in ``homeserver.yaml``.
  106. We **strongly** recommend using a CAPTCHA, particularly if your homeserver is exposed to
  107. the public internet. Without it, anyone can freely register accounts on your homeserver.
  108. This can be exploited by attackers to create spambots targetting the rest of the Matrix
  109. federation.
  110. Your new user name will be formed partly from the ``server_name``, and partly
  111. from a localpart you specify when you create the account. Your name will take
  112. the form of::
  114. (pronounced "at localpart on my dot domain dot name").
  115. As when logging in, you will need to specify a "Custom server". Specify your
  116. desired ``localpart`` in the 'User name' box.
  117. Troubleshooting and support
  118. ===========================
  119. The `Admin FAQ <>`_
  120. includes tips on dealing with some common problems. For more details, see
  121. `Synapse's wider documentation <>`_.
  122. For additional support installing or managing Synapse, please ask in the community
  123. support room |room|_ (from a account if necessary). We do not use GitHub
  124. issues for support requests, only for bug reports and feature requests.
  125. .. |room| replace:: ````
  126. .. _room:
  127. .. |docs| replace:: ``docs``
  128. .. _docs: docs
  129. Identity Servers
  130. ================
  131. Identity servers have the job of mapping email addresses and other 3rd Party
  132. IDs (3PIDs) to Matrix user IDs, as well as verifying the ownership of 3PIDs
  133. before creating that mapping.
  134. **They are not where accounts or credentials are stored - these live on home
  135. servers. Identity Servers are just for mapping 3rd party IDs to matrix IDs.**
  136. This process is very security-sensitive, as there is obvious risk of spam if it
  137. is too easy to sign up for Matrix accounts or harvest 3PID data. In the longer
  138. term, we hope to create a decentralised system to manage it (`matrix-doc #712
  139. <>`_), but in the meantime,
  140. the role of managing trusted identity in the Matrix ecosystem is farmed out to
  141. a cluster of known trusted ecosystem partners, who run 'Matrix Identity
  142. Servers' such as `Sydent <>`_, whose role
  143. is purely to authenticate and track 3PID logins and publish end-user public
  144. keys.
  145. You can host your own copy of Sydent, but this will prevent you reaching other
  146. users in the Matrix ecosystem via their email address, and prevent them finding
  147. you. We therefore recommend that you use one of the centralised identity servers
  148. at ```` or ```` for now.
  149. To reiterate: the Identity server will only be used if you choose to associate
  150. an email address with your account, or send an invite to another user via their
  151. email address.
  152. Development
  153. ===========
  154. We welcome contributions to Synapse from the community!
  155. The best place to get started is our
  156. `guide for contributors <>`_.
  157. This is part of our larger `documentation <>`_, which includes
  158. information for Synapse developers as well as Synapse administrators.
  159. Developers might be particularly interested in:
  160. * `Synapse's database schema <>`_,
  161. * `notes on Synapse's implementation details <>`_, and
  162. * `how we use git <>`_.
  163. Alongside all that, join our developer community on Matrix:
  164. ` <>`_, featuring real humans!
  165. .. |support| image::
  166. :alt: (get support on
  167. :target:
  168. .. |development| image::
  169. :alt: (discuss development on
  170. :target:
  171. .. |documentation| image::
  172. :alt: (Rendered documentation on GitHub Pages)
  173. :target:
  174. .. |license| image::
  175. :alt: (check license in LICENSE file)
  176. :target: LICENSE
  177. .. |pypi| image::
  178. :alt: (latest version released on PyPi)
  179. :target:
  180. .. |python| image::
  181. :alt: (supported python versions)
  182. :target: