From ee1a1665349cb06765fa66fd0c7818a19a0effef Mon Sep 17 00:00:00 2001 From: mwiegand Date: Mon, 12 Jul 2021 23:12:02 +0200 Subject: [PATCH] wip --- bundles/grafana/metadata.py | 28 +++++++++++++++++++++++----- bundles/influxdb2/metadata.py | 28 +++++++++++++++++++++++----- data/nginx/redirect.conf | 6 ++++++ nodes/htz.mails.py | 15 +++++++++++++++ 4 files changed, 67 insertions(+), 10 deletions(-) create mode 100644 data/nginx/redirect.conf diff --git a/bundles/grafana/metadata.py b/bundles/grafana/metadata.py index 6e3cd28..7230362 100644 --- a/bundles/grafana/metadata.py +++ b/bundles/grafana/metadata.py @@ -96,12 +96,30 @@ def datasource_key_to_name(metadata): } +# @metadata_reactor.provides( +# 'dns', +# ) +# def dns(metadata): +# return { +# 'dns': { +# metadata.get('grafana/hostname'): repo.libs.dns.get_a_records(metadata), +# } +# } + + @metadata_reactor.provides( - 'dns', + 'nginx/vhosts', ) -def dns(metadata): +def nginx(metadata): return { - 'dns': { - metadata.get('grafana/hostname'): repo.libs.dns.get_a_records(metadata), - } + 'nginx': { + 'vhosts': { + metadata.get('grafana/hostname'): { + 'content': 'nginx/proxy_pass.conf', + 'context': { + 'target': 'http://127.0.0.1:8300', + } + }, + }, + }, } diff --git a/bundles/influxdb2/metadata.py b/bundles/influxdb2/metadata.py index b3a831c..c26fcb1 100644 --- a/bundles/influxdb2/metadata.py +++ b/bundles/influxdb2/metadata.py @@ -44,12 +44,30 @@ def admin_password(metadata): } +# @metadata_reactor.provides( +# 'dns', +# ) +# def dns(metadata): +# return { +# 'dns': { +# metadata.get('influxdb/hostname'): repo.libs.dns.get_a_records(metadata), +# } +# } + + @metadata_reactor.provides( - 'dns', + 'nginx/vhosts', ) -def dns(metadata): +def nginx(metadata): return { - 'dns': { - metadata.get('influxdb/hostname'): repo.libs.dns.get_a_records(metadata), - } + 'nginx': { + 'vhosts': { + metadata.get('influxdb/hostname'): { + 'content': 'nginx/proxy_pass.conf', + 'context': { + 'target': 'http://127.0.0.1:8200', + } + }, + }, + }, } diff --git a/data/nginx/redirect.conf b/data/nginx/redirect.conf new file mode 100644 index 0000000..a859187 --- /dev/null +++ b/data/nginx/redirect.conf @@ -0,0 +1,6 @@ +server { + listen 443 ssl http2; + listen [::]:443 ssl http2; + server_name ${server_name}; + return 302 ${target}; +} diff --git a/nodes/htz.mails.py b/nodes/htz.mails.py index 519bb98..f565da0 100644 --- a/nodes/htz.mails.py +++ b/nodes/htz.mails.py @@ -29,6 +29,7 @@ 'woodpipe.de': [], 'ckn.li': [], 'islamicstate.eu': [], + 'hausamsilberberg.de': [], }, }, 'dns': { @@ -99,6 +100,20 @@ }, 'internal_dns': False, }, + 'influxdb.sublimity.de': { + 'content': 'nginx/proxy_pass.conf', + 'context': { + 'target': 'https://influxdb.sublimity.de:443', + }, + 'internal_dns': False, + }, + 'hausamsilberberg.de': { + 'content': 'nginx/redirect.conf', + 'context': { + 'target': 'https://www.internationaler-bund.de/standort/204516', + }, + 'internal_dns': False, + }, }, }, 'roundcube': {