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, + }, + }