Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/nextcloudpi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornachoparker <nacho@ownyourbits.com>2021-10-13 02:55:45 +0300
committernachoparker <nacho@ownyourbits.com>2021-10-14 20:08:05 +0300
commit35a3a54845fd2d80cb2b0843f711b85e0690cbe0 (patch)
tree60e4c229d1a5ef281da10fd623dadc0db0d2e42a
parent9bddfad8057c713c2698e768c855348498438dda (diff)
letsencrypt: favor most recent cert if there are manyv1.40.9
Signed-off-by: nachoparker <nacho@ownyourbits.com>
-rw-r--r--bin/ncp/NETWORKING/letsencrypt.sh3
-rw-r--r--etc/ncp-templates/nextcloud.conf.sh6
2 files changed, 5 insertions, 4 deletions
diff --git a/bin/ncp/NETWORKING/letsencrypt.sh b/bin/ncp/NETWORKING/letsencrypt.sh
index 1986a74e..6f3bf5e3 100644
--- a/bin/ncp/NETWORKING/letsencrypt.sh
+++ b/bin/ncp/NETWORKING/letsencrypt.sh
@@ -131,8 +131,7 @@ EOF
done
set-nc-domain "$DOMAIN"
- # delayed in bg so it does not kill the connection, and we get AJAX response
- bash -c "sleep 2 && service apache2 reload" &>/dev/null &
+ apachectl -k graceful
rm -rf $ncdir/.well-known
# Update configuration
diff --git a/etc/ncp-templates/nextcloud.conf.sh b/etc/ncp-templates/nextcloud.conf.sh
index ea49032c..ec0b3174 100644
--- a/etc/ncp-templates/nextcloud.conf.sh
+++ b/etc/ncp-templates/nextcloud.conf.sh
@@ -42,8 +42,10 @@ EOF
if [[ "$1" != "--defaults" ]] && [[ -n "$LETSENCRYPT_DOMAIN" ]]; then
echo " ServerName ${LETSENCRYPT_DOMAIN}"
LETSENCRYPT_CERT_BASE_PATH="/etc/letsencrypt/live/${LETSENCRYPT_DOMAIN,,}"
- [[ -d "${LETSENCRYPT_CERT_BASE_PATH}" ]] || \
- LETSENCRYPT_CERT_BASE_PATH="$(find /etc/letsencrypt/live -name "${LETSENCRYPT_DOMAIN,,}*" | head -1)"
+ [[ -d "${LETSENCRYPT_CERT_BASE_PATH}" ]] || {
+ #find the most recent cert
+ LETSENCRYPT_CERT_BASE_PATH="$(find /etc/letsencrypt/live -type d -name "${LETSENCRYPT_DOMAIN,,}*" -printf "%T@ %p\n" | sort -n | cut -f2 -d' ' | tail -1)"
+ }
LETSENCRYPT_CERT_PATH="${LETSENCRYPT_CERT_BASE_PATH}/fullchain.pem"
LETSENCRYPT_KEY_PATH="${LETSENCRYPT_CERT_BASE_PATH}/privkey.pem"