Skip to content

Commit 4913f08

Browse files
author
Manu
committed
Initial log level setup
1 parent 86b5b4b commit 4913f08

File tree

5 files changed

+18
-2
lines changed

5 files changed

+18
-2
lines changed

authoritative/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ RUN apt-get -y --no-install-recommends install pdns-server pdns-backend-pgsql &&
1111

1212
COPY pdns.conf /etc/powerdns/pdns.d/pdns.conf
1313

14+
ARG LOG_LEVEL
15+
1416
RUN --mount=type=secret,id=db_password --mount=type=secret,id=api_key sed -i "s/secret_pdns_password/$(cat /run/secrets/db_password)/g" /etc/powerdns/pdns.d/pdns.conf && \
1517
sed -i "s/secret_api_key/$(cat /run/secrets/api_key)/g" /etc/powerdns/pdns.d/pdns.conf && \
18+
sed -i "s/log_level/${LOG_LEVEL}/g" /etc/powerdns/pdns.d/pdns.conf && \
1619
mkdir /var/run/pdns && \
1720
chown -R pdns:pdns /var/run/pdns /etc/powerdns/
1821

authoritative/pdns.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ webserver-allow-from=0.0.0.0/0
2222
guardian=yes
2323

2424
disable-axfr=yes
25+
26+
loglevel=log_level

docker-compose.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ services:
3030
- no-new-privileges
3131

3232
powerhole_pdns_authoritative:
33-
build: authoritative
33+
build:
34+
context: authoritative
35+
args:
36+
LOG_LEVEL: 6 # 3 - 6 (https://doc.powerdns.com/authoritative/settings.html#loglevel)
3437
image: powerhole:authoritative
3538
container_name: powerhole_pdns_authoritative
3639
hostname: powerhole_pdns_authoritative
@@ -104,7 +107,10 @@ services:
104107
- no-new-privileges
105108

106109
powerhole_pdns_recursor:
107-
build: recursor
110+
build:
111+
context: recursor
112+
args:
113+
LOG_LEVEL: 9 # 0 - 9 (https://doc.powerdns.com/recursor/settings.html#loglevel)
108114
image: powerhole:recursor
109115
container_name: powerhole_pdns_recursor
110116
hostname: powerhole_pdns_recursor

recursor/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ RUN apt-get -y --no-install-recommends install pdns-recursor && \
1111

1212
COPY --chown=pdns:pdns recursor.conf /etc/powerdns/recursor.d/recursor.conf
1313

14+
ARG LOG_LEVEL
15+
1416
RUN mkdir /var/run/pdns && \
17+
sed -i "s/log_level/${LOG_LEVEL}/g" /etc/powerdns/recursor.d/recursor.conf && \
1518
chown -R pdns:pdns /var/run/pdns
1619

1720
USER pdns

recursor/recursor.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ setuid=
77
serve-rfc1918=no
88
# Do not validate DNSSEC as it breaks many websites
99
dnssec=process-no-validate
10+
11+
loglevel=log_level

0 commit comments

Comments
 (0)