diff --git a/.env-example b/.env-example new file mode 100644 index 0000000..dec2cc0 --- /dev/null +++ b/.env-example @@ -0,0 +1,13 @@ +DOMAIN_NAME=bla.domain.tld + +SMTP_HOST=mail.domain.tld +SMTP_PORT=587 +SMTP_FROM=gitea@domain.tld +SMTP_USER=gitea@domain.tld +SMTP_PASSWORD= +SMTP_ENCRYPTION=starttls +SECRET_KEY=averybigsecretapikey + + +RECIPIENTS_PR='mail@domain.tld','mail2@domain.tld' + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4c49bd7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.env diff --git a/Dockerfile b/Dockerfile index 513e9e4..93595ea 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,7 +25,6 @@ COPY configs/msmtprc /etc/msmtprc COPY configs/aliases /etc/aliases COPY configs/hosts /etc/hosts_append -RUN cat /etc/hosts_append >> /etc/hosts COPY start.sh /start.sh RUN chmod +x /start.sh diff --git a/docker-compose.yml b/docker-compose.yml index d8fe4d2..a453201 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,18 +5,18 @@ services: build: . restart: always environment: - - SMTP_HOST= - - SMTP_PORT= - - SMTP_FROM= - - SMTP_USER= - - SMTP_PASSWORD= - - SMTP_ENCRYPTION= - - SECRET_KEY= - - RECIPIENTS_PR= - - DOMAIN_NAME=webhooks.chaospott.de + - SMTP_HOST=${SMTP_HOST} + - SMTP_PORT=${SMTP_PORT} + - SMTP_FROM=${SMTP_FROM} + - SMTP_USER=${SMTP_USER} + - SMTP_PASSWORD=${SMTP_PASSWORD} + - SMTP_ENCRYPTION=${SMTP_ENCRYPTION} + - SECRET_KEY=${SECRET_KEY} + - RECIPIENTS_PR=${RECIPIENTS_PR} + - DOMAIN_NAME=${DOMAIN_NAME} labels: - traefik.enable=true - - traefik.frontend.rule=Host:webhooks.chaospott.de + - traefik.frontend.rule=Host:${DOMAIN_NAME} - traefik.port=80 - traefik.docker.network=web networks: diff --git a/start.sh b/start.sh index dc643c4..7112556 100644 --- a/start.sh +++ b/start.sh @@ -24,6 +24,8 @@ sed -i "s/%%SECRETKEY%%/$SECRET_KEY/g;s/%%RECIPIENTS_PR%%/$RECIPIENTS_PR/g;s/%%S sed -i "s/%%DOMAIN_NAME%%/$DOMAIN_NAME/g" /etc/nginx/nginx.conf +cat /etc/hosts_append >> /etc/hosts + chown www:www /var/log/nginx/* ln -sf /usr/bin/msmtp /usr/sbin/sendmail