From d10c5a2743c5c25d16d73b41a38c3a5c9ce39f97 Mon Sep 17 00:00:00 2001 From: mwiegand Date: Sat, 16 Oct 2021 15:42:35 +0200 Subject: [PATCH] rspamd --- bundles/rspamd/metadata.py | 32 ++++++++++++++++++++------------ nodes/htz.mails.py | 3 +++ 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/bundles/rspamd/metadata.py b/bundles/rspamd/metadata.py index 472aefd..3614bc6 100644 --- a/bundles/rspamd/metadata.py +++ b/bundles/rspamd/metadata.py @@ -10,21 +10,29 @@ defaults = { 'rspamd': {}, }, }, - 'nginx': { - 'vhosts': { - 'rspamd.sublimity.de': { - 'content': 'nginx/proxy_pass.conf', - 'context': { - 'target': 'http://localhost:11334', + 'rspamd': { + 'web_password': repo.vault.password_for(node.name + ' rspamd web password'), + 'ip_whitelist': set(), + }, +} + + +@metadata_reactor.provides( + 'nginx/vhosts', +) +def nginx_vhost(metadata): + return { + 'nginx': { + 'vhosts': { + metadata.get('rspamd/hostname'): { + 'content': 'nginx/proxy_pass.conf', + 'context': { + 'target': 'http://localhost:11334', + }, }, }, }, - }, - 'rspamd': { - 'web_password': repo.vault.password_for(node.name + ' rspamd web password'), - 'ip_whitelist': [], - }, -} + } @metadata_reactor.provides( diff --git a/nodes/htz.mails.py b/nodes/htz.mails.py index 9b1a271..1bdd129 100644 --- a/nodes/htz.mails.py +++ b/nodes/htz.mails.py @@ -81,6 +81,9 @@ 'woodpipe.de', ], }, + 'rspamd': { + 'hostname': 'rspamd.sublimity.de', + }, 'nginx': { 'vhosts': { 'cloud.sublimity.de': {