matrix-docker-ansible-deploy/docs/configuring-playbook-federation.md

67 lines
4.1 KiB
Markdown
Raw Normal View History

# Controlling Matrix federation (optional)
By default, your server federates with the whole Matrix network. That is, people on your server can communicate with people on any other Matrix server.
**Note**: in the sample `vars.yml` ([`examples/vars.yml`](../examples/vars.yml)), we recommend to use a short user ID like `@alice:example.com` instead of `@alice:matrix.example.com` and set up [server delegation](howto-server-delegation.md) / redirection. Without a proper configuration, your server will effectively not be part of the Matrix network. If you find your server is not federated, make sure to [check whether services work](maintenance-checking-services.md) and your server is properly delegated.
## Federating only with select servers
To make your server only federate with servers of your choosing, add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file (adapt to your needs):
```yaml
matrix_synapse_federation_domain_whitelist:
- example.com
- example.net
```
If you wish to disable federation, you can do that with an empty list (`[]`), or better yet by completely disabling federation (see below).
## Exposing the room directory over federation
By default, your server's public rooms directory is not exposed to other servers via federation.
Update docs: misc edits for consistency (#3911) * Add a warning sign to "Warning" labels Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs/configuring-playbook-matrix-registration.md Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs/maintenance-and-troubleshooting.md: remove a section for ma1sd As the project has not updated since several years, it does not seem to be reasonable to pick it up specially on the document. Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Common header for sections about adjusting the playbook configuration Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs/configuring-playbook-dendrite.md: fix links to dendrite.yaml.j2 Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs/configuring-playbook-bridge-mautrix-signal.md: remove a note added by a commit to remove signalgo The note has been added with 2f6525ccb3666e0ec8f295e8eeffd78bac15a23e, apparently copied from docs/configuring-playbook-bridge-mautrix-signalgo.md Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs/configuring-playbook-bridge-mautrix-wsproxy.md: fix the anchor link text to mautrix-imessage documentation Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs/configuring-playbook-etherpad.md: add a note about the component being managed externally Refer docs/configuring-playbook-backup-borg.md Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs/configuring-playbook-jitsi.md: use the common label for warning messages Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs/configuring-playbook-ldap-auth.md: unrecommend using ma1sd for authentication Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs/configuring-playbook-appservice-double-puppet.md: remove a duplicate anchor link Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs for old mautrix bridges for Facebook and Instagram: remove anchor links to the deleted files Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs/configuring-playbook-bridge-wechat.md: use common descriptions Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs/configuring-playbook-bridge-matrix-bridge-sms.md: create a section for the prerequisite Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs/maintenance-and-troubleshooting.md: use the common header text Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Use common descriptions for adding the configuration Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs/configuring-playbook-bridge-mautrix-telegram.md: small edits - Add a section for a Telegram API key - Add a section for instruction about Appservice Double Puppet or Shared Secret Auth Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs for Draupnir and Mjolnir: replace colons with periods Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs/configuring-playbook-rageshake.md: adopt the common instruction Based on docs/configuring-playbook-sygnal.md regarding the notification about necessity of the service. Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Add a note about the components managed externally Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> --------- Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> Co-authored-by: Suguru Hirahara <acioustick@noreply.codeberg.org>
2025-01-04 12:52:58 +00:00
To expose it, add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file:
```yaml
matrix_synapse_allow_public_rooms_over_federation: true
```
## Disabling federation
Update docs: misc edits for consistency (#3911) * Add a warning sign to "Warning" labels Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs/configuring-playbook-matrix-registration.md Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs/maintenance-and-troubleshooting.md: remove a section for ma1sd As the project has not updated since several years, it does not seem to be reasonable to pick it up specially on the document. Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Common header for sections about adjusting the playbook configuration Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs/configuring-playbook-dendrite.md: fix links to dendrite.yaml.j2 Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs/configuring-playbook-bridge-mautrix-signal.md: remove a note added by a commit to remove signalgo The note has been added with 2f6525ccb3666e0ec8f295e8eeffd78bac15a23e, apparently copied from docs/configuring-playbook-bridge-mautrix-signalgo.md Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs/configuring-playbook-bridge-mautrix-wsproxy.md: fix the anchor link text to mautrix-imessage documentation Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs/configuring-playbook-etherpad.md: add a note about the component being managed externally Refer docs/configuring-playbook-backup-borg.md Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs/configuring-playbook-jitsi.md: use the common label for warning messages Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs/configuring-playbook-ldap-auth.md: unrecommend using ma1sd for authentication Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs/configuring-playbook-appservice-double-puppet.md: remove a duplicate anchor link Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs for old mautrix bridges for Facebook and Instagram: remove anchor links to the deleted files Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs/configuring-playbook-bridge-wechat.md: use common descriptions Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs/configuring-playbook-bridge-matrix-bridge-sms.md: create a section for the prerequisite Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs/maintenance-and-troubleshooting.md: use the common header text Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Use common descriptions for adding the configuration Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs/configuring-playbook-bridge-mautrix-telegram.md: small edits - Add a section for a Telegram API key - Add a section for instruction about Appservice Double Puppet or Shared Secret Auth Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs for Draupnir and Mjolnir: replace colons with periods Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs/configuring-playbook-rageshake.md: adopt the common instruction Based on docs/configuring-playbook-sygnal.md regarding the notification about necessity of the service. Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Add a note about the components managed externally Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> --------- Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> Co-authored-by: Suguru Hirahara <acioustick@noreply.codeberg.org>
2025-01-04 12:52:58 +00:00
To completely disable federation, isolating your server from the rest of the Matrix network, add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file:
```yaml
matrix_homeserver_federation_enabled: false
```
With that, your server's users will only be able to talk among themselves, but not to anyone who is on another server.
**Disabling federation does not necessarily disable the federation port** (`8448`). Services like [Dimension](configuring-playbook-dimension.md) and [ma1sd](configuring-playbook-ma1sd.md) normally rely on `openid` APIs exposed on that port. Even if you disable federation and only if necessary, we may still be exposing the federation port and serving the `openid` APIs there. To override this and completely disable Synapse's federation port use:
```yaml
matrix_homeserver_federation_enabled: false
# This stops the federation port on the Synapse side (normally `matrix-synapse:8048` on the container network).
matrix_synapse_federation_port_enabled: false
# This stops the federation port on the synapse-reverse-proxy-companion side (normally `matrix-synapse-reverse-proxy-companion:8048` on the container network).
matrix_synapse_reverse_proxy_companion_federation_api_enabled: false
```
## Changing the federation port from 8448 to a different port to use a CDN that only accepts 443/80 ports
Why? This change could be useful for people running small Synapse instances on small severs/VPSes to avoid being impacted by a simple DOS/DDOS when bandwidth, RAM, an CPU resources are limited and if your hosting provider does not provide a DOS/DDOS protection.
Update docs: misc edits for consistency (#3911) * Add a warning sign to "Warning" labels Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs/configuring-playbook-matrix-registration.md Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs/maintenance-and-troubleshooting.md: remove a section for ma1sd As the project has not updated since several years, it does not seem to be reasonable to pick it up specially on the document. Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Common header for sections about adjusting the playbook configuration Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs/configuring-playbook-dendrite.md: fix links to dendrite.yaml.j2 Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs/configuring-playbook-bridge-mautrix-signal.md: remove a note added by a commit to remove signalgo The note has been added with 2f6525ccb3666e0ec8f295e8eeffd78bac15a23e, apparently copied from docs/configuring-playbook-bridge-mautrix-signalgo.md Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs/configuring-playbook-bridge-mautrix-wsproxy.md: fix the anchor link text to mautrix-imessage documentation Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs/configuring-playbook-etherpad.md: add a note about the component being managed externally Refer docs/configuring-playbook-backup-borg.md Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs/configuring-playbook-jitsi.md: use the common label for warning messages Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs/configuring-playbook-ldap-auth.md: unrecommend using ma1sd for authentication Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs/configuring-playbook-appservice-double-puppet.md: remove a duplicate anchor link Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs for old mautrix bridges for Facebook and Instagram: remove anchor links to the deleted files Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs/configuring-playbook-bridge-wechat.md: use common descriptions Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs/configuring-playbook-bridge-matrix-bridge-sms.md: create a section for the prerequisite Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs/maintenance-and-troubleshooting.md: use the common header text Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Use common descriptions for adding the configuration Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs/configuring-playbook-bridge-mautrix-telegram.md: small edits - Add a section for a Telegram API key - Add a section for instruction about Appservice Double Puppet or Shared Secret Auth Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs for Draupnir and Mjolnir: replace colons with periods Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Update docs/configuring-playbook-rageshake.md: adopt the common instruction Based on docs/configuring-playbook-sygnal.md regarding the notification about necessity of the service. Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> * Add a note about the components managed externally Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> --------- Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org> Co-authored-by: Suguru Hirahara <acioustick@noreply.codeberg.org>
2025-01-04 12:52:58 +00:00
To make it possible to proxy the federation through a CDN such as CloudFlare or any other, add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file:
```yaml
matrix_synapse_http_listener_resource_names: ["client","federation"]
# Any port can be used but in this case we use 443
matrix_federation_public_port: 443
matrix_synapse_federation_port_enabled: false
2022-02-20 10:56:03 +00:00
# Note that the following change might not be "required per se" but probably will be due to the proxying of the traffic through the CDN proxy servers (CloudFlare for instance). The security impact of doing this should be minimal as your CDN itself will encrypt the traffic no matter what on their proxy servers. You could however first try and see if federation works while setting the following to true.
matrix_synapse_tls_federation_listener_enabled: false
```
**Use this at you own risk as all the possible side-effects of doing this are not fully known. However, it has been tested and works fine and passes all the tests on <https://federationtester.matrix.org/> without issues.**