Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow turning on --verbose mode by environment variable $DEBUG_MODE #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions docker/ddns/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ FROM golang:alpine

RUN apk add --no-cache git

COPY docker/ddns/entrypoint.sh /entrypoint.sh
WORKDIR /go/src/github.com/pboehm/ddns
COPY . .

Expand All @@ -11,8 +12,4 @@ RUN GO111MODULE=on go install -v ./...
ENV GIN_MODE release
ENV DDNS_EXPIRATION_DAYS 10

CMD /go/bin/ddns \
--domain=${DDNS_DOMAIN} \
--soa_fqdn=${DDNS_SOA_DOMAIN} \
--redis=${DDNS_REDIS_HOST} \
--expiration-days=${DDNS_EXPIRATION_DAYS}
ENTRYPOINT ["/entrypoint.sh"]
22 changes: 22 additions & 0 deletions docker/ddns/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh

if [[ $# -eq 0 ]]; then

if [[ "${DEBUG_MODE:-false}" == "true" ]]; then
/go/bin/ddns \
--domain=${DDNS_DOMAIN} \
--soa_fqdn=${DDNS_SOA_DOMAIN} \
--redis=${DDNS_REDIS_HOST} \
--expiration-days=${DDNS_EXPIRATION_DAYS} \
--verbose
else
/go/bin/ddns \
--domain=${DDNS_DOMAIN} \
--soa_fqdn=${DDNS_SOA_DOMAIN} \
--redis=${DDNS_REDIS_HOST} \
--expiration-days=${DDNS_EXPIRATION_DAYS}
fi

else
"$@"
fi
1 change: 1 addition & 0 deletions docker/docker-compose.override.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ services:
DDNS_DOMAIN: d.example.net # <<< ADJUST DOMAIN
DDNS_SOA_DOMAIN: ddns.example.net # <<< ADJUST DOMAIN
DDNS_EXPIRATION_DAYS: 10
DEBUG_MODE: "false"

powerdns:
ports:
Expand Down