From 9896e87f7082fbee4cc8051358b043226d080bce Mon Sep 17 00:00:00 2001 From: Joerg Lehmann Date: Tue, 5 Jul 2022 19:10:21 +0200 Subject: [PATCH] documentation of DNS slave, wo-bisch docker version --- README.md | 97 +++++++++++++++++++++++++++++++++ wo-bisch_dev/docker-compose.yml | 62 +++++++++++++++++++++ wo-bisch_dev/telegraf.conf | 31 +++++++++++ 3 files changed, 190 insertions(+) create mode 100644 wo-bisch_dev/docker-compose.yml create mode 100644 wo-bisch_dev/telegraf.conf diff --git a/README.md b/README.md index 4c0b215..7163aaf 100644 --- a/README.md +++ b/README.md @@ -314,3 +314,100 @@ for dnsserver in ns1.nbit.ch ns2.nbit.ch ; do sleep 10 done ``` + + +### DNS Slave Server + +Dieser Server dient auch als DNS Slave Server (ns2.nbit.ch) + +```bash +# ufw allow domain +# apt install bind9 + +add Zones to /etc/bind/named.conf.local: + +zone "nbit.ch" IN { + type slave; + file "nbit.ch.zone"; + allow-notify { 94.130.184.127; 2a01:4f8:c2c:12ed::1; }; + masters { + 94.130.184.127; 2a01:4f8:c2c:12ed::1; + }; + allow-transfer { + 127.0.0.1; + }; +}; + +zone "linux-freelancer.ch" IN { + type slave; + file "linux-freelancer.ch.zone"; + allow-notify { 94.130.184.127; 2a01:4f8:c2c:12ed::1; }; + masters { + 94.130.184.127; 2a01:4f8:c2c:12ed::1; + }; + allow-transfer { + 127.0.0.1; + }; +}; + +zone "mini-beieli.ch" IN { + type slave; + file "mini-beieli.ch.zone"; + allow-notify { 94.130.184.127; 2a01:4f8:c2c:12ed::1; }; + masters { + 94.130.184.127; 2a01:4f8:c2c:12ed::1; + }; + allow-transfer { + 127.0.0.1; + }; +}; + +zone "wo-bisch.ch" IN { + type slave; + file "wo-bischch.zone"; + allow-notify { 94.130.184.127; 2a01:4f8:c2c:12ed::1; }; + masters { + 94.130.184.127; 2a01:4f8:c2c:12ed::1; + }; + allow-transfer { + 127.0.0.1; + }; +}; + +zone "ch-wirth.ch" IN { + type slave; + file "ch-wirth.ch.zone"; + allow-notify { 94.130.184.127; 2a01:4f8:c2c:12ed::1; }; + masters { + 94.130.184.127; 2a01:4f8:c2c:12ed::1; + }; + allow-transfer { + 127.0.0.1; + }; +}; + +zone "cmoag.com" IN { + type slave; + file "cmoag.com.zone"; + allow-notify { 94.130.184.127; 2a01:4f8:c2c:12ed::1; }; + masters { + 94.130.184.127; 2a01:4f8:c2c:12ed::1; + }; + allow-transfer { + 127.0.0.1; + }; +}; + +zone "acmoag.com" IN { + type slave; + file "acmoag.com.zone"; + allow-notify { 94.130.184.127; 2a01:4f8:c2c:12ed::1; }; + masters { + 94.130.184.127; 2a01:4f8:c2c:12ed::1; + }; + allow-transfer { + 127.0.0.1; + }; +}; +``` + diff --git a/wo-bisch_dev/docker-compose.yml b/wo-bisch_dev/docker-compose.yml new file mode 100644 index 0000000..08f9ed1 --- /dev/null +++ b/wo-bisch_dev/docker-compose.yml @@ -0,0 +1,62 @@ +version: '3.7' +services: + influxdb: + image: influxdb:latest + volumes: + - influxdb2:/var/lib/influxdb2 + restart: always + expose: + - 8086 + + redis: + image: redis:latest + restart: always + expose: + - 5432 + volumes: + - cache:/data + + telegraf: + image: telegraf:latest + restart: always + volumes: + - lorahandlerdata:/data + - ./telegraf.conf:/etc/telegraf/telegraf.conf + + lorahandler: + image: wo-bisch-lorahandler:latest + restart: always + volumes: + - lorahandlerdata:/data + environment: + - REDIS_CONNECTION_STRING=redis:6379 + labels: + - traefik.enable=true + - traefik.http.routers.wobischdevlorahandler.rule=Host(`dev2.wo-bisch.ch`) && PathPrefix(`/lorahandler`) + - traefik.http.routers.wobischdevlorahandler.entrypoints=websecure + + web: + image: wo-bisch-web:latest + restart: always + environment: + - REDIS_CONNECTION_STRING=redis:6379 + - INFLUX_URL=http://influxdb:8086/api/v2/query?org=wobischorg + - INFLUX_RO_TOKEN=TQvQxxLLAj1kTKWuEqcx7BA-KfE6WtJUeDlPa_Dnvms6Zqf6uh6lMbpXtzcsCjKO_x3PrpxxGDR5E6YnDB5PFg== + - STRIPE_KEY=sk_test_51Icq29K2XyHQRTs20aEeyUHH3WgE6nBkAKUFuXsQtbnZNIP5fap5zTLTaA0XvhIcRHkqt3vJ2nui6df8R9VDuDDh00nhzmWdHr + - STRIPE_PK=pk_test_51Icq29K2XyHQRTs2DeltUIWrbFb5evfJVGaQzMv4r50g8Q7HAUkSFr7BBGv0aP1damXIhM6fZ4Yf9Wz0qW6TpTVi00dWcW7J1O + labels: + - traefik.enable=true + - traefik.http.routers.wobischdev.rule=Host(`dev2.wo-bisch.ch`) + - traefik.http.routers.wobischdev.entrypoints=websecure + - traefik.http.routers.wobischdev.tls.certresolver=myresolver + - traefik.http.routers.wobischdev.tls.domains[0].main=dev2.wo-bisch.ch + +volumes: + influxdb2: + cache: + lorahandlerdata: + +networks: + default: + external: true + name: proxy_default diff --git a/wo-bisch_dev/telegraf.conf b/wo-bisch_dev/telegraf.conf new file mode 100644 index 0000000..20fa8aa --- /dev/null +++ b/wo-bisch_dev/telegraf.conf @@ -0,0 +1,31 @@ +[global_tags] + +# Configuration for telegraf agent +[agent] + interval = "10s" + round_interval = true + metric_batch_size = 1000 + metric_buffer_limit = 100000 + collection_jitter = "0s" + flush_interval = "10s" + flush_jitter = "0s" + precision = "" + debug = false + quiet = false + logfile = "" + hostname = "" + omit_hostname = false + +[[inputs.tail]] + files = ["/data/wo-bisch-lorahandler.log"] + from_beginning = false + pipe = false + tagexclude = ["path","host"] + data_format = "influx" + +# Configuration for sending metrics to InfluxDB 2.0 +[[outputs.influxdb_v2]] + urls = ["http://influxdb:8086"] + token = "PWuleFEPB2YSduUkzkcW94V_-KFDK5Fi3MAeaA999Qe51OsGlJJSrcZ41pUAppCwF-z3rUNnyFQQJs8fCSTFzg==" + organization = "wobischorg" + bucket = "wobischbucket"