more stuff
This commit is contained in:
parent
3ea9819228
commit
6e09734800
20
.gitlab-ci.yml
Normal file
20
.gitlab-ci.yml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
image: docker:stable
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- build
|
||||||
|
|
||||||
|
variables:
|
||||||
|
IMAGE_NAME: registry.gitlab.com/wolutator/yadyn
|
||||||
|
|
||||||
|
build:
|
||||||
|
stage: build
|
||||||
|
tags:
|
||||||
|
- hottis
|
||||||
|
- linux
|
||||||
|
- docker
|
||||||
|
script:
|
||||||
|
- VERSION=`cat VERSION`
|
||||||
|
- docker build --tag $IMAGE_NAME:$VERSION .
|
||||||
|
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
||||||
|
- docker push $IMAGE_NAME:$VERSION
|
||||||
|
|
32
Dockerfile
32
Dockerfile
@ -1,27 +1,51 @@
|
|||||||
FROM debian:latest
|
FROM debian:latest
|
||||||
|
|
||||||
LABEL Maintainer="Wolfgang Hottgenroth <woho@hottis.de>"
|
LABEL Maintainer="Wolfgang Hottgenroth <woho@hottis.de>"
|
||||||
|
LABEL ImageName="registry.gitlab.com/wolutator/yadyn"
|
||||||
|
|
||||||
ARG APP_DIR=/opt/app
|
ARG APP_DIR=/opt/app
|
||||||
ARG VAR_DIR=$APP_DIR/var
|
ARG VAR_DIR=$APP_DIR/var
|
||||||
ARG DATA_DIR=$VAR_DIR/data
|
ARG DATA_DIR=$VAR_DIR/data
|
||||||
ARG LOG_DIR=$VAR_DIR/log
|
ARG LOG_DIR=$VAR_DIR/log
|
||||||
|
ARG BIND_DIR=/etc/bind
|
||||||
|
ARG DYN_ZONES_DIR=$BIND_DIR/dynamic
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
mkdir -p $APP_DIR && \
|
mkdir -p $APP_DIR && \
|
||||||
mkdir -p $VAR_DIR && \
|
mkdir -p $VAR_DIR && \
|
||||||
mkdir -p $DATA_DIR && \
|
mkdir -p $DATA_DIR && \
|
||||||
mkdir -p $LOG_DIR && \
|
mkdir -p $LOG_DIR && \
|
||||||
|
mkdir -p $DYN_ZONES_DIR && \
|
||||||
apt update && \
|
apt update && \
|
||||||
apt install -y bind9 && \
|
apt install -y bind9 && \
|
||||||
apt install -y python3 && \
|
apt install -y python && \
|
||||||
apt install -y python3-pip && \
|
apt install -y python-pip && \
|
||||||
apt install -y python3-dnspython
|
apt install -y python-dnspython && \
|
||||||
|
apt install -y dnsutils && \
|
||||||
|
apt install -y vim.tiny && \
|
||||||
|
apt install -y procps && \
|
||||||
|
/usr/sbin/tsig-keygen local. > /etc/bind/local.key && \
|
||||||
|
echo "include \"/etc/bind/local.key\";" >> /etc/bind/named.conf && \
|
||||||
|
echo "include \"/etc/bind/dynamic/dynamic-zones.conf\";" >> /etc/bind/named.conf && \
|
||||||
|
echo "include \"/etc/bind/named.conf.logging\";" >> /etc/bind/named.conf
|
||||||
|
|
||||||
COPY ./server/ $APP_DIR
|
COPY ./server/ $APP_DIR
|
||||||
|
COPY ./bind/named.conf.logging $BIND_DIR
|
||||||
|
COPY ./bind/dynamic-zones.conf $DYN_ZONES_DIR
|
||||||
|
COPY ./bind/dynamic.hottis.de $DYN_ZONES_DIR
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
cat /etc/bind/local.key && \
|
||||||
|
KEY=`cat /etc/bind/local.key | awk -F\" '/secret/ {print $2}'` && \
|
||||||
|
echo $KEY && \
|
||||||
|
sed -i "s,KEYVALUE,$KEY," $APP_DIR/yadyn
|
||||||
|
|
||||||
EXPOSE 8023/tcp
|
EXPOSE 8023/tcp
|
||||||
EXPOSE 8053/udp
|
EXPOSE 8053/udp
|
||||||
EXPOSE 8053/tcp
|
EXPOSE 53/udp
|
||||||
|
EXPOSE 53/tcp
|
||||||
|
|
||||||
VOLUME $VAR_DIR
|
VOLUME $VAR_DIR
|
||||||
|
VOLUME $DYN_ZONES_DIR
|
||||||
|
|
||||||
|
|
||||||
|
9
bind/dynamic-zones.conf
Normal file
9
bind/dynamic-zones.conf
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
zone "dynamic.hottis.de" {
|
||||||
|
type master;
|
||||||
|
file "/etc/bind/dynamic/dynamic.hottis.de";
|
||||||
|
allow-update {
|
||||||
|
{ localhost; };
|
||||||
|
key local.;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
11
bind/dynamic.hottis.de
Normal file
11
bind/dynamic.hottis.de
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
@ 1800 IN SOA yadynns.hottis.de. woho@hottis.de. (
|
||||||
|
2019112701
|
||||||
|
300
|
||||||
|
100
|
||||||
|
120
|
||||||
|
120
|
||||||
|
)
|
||||||
|
|
||||||
|
@ IN NS yadynns.hottis.de.
|
||||||
|
test IN A 127.0.0.2
|
||||||
|
|
9
bind/named.conf.logging
Normal file
9
bind/named.conf.logging
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
logging {
|
||||||
|
category default { default_logfile; };
|
||||||
|
channel default_logfile {
|
||||||
|
file "/opt/app/var/log/named.log";
|
||||||
|
print-time yes;
|
||||||
|
print-category yes;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
@ -43,7 +43,7 @@ TTL = 120
|
|||||||
EXPIRY_PERIOD = 300
|
EXPIRY_PERIOD = 300
|
||||||
NAMESERVER = '127.0.0.1'
|
NAMESERVER = '127.0.0.1'
|
||||||
NAMESERVER_PORT = 53
|
NAMESERVER_PORT = 53
|
||||||
TSIGKEY = { "dynamic.hottis.de" : "IDlS8yvRJLbfCLOYJMTOu9g9/d8yvftVitgNDIce2s0kG/KS1XGwM7Sg1rgWtzMjQZ6QlcVo6NeLUrjXREzZ+w==" }
|
TSIGKEY = { "local." : "KEYVALUE" }
|
||||||
PID_FILE = "/var/run/yadyn.pid"
|
PID_FILE = "/var/run/yadyn.pid"
|
||||||
ENTRIES_FILE = "/opt/app/var/data/entries"
|
ENTRIES_FILE = "/opt/app/var/data/entries"
|
||||||
CUSTOMERS_FILE = "/opt/app/var/data/customers"
|
CUSTOMERS_FILE = "/opt/app/var/data/customers"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user