From 54d0c42da63f05f7658b63d58811546089030867 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Fri, 14 Jul 2023 05:45:00 +0200 Subject: [PATCH] bundles/matrix-synapse: auto-trust all own servers as keyservers --- bundles/matrix-synapse/metadata.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/bundles/matrix-synapse/metadata.py b/bundles/matrix-synapse/metadata.py index 46f64ca..8a3175a 100644 --- a/bundles/matrix-synapse/metadata.py +++ b/bundles/matrix-synapse/metadata.py @@ -156,3 +156,20 @@ def nginx(metadata): 'vhosts': vhosts }, } + +@metadata_reactor.provides( + 'matrix-synapse/trusted_key_servers', +) +def autotrust_our_own_servers(metadata): + domains = set() + for rnode in repo.nodes: + if not rnode.has_bundle('matrix-synapse'): + continue + + domains.add(rnode.metadata.get('matrix-synapse/server_name')) + + return { + 'matrix-synapse': { + 'trusted_key_servers': domains, + }, + }