From 64ad23622b7afca4266e704d68b82a5db9e8bdda Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Wed, 23 May 2018 21:34:55 +0200 Subject: [PATCH] add registration file support --- Dockerfile | 2 +- README.md | 6 ++++++ rootfs/etc/confd/conf.d/server.yaml.toml | 2 +- rootfs/etc/confd/templates/server.yaml.tmpl | 9 +++++++-- rootfs/etc/fix-attrs.d/01-synapse | 1 + 5 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 956ebe8..e61b2af 100644 --- a/Dockerfile +++ b/Dockerfile @@ -52,4 +52,4 @@ ENV HOME /var/lib/matrix-synapse EXPOSE 8448 -VOLUME /var/lib/matrix-synapse/media_store/ /var/lib/matrix-synapse/uploads /var/lib/matrix-synapse/signing/ /etc/ssl/matrix-synapse/ +VOLUME /var/lib/matrix-synapse/media_store/ /var/lib/matrix-synapse/uploads /var/lib/matrix-synapse/signing/ /etc/ssl/matrix-synapse/ /var/lib/matrix-synapse/registrations/ diff --git a/README.md b/README.md index 348ff39..c029006 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ - `/var/lib/matrix-synapse/signing/` - `/var/lib/matrix-synapse/uploads/` - `/etc/ssl/matrix-synapse/:ro`: certificates have to be here +- `/var/lib/matrix-synapse/registrations/` # Environment Variables ## SERVER_NAME @@ -63,6 +64,11 @@ Whether to generate new thumbnails on the fly to precisely match the resolution ## REPORT_STATS - default: no +## REGISTRATIONS +- default: [] + +Comma seperated list of registration files to load. + Whether to report statistics. # Ports diff --git a/rootfs/etc/confd/conf.d/server.yaml.toml b/rootfs/etc/confd/conf.d/server.yaml.toml index c88c905..c5cb5b0 100644 --- a/rootfs/etc/confd/conf.d/server.yaml.toml +++ b/rootfs/etc/confd/conf.d/server.yaml.toml @@ -3,4 +3,4 @@ src = "server.yaml.tmpl" dest = "/var/lib/matrix-synapse/server.yaml" uid = 2222 gid = 2222 -mode = "0644" +mode = "0640" diff --git a/rootfs/etc/confd/templates/server.yaml.tmpl b/rootfs/etc/confd/templates/server.yaml.tmpl index e98efda..6f18138 100644 --- a/rootfs/etc/confd/templates/server.yaml.tmpl +++ b/rootfs/etc/confd/templates/server.yaml.tmpl @@ -114,7 +114,12 @@ room_invite_state_types: - "m.room.avatar" - "m.room.name" -app_service_config_files: [] +app_service_config_files: {{if not (getenv "REGISTRATIONS")}}[]{{end}} +{{if (getenv "REGISTRATIONS")}} +{{range $registration := split (getenv "REGISTRATIONS") ";"}} + - {{ $registration }} +{{end}} +{{end}} macaroon_secret_key: "{{getenv "MACAROON_SECRET_KEY"}}" expire_access_token: False @@ -122,7 +127,7 @@ expire_access_token: False signing_key_path: "/var/lib/matrix-synapse/signing/signing.key" old_signing_keys: {} -key_refresh_interval: "1d" # 1 Day. +key_refresh_interval: "1d" perspectives: servers: diff --git a/rootfs/etc/fix-attrs.d/01-synapse b/rootfs/etc/fix-attrs.d/01-synapse index ef822b8..1a03dd8 100644 --- a/rootfs/etc/fix-attrs.d/01-synapse +++ b/rootfs/etc/fix-attrs.d/01-synapse @@ -1,3 +1,4 @@ /var/lib/matrix-synapse/signing/ true matrix-synapse 0640 0750 /var/lib/matrix-synapse/media_store/ true matrix-synapse 0640 0750 /var/lib/matrix-synapse/uploads true matrix-synapse 0640 0750 +/var/lib/matrix-synapse/registrations true matrix-synapse 0640 0750