[matrix] add well known ours to both servers

This commit is contained in:
Nico Schottelius 2021-12-25 17:59:12 +01:00
parent ab321f9558
commit 7b73f948fb
3 changed files with 32 additions and 29 deletions

View File

@ -1,31 +1,4 @@
## Components
### element-web
* Needs config: /app/config.json
* Needs FQDN for HTTPS / nginx
* Maybe limit the builtin webserver to localhost?
* Configmap to /etc/nginx/conf.d/default.conf
* Entrypoint `nginx -g daemon off`D
To add:
```
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header Content-Security-Policy "frame-ancestors 'none'";
```
## Missing
- SMTP settings / secrets (ungleich mail + sops?)
### admin user
docker exec -it synapse register_new_matrix_user http://localhost:8008 -c /data/homeserver.yaml --help
## Usage
## Usage and Components
### Element-Web
@ -33,6 +6,8 @@ docker exec -it synapse register_new_matrix_user http://localhost:8008 -c /data/
* Includes nginx on port localhost:8080 (http)
* Includes nginx proxy on port 80+443 (http redirect, https)
The service is reachable as `{{ .Release.Name }}-element-web`.
### Synapse
* homeserver.yaml is created from a ConfigMap in /config-ro
@ -40,12 +15,25 @@ docker exec -it synapse register_new_matrix_user http://localhost:8008 -c /data/
stored in /config/homeserver.yaml
* Logging configured to stdout
The service is reachable as `{{ .Release.Name }}`.
### Postgres
Tuned with `--no-locale --encoding=UTF8` using `POSTGRES_INITDB_ARGS` (required by synapse).
The service is reachable as `{{ .Release.Name }}-postgres`.
See
* https://www.postgresql.org/docs/9.5/app-initdb.html
* https://hub.docker.com/_/postgres
* https://github.com/matrix-org/synapse/blob/develop/docs/postgres.md
## Missing
- SMTP settings / secrets (ungleich mail + sops?)
### admin user
docker exec -it synapse register_new_matrix_user http://localhost:8008 -c /data/homeserver.yaml --help

View File

@ -23,6 +23,12 @@ server {
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header Content-Security-Policy "frame-ancestors 'none'";
proxy_pass http://localhost:8080;
}
}

View File

@ -7,7 +7,16 @@ server {
ssl_certificate /etc/letsencrypt/live/{{ tpl .Values.synapseFQDN . }}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/{{ tpl .Values.synapseFQDN . }}/privkey.pem;
client_max_body_size 0;
client_max_body_size {{ .Values.max_filesize_in_mb}}m;
location /.well-known/matrix/server {
default_type application/json;
return 200 '{"m.server": "{{ tpl .Values.synapseFQDN . }}:443" }';
}
location /.well-known/matrix/client {
default_type application/json;
return 200 '{ "m.homeserver": { "base_url": "https://{{ tpl .Values.synapseFQDN . }}" } }';
}
location ~ /_matrix|/_synapse {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;