@@ -46,12 +46,12 @@ if [[ "$1" != "--defaults" ]] && [[ -n "$LETSENCRYPT_DOMAIN" ]]; then
4646 LETSENCRYPT_CERT_BASE_PATH=" /etc/letsencrypt/live/${LETSENCRYPT_DOMAIN,,} "
4747
4848 # find the most recent cert otherwise
49- [[ -d " ${LETSENCRYPT_CERT_BASE_PATH} " ]] || {
49+ [[ -f " ${LETSENCRYPT_CERT_BASE_PATH} /fullchain.pem " ]] || {
5050 LETSENCRYPT_CERT_BASE_PATH=" $( find /etc/letsencrypt/live -type d -name " ${LETSENCRYPT_DOMAIN,,} *" -printf " %T@ %p\n" | sort -n | cut -f2 -d' ' | tail -1) "
5151 }
5252
53- # otherwise, in some installs this is the path we use (for legacy reasons)
54- [[ -d " ${LETSENCRYPT_CERT_BASE_PATH} " ]] || {
53+ # otherwise, in some installs this is the path we use
54+ [[ -f " ${LETSENCRYPT_CERT_BASE_PATH} /fullchain.pem " ]] || {
5555 if [[ -d " /etc/letsencrypt/live/ncp-nextcloud" ]]; then
5656 LETSENCRYPT_CERT_BASE_PATH=" /etc/letsencrypt/live/ncp-nextcloud"
5757 fi
6363fi
6464
6565# NOTE: we fall back to self-signed snakeoil certs if we couldn't get a LE one
66- [[ -d " ${LETSENCRYPT_CERT_BASE_PATH} " ]] && {
66+ [[ -f " ${LETSENCRYPT_CERT_BASE_PATH} /fullchain.pem " ]] && [[ -f " ${LETSENCRYPT_CERT_BASE_PATH} /privkey.pem " ]] && {
6767 LETSENCRYPT_CERT_PATH=" ${LETSENCRYPT_CERT_BASE_PATH} /fullchain.pem"
6868 LETSENCRYPT_KEY_PATH=" ${LETSENCRYPT_CERT_BASE_PATH} /privkey.pem"
6969}
@@ -72,7 +72,7 @@ cat <<EOF
7272 ErrorLog /var/log/apache2/nc-error.log
7373 SSLEngine on
7474 SSLProxyEngine on
75- SSLCertificateFile ${LETSENCRYPT_CERT_PATH:-/ etc/ ssl/ certs/ ssl-cert-snakeoil.pem}
75+ SSLCertificateFile ${LETSENCRYPT_CERT_PATH:-/ etc/ ssl/ certs/ ssl-cert-snakeoil.pem}
7676 SSLCertificateKeyFile ${LETSENCRYPT_KEY_PATH:-/ etc/ ssl/ private/ ssl-cert-snakeoil.key}
7777
7878 # For notify_push app in NC21
0 commit comments