From 337b660f5a2a608a99273e2e9d3744e2fbdbc8b3 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Sat, 17 Jul 2021 09:32:49 +0200 Subject: [PATCH] bundles/matrix-synapse: ensure matrix-synapse does not mess with our homeserver.yaml --- bundles/matrix-synapse/files/report_stats.yaml | 5 +++++ bundles/matrix-synapse/files/server_name.yaml | 9 +++++++++ bundles/matrix-synapse/items.py | 12 ++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 bundles/matrix-synapse/files/report_stats.yaml create mode 100644 bundles/matrix-synapse/files/server_name.yaml diff --git a/bundles/matrix-synapse/files/report_stats.yaml b/bundles/matrix-synapse/files/report_stats.yaml new file mode 100644 index 0000000..117b73c --- /dev/null +++ b/bundles/matrix-synapse/files/report_stats.yaml @@ -0,0 +1,5 @@ +# This file is autogenerated, and will be recreated on upgrade if it is deleted. +# Any changes you make will be preserved. + +# Whether to report anonymized homeserver usage statistics. +report_stats: false diff --git a/bundles/matrix-synapse/files/server_name.yaml b/bundles/matrix-synapse/files/server_name.yaml new file mode 100644 index 0000000..411f800 --- /dev/null +++ b/bundles/matrix-synapse/files/server_name.yaml @@ -0,0 +1,9 @@ +# This file is autogenerated, and will be recreated on upgrade if it is deleted. +# Any changes you make will be preserved. + +# The domain name of the server, with optional explicit port. +# This is used by remote servers to connect to this server, +# e.g. matrix.org, localhost:8080, etc. +# This is also the last part of your UserID. +# +server_name: ${server_name} diff --git a/bundles/matrix-synapse/items.py b/bundles/matrix-synapse/items.py index 8643d07..7305e6b 100644 --- a/bundles/matrix-synapse/items.py +++ b/bundles/matrix-synapse/items.py @@ -24,6 +24,18 @@ files = { '/etc/matrix-synapse/homeserver.signing.key': { 'content': repo.vault.decrypt_file('matrix-synapse/{}/homeserver_signing.key.vault'.format(node.name)), }, + '/etc/matrix-synapse/conf.d/server_name.yaml': { + # We don't actually need this file. However, if we don't put the + # server name in there, synapse will somehow remove it from + # homeserver.yaml when installing a new matrix-synapse package. + # Our override.conf ensures this file is never read, so we don't + # need to restart synapse after changing stuff in here. + 'content_type': 'mako', + 'context': node.metadata['matrix-synapse'], + }, + '/etc/matrix-synapse/conf.d/report_stats.yaml': { + # see comment above + }, } svc_systemd = {