This commit is contained in:
Dominik Chilla 2019-02-10 15:30:20 +01:00
parent 231edd4622
commit 084eb1c0c0
6 changed files with 109 additions and 0 deletions

1
BASEOS Normal file
View File

@ -0,0 +1 @@
debian

1
VERSION Normal file
View File

@ -0,0 +1 @@
19.02

0
app/ldap-acl-milter.py Normal file
View File

49
config/config.json Normal file
View File

@ -0,0 +1,49 @@
{
"logging": {
"__level": "default: WARNING. Possible: INFO,ERROR,CRITICAL,DEBUG",
"level": "DEBUG",
"__filename": "default: empty string (stdout).",
"filename": ""
},
"daemon":{
"listen_host": "127.0.0.1",
"listen_port": 5001
},
"trusted_proxies": {
"rprx01":[
"172.16.100.5", "fd00:100::5"
],
"rprx02":[
"172.16.100.6", "fd00:100::6"
]
},
"api_keys": {
"HIGHLY_SECURE_API_KEY": {
"user": "GULAG APP"
}
},
"uri_prefixes": {
"root": "http://127.0.0.1:9090/api/v1/",
"mailrelays": "http://127.0.0.1:9090/api/v1/mailrelays/",
"mailboxes": "http://127.0.0.1:9090/api/v1/mailboxes/",
"quarmails": "http://127.0.0.1:9090/api/v1/quarmails/",
"attachments": "http://127.0.0.1:9090/api/v1/attachments/",
"uris": "http://127.0.0.1:9090/api/v1/uris/"
},
"dos_protection": {
"max_body_bytes": 8388608
},
"db":{
"unix_socket": "/mysqld/mysqld.sock",
"user": "root",
"password": "",
"name": "Gulag"
},
"cleaner":{
"retention_period": "12 hour",
"interval": 10
},
"importer":{
"interval": 10
}
}

36
docker-build.sh Executable file
View File

@ -0,0 +1,36 @@
#!/bin/sh
BRANCH="$(/usr/bin/git branch|/bin/grep \*|/usr/bin/awk {'print $2'})"
VERSION="$(/bin/cat VERSION)"
BASEOS="$(/bin/cat BASEOS)"
#REGISTRY="some-registry.invalid"
GO=""
while getopts g opt
do
case $opt in
g) GO="go";;
esac
done
if [ -z "${GO}" ] ; then
echo "Building ldap-acl-milter@docker on '${BASEOS}' for version '${VERSION}' in branch '${BRANCH}'!"
echo "GO serious with '-g'!"
exit 1
fi
IMAGES="ldap-acl-milter"
for IMAGE in ${IMAGES}; do
/usr/bin/docker build \
--build-arg http_proxy=http://wprx-zdf.zwackl.local:3128 \
--build-arg https_proxy=http://wprx-zdf.zwackl.local:3128 \
-t "${IMAGE}/${BASEOS}:${VERSION}_${BRANCH}" \
-f "docker/${BASEOS}/Dockerfile" .
# /usr/bin/docker tag "${IMAGE}/${BASEOS}:${VERSION}_${BRANCH}" "${REGISTRY}/${IMAGE}/${BASEOS}:${VERSION}_${BRANCH}"
done
#/bin/echo "Push images to registry:"
#for IMAGE in ${IMAGES}; do
# /bin/echo "/usr/bin/docker push ${REGISTRY}/${IMAGE}/${BASEOS}:${VERSION}_${BRANCH}"
#done

22
docker/debian/Dockerfile Normal file
View File

@ -0,0 +1,22 @@
ARG http_proxy
ARG https_proxy
FROM debian
LABEL maintainer="Dominik Chilla <dominik@zwackl.de>"
ENV DEBIAN_FRONTEND=noninteractive \
TZ=Europe/Berlin
RUN env; set -ex ; \
apt-get -qq update \
&& apt-get -qq --no-install-recommends install \
python3-pip python3-setuptools python3-ldap3 \
libmilter1.0.1 libmilter-dev procps net-tools \
gcc python3-dev \
&& /usr/bin/pip3 install pymilter \
&& /bin/mkdir /config /socket /app \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY app/*.py /app/
ENTRYPOINT ["/entrypoint.sh"]