Our SSL certs are now in their own dir, ensure md5 of certs goes in /tmp/nginx
This commit is contained in:
parent
a17722df77
commit
06d26faf73
@ -23,16 +23,16 @@ RUN chmod 444 /etc/nginx/default.d/ssl/* && \
|
||||
chmod 400 /etc/nginx/default.d/ssl/default.key /etc/nginx/default.d/ssl/dhparams.pem
|
||||
|
||||
# Default SSL cert
|
||||
RUN mkdir -p /etc/nginx/conf.d/ssl && \
|
||||
ln -s ../../default.d/ssl/default.crt /etc/nginx/conf.d/ssl/mail.crt && \
|
||||
ln -s ../../default.d/ssl/default.key /etc/nginx/conf.d/ssl/mail.key
|
||||
RUN mkdir -p /etc/nginx/ssl && \
|
||||
ln -s ../default.d/ssl/default.crt /etc/nginx/ssl/mail.crt && \
|
||||
ln -s ../default.d/ssl/default.key /etc/nginx/ssl/mail.key
|
||||
COPY ssl.sh /usr/sbin/
|
||||
COPY docker/init-docker /sbin/
|
||||
|
||||
COPY var/www/maintenance /var/www/maintenance
|
||||
|
||||
# Expose our web root and log directories log.
|
||||
#VOLUME [ "/etc/nginx/conf.d", "/etc/nginx/default.d", "/etc/nginx/include.d" ]
|
||||
#VOLUME [ "/etc/nginx/http.d", "/etc/nginx/default.d", "/etc/nginx/include.d", "/etc/nginx/ssl" ]
|
||||
|
||||
# Starting
|
||||
EXPOSE 80 443 25 110 143
|
||||
|
@ -1,9 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
TMPDIR=/tmp
|
||||
LEGODIR=/etc/nginx/conf.d/ssl/lego
|
||||
TMPDIR=/tmp/nginx
|
||||
LEGODIR=/etc/nginx/ssl/lego
|
||||
|
||||
# Create our MD5 of our certifcates in /tmp
|
||||
# Create our MD5 of our certifcates in ${TMPDIR}
|
||||
for cert in $(lego --path ${LEGODIR} list |grep Certificate\ Path|awk '{print $3}'); do
|
||||
OUTPUT=$(basename ${cert})
|
||||
echo "- Creating MD5 of [${cert}] in [${TMPDIR}/${OUTPUT}]"
|
||||
|
10
ssl.sh
10
ssl.sh
@ -1,14 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
TMPDIR=/tmp
|
||||
TMPDIR=/tmp/nginx
|
||||
|
||||
if [ "$1" == "certbot" ]; then
|
||||
certbot renew -q --config-dir /etc/nginx/conf.d/ssl/letsencrypt/ --renew-hook "/usr/sbin/nginx -s reload"
|
||||
certbot renew -q --config-dir /etc/nginx/ssl/letsencrypt/ --renew-hook "/usr/sbin/nginx -s reload"
|
||||
|
||||
elif [ "$1" == "lego" ]; then
|
||||
CERTDIR=/etc/nginx/conf.d
|
||||
LEGODIR=${CERTDIR}/ssl/lego
|
||||
CERTFILE=${CERTDIR}/lego-cert.ssl
|
||||
CERTDIR=/etc/nginx/ssl
|
||||
LEGODIR=${CERTDIR}/lego
|
||||
CERTFILE=${LEGODIR}/lego-cert.ssl
|
||||
RELOAD="/tmp/nginx.reload"
|
||||
TLS_PORT=444
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user