Skip to content

Commit

Permalink
letsencrypt: rework notification
Browse files Browse the repository at this point in the history
  • Loading branch information
nachoparker committed Mar 23, 2019
1 parent 2460264 commit 38799fd
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
14 changes: 9 additions & 5 deletions bin/ncp/NETWORKING/letsencrypt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,7 @@ configure()
#!/bin/bash
# renew and notify
$letsencrypt renew --quiet --deploy-hook '
ncc notification:generate \
$NOTIFYUSER "SSL renewal" \
-l "Your SSL certificate(s) \$RENEWED_DOMAINS has been renewed for another 90 days"
'
$letsencrypt renew --quiet
# notify if fails
[[ \$? -ne 0 ]] && ncc notification:generate \
Expand All @@ -82,6 +78,14 @@ rm -rf $ncdir/.well-known
EOF
chmod 755 /etc/cron.weekly/letsencrypt-ncp

cat > /etc/letsencrypt/renewal-hooks/deploy/ncp <<EOF
#!/bin/bash
/usr/local/bin/ncc notification:generate \
$NOTIFYUSER "SSL renewal" \
-l "Your SSL certificate(s) \$RENEWED_DOMAINS has been renewed for another 90 days"
EOF
chmod +x /etc/letsencrypt/renewal-hooks/deploy/ncp

# Configure Apache
sed -i "s|SSLCertificateFile.*|SSLCertificateFile /etc/letsencrypt/live/$DOMAIN_LOWERCASE/fullchain.pem|" $vhostcfg
sed -i "s|SSLCertificateKeyFile.*|SSLCertificateKeyFile /etc/letsencrypt/live/$DOMAIN_LOWERCASE/privkey.pem|" $vhostcfg
Expand Down
8 changes: 6 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@

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

[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
[v1.10.5, master](https://github.com/nextcloud/nextcloudpi/commit/2460264) (2019-03-23) fix cron path

[v1.10.4](https://github.com/nextcloud/nextcloudpi/commit/f0b467b) (2019-03-18) nc-update-nc-apps-auto: only notify if there was update

[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

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

Expand Down
9 changes: 9 additions & 0 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,15 @@ EOF
is_active_app nc-previews-auto && run_app nc-previews-auto
is_active_app nc-update-nc-apps-auto && run_app nc-update-nc-apps-auto

# rework letsencrypt notification
USER="$(jq -r '.params[2].value' "$CONFDIR"/letsencrypt.cfg)"
cat > /etc/letsencrypt/renewal-hooks/deploy/ncp <<EOF
#!/bin/bash
/usr/local/bin/ncc notification:generate $USER "SSL renewal" -l "Your SSL certificate(s) \$RENEWED_DOMAINS has been renewed for another 90 days"
EOF
chmod +x /etc/letsencrypt/renewal-hooks/deploy/ncp


# remove redundant opcache configuration. Leave until update bug is fixed -> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=815968
# Bug #416 reappeared after we moved to php7.2 and debian buster packages. (keep last)
[[ "$( 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 )"
Expand Down

0 comments on commit 38799fd

Please sign in to comment.