Skip to content

Commit 38799fd

Browse files
committed
letsencrypt: rework notification
1 parent 2460264 commit 38799fd

File tree

3 files changed

+24
-7
lines changed

3 files changed

+24
-7
lines changed

bin/ncp/NETWORKING/letsencrypt.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,7 @@ configure()
6666
#!/bin/bash
6767
6868
# renew and notify
69-
$letsencrypt renew --quiet --deploy-hook '
70-
ncc notification:generate \
71-
$NOTIFYUSER "SSL renewal" \
72-
-l "Your SSL certificate(s) \$RENEWED_DOMAINS has been renewed for another 90 days"
73-
'
69+
$letsencrypt renew --quiet
7470
7571
# notify if fails
7672
[[ \$? -ne 0 ]] && ncc notification:generate \
@@ -82,6 +78,14 @@ rm -rf $ncdir/.well-known
8278
EOF
8379
chmod 755 /etc/cron.weekly/letsencrypt-ncp
8480

81+
cat > /etc/letsencrypt/renewal-hooks/deploy/ncp <<EOF
82+
#!/bin/bash
83+
/usr/local/bin/ncc notification:generate \
84+
$NOTIFYUSER "SSL renewal" \
85+
-l "Your SSL certificate(s) \$RENEWED_DOMAINS has been renewed for another 90 days"
86+
EOF
87+
chmod +x /etc/letsencrypt/renewal-hooks/deploy/ncp
88+
8589
# Configure Apache
8690
sed -i "s|SSLCertificateFile.*|SSLCertificateFile /etc/letsencrypt/live/$DOMAIN_LOWERCASE/fullchain.pem|" $vhostcfg
8791
sed -i "s|SSLCertificateKeyFile.*|SSLCertificateKeyFile /etc/letsencrypt/live/$DOMAIN_LOWERCASE/privkey.pem|" $vhostcfg

changelog.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11

2-
[v1.10.4](https://github.com/nextcloud/nextcloudpi/commit/5675383) (2019-03-18) nc-update-nc-apps-auto: only notify if there was update
2+
[v1.10.6](https://github.com/nextcloud/nextcloudpi/commit/076aeb2) (2019-03-23) letsencrypt: rework notification
33

4-
[v1.10.3](https://github.com/nextcloud/nextcloudpi/commit/4b6572a) (2019-03-18) nc-update-nc: fix case where imported cfg from non docker to docker
4+
[v1.10.5, master](https://github.com/nextcloud/nextcloudpi/commit/2460264) (2019-03-23) fix cron path
5+
6+
[v1.10.4](https://github.com/nextcloud/nextcloudpi/commit/f0b467b) (2019-03-18) nc-update-nc-apps-auto: only notify if there was update
7+
8+
[v1.10.3 ](https://github.com/nextcloud/nextcloudpi/commit/4b6572a) (2019-03-18) nc-update-nc: fix case where imported cfg from non docker to docker
59

610
[v1.10.2 ](https://github.com/nextcloud/nextcloudpi/commit/ec66e40) (2019-03-16) freeDNS: fix hash
711

update.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,15 @@ EOF
218218
is_active_app nc-previews-auto && run_app nc-previews-auto
219219
is_active_app nc-update-nc-apps-auto && run_app nc-update-nc-apps-auto
220220

221+
# rework letsencrypt notification
222+
USER="$(jq -r '.params[2].value' "$CONFDIR"/letsencrypt.cfg)"
223+
cat > /etc/letsencrypt/renewal-hooks/deploy/ncp <<EOF
224+
#!/bin/bash
225+
/usr/local/bin/ncc notification:generate $USER "SSL renewal" -l "Your SSL certificate(s) \$RENEWED_DOMAINS has been renewed for another 90 days"
226+
EOF
227+
chmod +x /etc/letsencrypt/renewal-hooks/deploy/ncp
228+
229+
221230
# remove redundant opcache configuration. Leave until update bug is fixed -> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=815968
222231
# Bug #416 reappeared after we moved to php7.2 and debian buster packages. (keep last)
223232
[[ "$( ls -l /etc/php/7.2/fpm/conf.d/*-opcache.ini | wc -l )" -gt 1 ]] && rm "$( ls /etc/php/7.2/fpm/conf.d/*-opcache.ini | tail -1 )"

0 commit comments

Comments
 (0)