25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. Setting up federation
  2. =====================
  3. Federation is the process by which users on different servers can participate
  4. in the same room. For this to work, those other servers must be able to contact
  5. yours to send messages.
  6. The `server_name` configured in the Synapse configuration file (often
  7. `homeserver.yaml`) defines how resources (users, rooms, etc.) will be
  8. identified (eg: `@user:example.com`, `#room:example.com`). By default,
  9. it is also the domain that other servers will use to try to reach your
  10. server (via port 8448). This is easy to set up and will work provided
  11. you set the `server_name` to match your machine's public DNS hostname.
  12. For this default configuration to work, you will need to listen for TLS
  13. connections on port 8448. The preferred way to do that is by using a
  14. reverse proxy: see [the reverse proxy documentation](reverse_proxy.md) for instructions
  15. on how to correctly set one up.
  16. In some cases you might not want to run Synapse on the machine that has
  17. the `server_name` as its public DNS hostname, or you might want federation
  18. traffic to use a different port than 8448. For example, you might want to
  19. have your user names look like `@user:example.com`, but you want to run
  20. Synapse on `synapse.example.com` on port 443. This can be done using
  21. delegation, which allows an admin to control where federation traffic should
  22. be sent. See [the delegation documentation](delegate.md) for instructions on how to set this up.
  23. Once federation has been configured, you should be able to join a room over
  24. federation. A good place to start is `#synapse:matrix.org` - a room for
  25. Synapse admins.
  26. ## Troubleshooting
  27. You can use the [federation tester](https://matrix.org/federationtester)
  28. to check if your homeserver is configured correctly. Alternatively try the
  29. [JSON API used by the federation tester](https://matrix.org/federationtester/api/report?server_name=DOMAIN).
  30. Note that you'll have to modify this URL to replace `DOMAIN` with your
  31. `server_name`. Hitting the API directly provides extra detail.
  32. The typical failure mode for federation is that when the server tries to join
  33. a room, it is rejected with "401: Unauthorized". Generally this means that other
  34. servers in the room could not access yours. (Joining a room over federation is
  35. a complicated dance which requires connections in both directions).
  36. Another common problem is that people on other servers can't join rooms that
  37. you invite them to. This can be caused by an incorrectly-configured reverse
  38. proxy: see [the reverse proxy documentation](reverse_proxy.md) for instructions on how
  39. to correctly configure a reverse proxy.
  40. ### Known issues
  41. **HTTP `308 Permanent Redirect` redirects are not followed**: Due to missing features
  42. in the HTTP library used by Synapse, 308 redirects are currently not followed by
  43. federating servers, which can cause `M_UNKNOWN` or `401 Unauthorized` errors. This
  44. may affect users who are redirecting apex-to-www (e.g. `example.com` -> `www.example.com`),
  45. and especially users of the Kubernetes *Nginx Ingress* module, which uses 308 redirect
  46. codes by default. For those Kubernetes users, [this Stackoverflow post](https://stackoverflow.com/a/52617528/5096871)
  47. might be helpful. For other users, switching to a `301 Moved Permanently` code may be
  48. an option. 308 redirect codes will be supported properly in a future
  49. release of Synapse.
  50. ## Running a demo federation of Synapses
  51. If you want to get up and running quickly with a trio of homeservers in a
  52. private federation, there is a script in the `demo` directory. This is mainly
  53. useful just for development purposes. See
  54. [demo scripts](https://matrix-org.github.io/synapse/develop/development/demo.html).