feat: disable federation

Closes #19.
This commit is contained in:
decentral1se 2021-12-12 23:50:45 +01:00
parent 650e0cbc28
commit 10e459f183
Signed by: decentral1se
GPG Key ID: 03789458B3D0C410
4 changed files with 20 additions and 0 deletions

View File

@ -6,3 +6,5 @@ LETS_ENCRYPT_ENV=production
SECRET_DB_PASSWORD_VERSION=v1
SYNAPSE_ADMIN_EMAIL=admin@example.com
DISABLE_FEDERATION=0

View File

@ -8,6 +8,7 @@ services:
- proxy
- internal
environment:
- DISABLE_FEDERATION
- DOMAIN
- STACK_NAME
configs:
@ -31,6 +32,7 @@ services:
secrets:
- db_password
environment:
- DISABLE_FEDERATION
- LETSENCRYPT_HOST=${DOMAIN}
- SYNAPSE_ADMIN_EMAIL
- SYNAPSE_REPORT_STATS=no

View File

@ -310,9 +310,15 @@ listeners:
type: http
x_forwarded: true
{{ if eq (env "DISABLE_FEDERATION") "1" }}
resources:
- names: [client]
compress: false
{{ else }}
resources:
- names: [client, federation]
compress: false
{{ end }}
# example additional_resources:
#
@ -649,6 +655,9 @@ retention:
# - lon.example.com
# - nyc.example.com
# - syd.example.com
{{ if eq (env "DISABLE_FEDERATION") "1" }}
federation_domain_whitelist: []
{{ end }}
# Report prometheus metrics on the age of PDUs being sent to and received from
# the following domains. This can be used to give an idea of "delay" on inbound

View File

@ -22,5 +22,12 @@ http {
proxy_set_header Host $host;
client_max_body_size 50M;
}
{{ if eq (env "DISABLE_FEDERATION") "1" }}
location /.well-known/matrix/ {
deny all
}
{{ end }}
}
}