Jelajahi Sumber

Adjust if condition to use nginx for acme validation if present.

(cherry picked from commit f5de3b29e284a1ccbae5b6bb71b7a5756fd16880)
Raphael Schneeberger 6 tahun lalu
induk
melakukan
c5b92f3ec9
2 mengubah file dengan 4 tambahan dan 10 penghapusan
  1. 1 0
      CHANGELOG.md
  2. 3 10
      bin/v-add-letsencrypt-domain

+ 1 - 0
CHANGELOG.md

@@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file.
 ### Bugfixes
 - Fix several security issues, thanks to Andrea Cardaci (https://cardaci.xyz/)
 - Rework Let's Encrypt acme staging to use hestia conform standard.
+- Fix if condition, use nginx for Let's Encrypt acme request if present.
 
 ## [1.0.4] - 2019-07-09 - Hotfix
 ### Bugfixes

+ 3 - 10
bin/v-add-letsencrypt-domain

@@ -228,15 +228,9 @@ for auth in $authz; do
         check_result $? "DNS _acme-challenge record wasn't created"
     else
         if [ -z "$mail" ]; then
-            if [ "$WEB_SYSTEM" = 'nginx' ] && [ ! -z "$PROXY_SYSTEM" ]; then
-                if [ ! -z "$mail" ]; then
-                    conf="$HOMEDIR/$user/conf/mail/$root_domain/$PROXY_SYSTEM.conf_letsencrypt"
-                    sconf="$HOMEDIR/$user/conf/mail/$root_domain/$PROXY_SYSTEM.ssl.conf_letsencrypt"
-                else
-                    conf="$HOMEDIR/$user/conf/web/$domain/$PROXY_SYSTEM.conf_letsencrypt"
-                    sconf="$HOMEDIR/$user/conf/web/$domain/$PROXY_SYSTEM.ssl.conf_letsencrypt"
-                fi
-
+            if [ "$WEB_SYSTEM" = 'nginx' ] || [ "$PROXY_SYSTEM" = 'nginx' ]; then
+                conf="$HOMEDIR/$user/conf/web/$domain/nginx.conf_letsencrypt"
+                sconf="$HOMEDIR/$user/conf/web/$domain/nginx.ssl.conf_letsencrypt"
                 if [ ! -e "$conf" ]; then
                     echo 'location ~ "^/\.well-known/acme-challenge/(.*)$" {' \
                         > $conf
@@ -249,7 +243,6 @@ for auth in $authz; do
                 fi
                 $BIN/v-restart-proxy
                 check_result $? "Proxy restart failed" > /dev/null
-
             else
                 # Get root directory from configuration
                 domain_config="$HOMEDIR/$user/conf/web/$domain"