~hacktivista/setup-decidim

6551d5f06960412df8ed4275408cdcf4d6408eff — Felix Freeman 3 years ago 5d4ec9d
Fix: Don't break certbot-nginx by leaving a temporarily broken nginx config
1 files changed, 8 insertions(+), 5 deletions(-)

M nginx.sh
M nginx.sh => nginx.sh +8 -5
@@ 14,6 14,14 @@ apk add nginx
rc-update add nginx
rc-service nginx start

if [ "$ENVIRONMENT" = 'production' ]; then
    # Certbot
    echo "Installing Let's Encrypt certificate"
    apk add certbot-nginx
    certbot certonly --nginx --agree-tos -m "$ADMIN_EMAIL" --no-eff-email \
        -d "$DECIDIM_DOMAIN"
fi

echo "Setting up $DECIDIM_DOMAIN on Nginx"
cat << EOF > "/etc/nginx/http.d/$DECIDIM_DOMAIN.conf"
server {


@@ 38,11 46,6 @@ EOF

if [ "$ENVIRONMENT" = 'production' ]; then
    # Certbot
    echo "Installing Let's Encrypt certificate"
    apk add certbot-nginx
    certbot certonly --nginx --agree-tos -m "$ADMIN_EMAIL" --no-eff-email \
        -d "$DECIDIM_DOMAIN"

    cat << EOF >> "/etc/nginx/http.d/$DECIDIM_DOMAIN.conf"
    ssl_certificate      /etc/letsencrypt/live/$DECIDIM_DOMAIN/fullchain.pem;
    ssl_certificate_key  /etc/letsencrypt/live/$DECIDIM_DOMAIN/privkey.pem;