Skip to content

Commit

Permalink
Merge pull request #15 from dprandzioch/develop
Browse files Browse the repository at this point in the history
1.2.1
  • Loading branch information
David Prandzioch authored Apr 13, 2018
2 parents e71e2c3 + b523272 commit 7688001
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[1.2.1]
* Fix permissions of /var/cache/bind on container startup
* Create zone options if not done, fixing support for persistent volumes

[1.2.0]
* Allow usage of multiple domains

Expand Down
17 changes: 17 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: '3'
services:
ddns:
image: davd/docker-ddns:latest
#image: davd/docker-ddns:develop
#build: .
restart: always
environment:
RECORD_TTL: 60
ZONE: example.org
SHARED_SECRET: changeme
ports:
- "53:53"
- "53:53/udp"
- "8080:8080"
# volumes:
# - ./bind-data:/var/cache/bind
13 changes: 11 additions & 2 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[ -z "$ZONE" ] && echo "ZONE not set" && exit 1;
[ -z "$RECORD_TTL" ] && echo "RECORD_TTL not set" && exit 1;

if [ ! -f /var/cache/bind/$ZONE.zone ]
if ! grep 'zone "'$ZONE'"' /etc/bind/named.conf > /dev/null
then
echo "creating zone...";
cat >> /etc/bind/named.conf <<EOF
Expand All @@ -16,7 +16,10 @@ zone "$ZONE" {
allow-update { localhost; };
};
EOF

fi

if [ ! -f /var/cache/bind/$ZONE.zone ]
then
echo "creating zone file..."
cat > /var/cache/bind/$ZONE.zone <<EOF
\$ORIGIN .
Expand All @@ -34,6 +37,12 @@ $ZONE IN SOA localhost. root.localhost. (
EOF
fi

# If /var/cache/bind is a volume, permissions are probably not ok
chown root:bind /var/cache/bind
chown bind:bind /var/cache/bind/*
chmod 770 /var/cache/bind
chmod 644 /var/cache/bind/*

if [ ! -f /etc/dyndns.json ]
then
echo "creating REST api config..."
Expand Down

0 comments on commit 7688001

Please # to comment.