Add api directory for api use (#8)

* Add API conf directory

* Correct PDNS recursor user on fedora

* Fix config user right
This commit is contained in:
Steve HOLWEG 2017-12-27 18:58:53 +01:00 committed by Peter Schiffer
parent 1d4840d5f7
commit 24b96e74a1
3 changed files with 15 additions and 0 deletions

View file

@ -8,6 +8,9 @@ RUN dnf -y --setopt=install_weak_deps=False install \
RUN pip3 install envtpl \ RUN pip3 install envtpl \
&& rm -rf ~/.cache/* && rm -rf ~/.cache/*
RUN mkdir -p /etc/pdns/api.d \
&& chown -R pdns-recursor:pdns-recursor /etc/pdns/api.d
ENV VERSION=4.0 \ ENV VERSION=4.0 \
PDNS_setuid=recursor \ PDNS_setuid=recursor \
PDNS_setgid=recursor \ PDNS_setgid=recursor \

View file

@ -8,6 +8,9 @@ RUN apk add --no-cache \
RUN pip3 install envtpl \ RUN pip3 install envtpl \
&& rm -rf ~/.cache/* && rm -rf ~/.cache/*
RUN mkdir -p /etc/pdns/api.d \
&& chown -R recursor:recursor /etc/pdns/api.d
ENV VERSION=4.0 \ ENV VERSION=4.0 \
PDNS_setuid=recursor \ PDNS_setuid=recursor \
PDNS_setgid=recursor \ PDNS_setgid=recursor \

View file

@ -11,4 +11,13 @@ export PDNS_local_port PDNS_local_address
# Create config file from template # Create config file from template
envtpl < /recursor.conf.tpl > /etc/pdns/recursor.conf envtpl < /recursor.conf.tpl > /etc/pdns/recursor.conf
# fix config right
if [ getent passwd | grep -c '^pdns-recursor:' ]; then
# Fedora user
chown pdns-recursor:pdns-recursor /etc/pdns/recursor.conf
else
# Alpine user
chown recursor:recursor /etc/pdns/recursor.conf
fi
exec /usr/sbin/pdns_recursor exec /usr/sbin/pdns_recursor