Added tests on letsencrypt - #109

This commit is contained in:
Thomas VIAL 2016-04-26 19:39:08 +02:00
parent 3328e4c79d
commit 9fbe20f3d0
No known key found for this signature in database
GPG key ID: 0394CEE552FAFEFC
8 changed files with 177 additions and 16 deletions

View file

@ -118,6 +118,7 @@ case $SSL_TYPE in
# letsencrypt folders and files mounted in /etc/letsencrypt
if [ -e "/etc/letsencrypt/live/$(hostname)/cert.pem" ] \
&& [ -e "/etc/letsencrypt/live/$(hostname)/chain.pem" ] \
&& [ -e "/etc/letsencrypt/live/$(hostname)/fullchain.pem" ] \
&& [ -e "/etc/letsencrypt/live/$(hostname)/privkey.pem" ]; then
echo "Adding $(hostname) SSL certificate"
# create combined.pem from (cert|chain|privkey).pem with eol after each .pem
@ -131,7 +132,7 @@ case $SSL_TYPE in
sed -i -e 's/ssl_cert = <\/etc\/dovecot\/dovecot\.pem/ssl_cert = <\/etc\/letsencrypt\/live\/'$(hostname)'\/fullchain\.pem/g' /etc/dovecot/conf.d/10-ssl.conf
sed -i -e 's/ssl_key = <\/etc\/dovecot\/private\/dovecot\.pem/ssl_key = <\/etc\/letsencrypt\/live\/'$(hostname)'\/privkey\.pem/g' /etc/dovecot/conf.d/10-ssl.conf
echo "SSL configured with letsencrypt certificates"
echo "SSL configured with 'letsencrypt' certificates"
fi
;;
@ -151,7 +152,7 @@ case $SSL_TYPE in
sed -i -e 's/ssl_cert = <\/etc\/dovecot\/dovecot\.pem/ssl_cert = <\/etc\/postfix\/ssl\/'$(hostname)'-full\.pem/g' /etc/dovecot/conf.d/10-ssl.conf
sed -i -e 's/ssl_key = <\/etc\/dovecot\/private\/dovecot\.pem/ssl_key = <\/etc\/postfix\/ssl\/'$(hostname)'-full\.pem/g' /etc/dovecot/conf.d/10-ssl.conf
echo "SSL configured with CA signed/custom certificates"
echo "SSL configured with 'CA signed/custom' certificates"
fi
;;
@ -182,7 +183,7 @@ case $SSL_TYPE in
sed -i -e 's/ssl_cert = <\/etc\/dovecot\/dovecot\.pem/ssl_cert = <\/etc\/postfix\/ssl\/'$(hostname)'-combined\.pem/g' /etc/dovecot/conf.d/10-ssl.conf
sed -i -e 's/ssl_key = <\/etc\/dovecot\/private\/dovecot\.pem/ssl_key = <\/etc\/postfix\/ssl\/'$(hostname)'-key\.pem/g' /etc/dovecot/conf.d/10-ssl.conf
echo "SSL configured with self-signed/custom certificates"
echo "SSL configured with 'self-signed' certificates"
fi
;;