mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-08-04 10:05:00 +02:00
Add changedetector functionality for ${SSL_TYPE} == manual
(#2404)
Now, setups that use `SSL_TYPE=manual` will profit from the changedetector as well. Certificate changes are picked up and properly propagated.
This commit is contained in:
parent
54f2181379
commit
ec8b99335e
9 changed files with 545 additions and 494 deletions
|
@ -22,20 +22,21 @@ function setup_file() {
|
|||
export SSL_ALT_KEY_PATH='/config/ssl/key.rsa.pem'
|
||||
export SSL_ALT_CERT_PATH='/config/ssl/cert.rsa.pem'
|
||||
|
||||
local DOMAIN='example.test'
|
||||
local PRIVATE_CONFIG
|
||||
export DOMAIN_SSL_MANUAL='example.test'
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container .)"
|
||||
|
||||
docker run -d --name mail_manual_ssl \
|
||||
--volume "${PRIVATE_CONFIG}/:/tmp/docker-mailserver/" \
|
||||
--volume "$(pwd)/test/test-files/ssl/${DOMAIN}/with_ca/ecdsa/:/config/ssl/:ro" \
|
||||
--env DMS_DEBUG=0 \
|
||||
--volume "$(pwd)/test/test-files/ssl/${DOMAIN_SSL_MANUAL}/with_ca/ecdsa/:/config/ssl/:ro" \
|
||||
--env DMS_DEBUG=1 \
|
||||
--env SSL_TYPE='manual' \
|
||||
--env TLS_LEVEL='modern' \
|
||||
--env SSL_KEY_PATH="${SSL_KEY_PATH}" \
|
||||
--env SSL_CERT_PATH="${SSL_CERT_PATH}" \
|
||||
--env SSL_ALT_KEY_PATH="${SSL_ALT_KEY_PATH}" \
|
||||
--env SSL_ALT_CERT_PATH="${SSL_ALT_CERT_PATH}" \
|
||||
--hostname "mail.${DOMAIN}" \
|
||||
--hostname "mail.${DOMAIN_SSL_MANUAL}" \
|
||||
--tty \
|
||||
"${NAME}" # Image name
|
||||
wait_for_finished_setup_in_container mail_manual_ssl
|
||||
|
@ -109,6 +110,18 @@ function teardown_file() {
|
|||
assert_equal "${RESULT}" 'Verification: OK'
|
||||
}
|
||||
|
||||
@test "checking ssl: manual cert changes are picked up by check-for-changes" {
|
||||
printf 'someThingsChangedHere' \
|
||||
>>"$(pwd)/test/test-files/ssl/${DOMAIN_SSL_MANUAL}/with_ca/ecdsa/key.ecdsa.pem"
|
||||
sleep 10
|
||||
|
||||
run docker exec mail_manual_ssl /bin/bash -c "supervisorctl tail -3000 changedetector"
|
||||
assert_output --partial 'Change detected'
|
||||
assert_output --partial 'Manual certificates have changed'
|
||||
|
||||
sed -i '/someThingsChangedHere/d' "$(pwd)/test/test-files/ssl/${DOMAIN_SSL_MANUAL}/with_ca/ecdsa/key.ecdsa.pem"
|
||||
}
|
||||
|
||||
@test "last" {
|
||||
skip 'this test is only there to reliably mark the end for the teardown_file'
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue