ci script
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Wolfgang Hottgenroth 2024-12-10 13:27:12 +01:00
parent 29f55598d9
commit a666ec8452
6 changed files with 86 additions and 4 deletions

16
.woodpecker.yml Normal file
View File

@ -0,0 +1,16 @@
steps:
build:
image: plugins/kaniko
settings:
repo: ${FORGE_NAME}/${CI_REPO}
registry:
from_secret: container_registry
tags: latest,${CI_COMMIT_SHA},${CI_COMMIT_TAG}
username:
from_secret: container_registry_username
password:
from_secret: container_registry_password
dockerfile: Dockerfile
when:
- event: [push, tag]

View File

@ -1,15 +1,33 @@
FROM debian:latest
FROM debian:bookworm
LABEL Maintainer="Wolfgang Hottgenroth <woho@hottis.de>"
LABEL ImageName="registry.gitlab.com/wolutator/exim-docker"
LABEL ImageName=""
# domain to be used in sender address of sent mails
ENV LOCALMAILNAME=""
# smarthost to send mail to
ENV SMARTHOST=""
# recipient addresses for root aliases, separate multiple addresses by space
ENV ROOT=""
# ip addresses or networks to allow for relaying, separate multiple ones by semicolon
ENV RELAYNETS=""
RUN \
apt update && \
apt install -y exim4 && \
apt upgrade -y --autoremove && \
apt install -y exim4-daemon-light ca-certificates curl && \
rm -rf /var/lib/apt/lists/*
VOLUME /etc/exim4
COPY update-exim4.conf.tmpl /etc/exim4/
COPY aliases.tmpl /etc/exim4/
COPY adjust-config.sh /etc/exim4/
COPY start.sh /etc/exim4/
WORKDIR /etc/exim4
EXPOSE 25
CMD [ "./start.sh" ]

15
adjust-config.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash
cat update-exim4.conf.tmpl \
| sed -e 's/%HOSTNAME%/'$HOSTNAME'/' \
-e 's#%RELAYNETS%#'$RELAYNETS'#' \
-e 's/%LOCALMAILNAME%/'$LOCALMAILNAME'/' \
-e 's/%SMARTHOST%/'$SMARTHOST'/' \
> update-exim4.conf.conf
cat aliases.tmpl \
| sed -e 's/%ROOT%/'"$ROOT"'/' \
> ../aliases && \
newaliases
/usr/sbin/update-exim4.conf -v

14
aliases.tmpl Normal file
View File

@ -0,0 +1,14 @@
mailer-daemon: postmaster
postmaster: root
nobody: root
hostmaster: root
usenet: root
news: root
webmaster: root
www: root
ftp: root
abuse: root
noc: root
security: root
root: %ROOT%

5
start.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
./adjust-config.sh
exim -bd -q15m -v

14
update-exim4.conf.tmpl Normal file
View File

@ -0,0 +1,14 @@
dc_eximconfig_configtype='satellite'
dc_other_hostnames='%HOSTNAME%'
dc_local_interfaces='0.0.0.0'
dc_readhost='%LOCALMAILNAME%'
dc_relay_domains=''
dc_minimaldns='false'
dc_relay_nets='%RELAYNETS%'
dc_smarthost='%SMARTHOST%'
CFILEMODE='644'
dc_use_split_config='false'
dc_hide_mailname='true'
dc_mailname_in_oh='true'
dc_localdelivery='mail_spool'