pdns/docker-compose-traefik.yml aktualisiert
This commit is contained in:
@@ -24,12 +24,18 @@ services:
|
|||||||
- |
|
- |
|
||||||
set -eu
|
set -eu
|
||||||
mkdir -p /etc/powerdns/pdns.d
|
mkdir -p /etc/powerdns/pdns.d
|
||||||
mkdir -p /var/run/pdns
|
|
||||||
|
|
||||||
# Den richtigen Pfad zu pdns_server finden
|
# Suche das Binary an den zwei wahrscheinlichsten Orten
|
||||||
PDNS_BIN=$$(which pdns_server || echo "/usr/sbin/pdns_server")
|
if [ -f /usr/local/sbin/pdns_server ]; then
|
||||||
|
PDNS_BIN="/usr/local/sbin/pdns_server"
|
||||||
# Erzeuge die API & Webserver Konfiguration
|
elif [ -f /usr/sbin/pdns_server ]; then
|
||||||
|
PDNS_BIN="/usr/sbin/pdns_server"
|
||||||
|
else
|
||||||
|
# Notlösung: Suche im gesamten System
|
||||||
|
PDNS_BIN=$$(find /usr -name pdns_server | head -n 1)
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Konfiguration schreiben
|
||||||
cat > /etc/powerdns/pdns.d/99-env.conf <<EOF
|
cat > /etc/powerdns/pdns.d/99-env.conf <<EOF
|
||||||
api=yes
|
api=yes
|
||||||
webserver=yes
|
webserver=yes
|
||||||
@@ -41,21 +47,16 @@ services:
|
|||||||
launch=$${PDNS_LAUNCH}
|
launch=$${PDNS_LAUNCH}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Backend Spezifika
|
|
||||||
if [ "$${PDNS_LAUNCH}" = "gsqlite3" ]; then
|
if [ "$${PDNS_LAUNCH}" = "gsqlite3" ]; then
|
||||||
echo "gsqlite3-database=$${PDNS_GSQLITE3_DATABASE}" >> /etc/powerdns/pdns.d/99-env.conf
|
echo "gsqlite3-database=$${PDNS_GSQLITE3_DATABASE}" >> /etc/powerdns/pdns.d/99-env.conf
|
||||||
else
|
fi
|
||||||
cat >> /etc/powerdns/pdns.d/99-env.conf <<EOF
|
|
||||||
gpgsql-host=$${PDNS_GPGSQL_HOST}
|
if [ -z "$$PDNS_BIN" ]; then
|
||||||
gpgsql-port=$${PDNS_GPGSQL_PORT}
|
echo "ERROR: pdns_server not found!"
|
||||||
gpgsql-dbname=$${PDNS_GPGSQL_DBNAME}
|
exit 1
|
||||||
gpgsql-user=$${PDNS_GPGSQL_USER}
|
|
||||||
gpgsql-password=$${PDNS_GPGSQL_PASSWORD}
|
|
||||||
EOF
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Generated config. Starting $$PDNS_BIN..."
|
echo "Generated config. Starting $$PDNS_BIN..."
|
||||||
# Hier nutzen wir jetzt die gefundene Variable $$PDNS_BIN
|
|
||||||
exec $$PDNS_BIN --daemon=no --guardian=no --control-console
|
exec $$PDNS_BIN --daemon=no --guardian=no --control-console
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user