Commit a8a830c5 authored by rg's avatar rg

Correction letsencrypt

parent dce1dd2c
......@@ -48,6 +48,7 @@ RUN echo 'DOMAIN=$1; shift; SSL=$1; shift; SSL_LETSENCRYPTMAIL=$1; shift; MAPS_T
echo ' PRIVKEY="/etc/nginx/ssl/privkey.pem"' >>$INIT; \
echo ' if [ "$SSL" = "letsencrypt" ]; then' >>$INIT; \
echo ' [ ! -d /etc/letsencrypt/live/$DOMAIN ] && mkdir -p /etc/letsencrypt/live/$DOMAIN && FIRST_INIT="true"' >>$INIT; \
echo ' [ ! -f /etc/letsencrypt/renewal/$DOMAIN.conf ] && FIRST_INIT="true"' >>$INIT; \
echo ' FULLCHAIN="/etc/letsencrypt/live/$DOMAIN/fullchain.pem"' >>$INIT; \
echo ' PRIVKEY="/etc/letsencrypt/live/$DOMAIN/privkey.pem"' >>$INIT; \
echo ' fi' >>$INIT; \
......@@ -66,7 +67,7 @@ RUN echo 'DOMAIN=$1; shift; SSL=$1; shift; SSL_LETSENCRYPTMAIL=$1; shift; MAPS_T
echo 'CONF=${CONF//\\{MAPS_TOKEN\\}/$MAPS_TOKEN}' >>$INIT; \
echo 'echo "${CONF}" > /etc/nginx/sites-enabled/loadbalancer.conf' >>$INIT; \
echo 'service nginx start' >>$INIT; \
echo '[ "FIRST_INIT" = "true" ] || [ ! -f /etc/letsencrypt/renewal/$DOMAIN.conf ] && certbot certonly --webroot -w /home/www/letsencrypt --agree-tos -d "$DOMAIN" -m $SSL_LETSENCRYPTMAIL && service nginx reload' >>$INIT;
echo '[ "FIRST_INIT" = "true" ] && certbot certonly --webroot -w /home/www/letsencrypt --agree-tos -d "$DOMAIN" -m $SSL_LETSENCRYPTMAIL && service nginx reload' >>$INIT;
# openssl req -x509 -nodes -newkey rsa:1024 -days 1 -keyout privkey.pem -out fullchain.pem -subj '/CN=localhost'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment