Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ RUN \
dovecot-managesieved dovecot-pop3d dovecot-sieve dovecot-solr \
dumb-init \
# E - O
ed fail2ban fetchmail file gamin gnupg gzip iproute2 iptables \
locales logwatch lhasa libdate-manip-perl liblz4-tool \
ed fail2ban fetchmail file gamin gnupg gzip inotify-tools iproute2 \
iptables locales logwatch lhasa libdate-manip-perl liblz4-tool \
libmail-spf-perl libnet-dns-perl libsasl2-modules lrzip lzop \
netcat-openbsd nomarch opendkim opendkim-tools opendmarc \
# P - Z
Expand Down
5 changes: 5 additions & 0 deletions target/scripts/check-for-changes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ sleep 10

while true
do
inotifywait -qq -r \
-e modify -e create -e delete -e move \
/tmp/docker-mailserver/ \
/etc/letsencrypt/

LOG_DATE=$(date +"%Y-%m-%d %H:%M:%S ")

# get chksum and check it, no need to lock config yet
Expand Down
23 changes: 11 additions & 12 deletions target/scripts/helper-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -178,17 +178,16 @@ CHKSUM_FILE=/tmp/docker-mailserver-config-chksum
# Compute checksums of monitored files.
function _monitored_files_checksums
{
(
cd /tmp/docker-mailserver || exit 1
exec sha512sum 2>/dev/null -- \
postfix-accounts.cf \
postfix-virtual.cf \
postfix-aliases.cf \
dovecot-quotas.cf \
/etc/letsencrypt/acme.json \
"/etc/letsencrypt/live/${HOSTNAME}/key.pem" \
"/etc/letsencrypt/live/${HOSTNAME}/privkey.pem" \
"/etc/letsencrypt/live/${HOSTNAME}/fullchain.pem"
)
cd /tmp/docker-mailserver || { echo '-1' ; return 1 ; }

sha512sum 2>/dev/null -- \
postfix-accounts.cf \
postfix-virtual.cf \
postfix-aliases.cf \
dovecot-quotas.cf \
/etc/letsencrypt/acme.json \
"/etc/letsencrypt/live/${HOSTNAME}/key.pem" \
"/etc/letsencrypt/live/${HOSTNAME}/privkey.pem" \
"/etc/letsencrypt/live/${HOSTNAME}/fullchain.pem"
}
export -f _monitored_files_checksums
2 changes: 1 addition & 1 deletion test/mail_ssl_letsencrypt.bats
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function teardown_file() {

@test "can detect changes" {
cp "$(private_config_path mail_lets_acme_json)/letsencrypt/acme-changed.json" "$(private_config_path mail_lets_acme_json)/acme.json"
sleep 11
sleep 15
run docker exec mail_lets_acme_json /bin/bash -c "supervisorctl tail changedetector"
assert_output --partial "postfix: stopped"
assert_output --partial "postfix: started"
Expand Down