diff options
-rw-r--r-- | bin/ncp/CONFIG/nc-limits.sh | 2 | ||||
-rw-r--r-- | bin/ncp/NETWORKING/letsencrypt.sh | 18 | ||||
-rw-r--r-- | changelog.md | 4 | ||||
-rw-r--r-- | etc/ncp-config.d/letsencrypt.cfg | 6 |
4 files changed, 26 insertions, 4 deletions
diff --git a/bin/ncp/CONFIG/nc-limits.sh b/bin/ncp/CONFIG/nc-limits.sh index cb6722c7..e3f7cf97 100644 --- a/bin/ncp/CONFIG/nc-limits.sh +++ b/bin/ncp/CONFIG/nc-limits.sh @@ -59,7 +59,7 @@ configure() local CURRENT_REDIS_MEM=$( grep "^maxmemory" "$CONF" | awk '{ print $2 }' ) [[ "$REDISMEM" != "$CURRENT_REDIS_MEM" ]] && { sed -i "s|^maxmemory .*|maxmemory $REDISMEM|" "$CONF" - chown redis:redis $CONF + chown redis:redis "$CONF" service redis-server restart } } diff --git a/bin/ncp/NETWORKING/letsencrypt.sh b/bin/ncp/NETWORKING/letsencrypt.sh index ae1cf7aa..86241e6f 100644 --- a/bin/ncp/NETWORKING/letsencrypt.sh +++ b/bin/ncp/NETWORKING/letsencrypt.sh @@ -54,7 +54,15 @@ configure() sed -i "/DocumentRoot/aServerName $DOMAIN" $vhostcfg # Do it - $letsencrypt certonly -n --force-renew --no-self-upgrade --webroot -w $ncdir --hsts --agree-tos -m $EMAIL -d $DOMAIN && { + local domain_string="" + for domain in $DOMAIN $OTHER_DOMAIN; do + [[ "$domain" != "" ]] && { + [[ $domain_string == "" ]] && \ + domain_string+="${domain}" || \ + domain_string+=",${domain}" + } + done + $letsencrypt certonly -n --force-renew --no-self-upgrade --webroot -w $ncdir --hsts --agree-tos -m $EMAIL -d $domain_string && { # Set up auto-renewal cat > /etc/cron.weekly/letsencrypt-ncp <<EOF @@ -91,7 +99,13 @@ EOF sed -i "s|SSLCertificateKeyFile.*|SSLCertificateKeyFile /etc/letsencrypt/live/$DOMAIN_LOWERCASE/privkey.pem|" $vhostcfg2 # Configure Nextcloud - ncc config:system:set trusted_domains 4 --value=$DOMAIN + local domain_index=12 + for dom in $DOMAIN $OTHER_DOMAIN; do + [[ "$dom" != "" ]] && { + ncc config:system:set trusted_domains $domain_index --value=$dom + ((domain_index++)) + } + done ncc config:system:set overwrite.cli.url --value=https://"$DOMAIN"/ # delayed in bg so it does not kill the connection, and we get AJAX response diff --git a/changelog.md b/changelog.md index 278cb21c..bc4c2a61 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,7 @@ -[v1.18.0](https://github.com/nextcloud/nextcloudpi/commit/c140109) (2019-10-27) add ncp-previews +[v1.18.1](https://github.com/nextcloud/nextcloudpi/commit/ebe9592) (2019-11-18) Letsencrypt: support second domain (#1025) + +[v1.18.0, master](https://github.com/nextcloud/nextcloudpi/commit/0fc2390) (2019-10-27) add ncp-previews [v1.17.1 ](https://github.com/nextcloud/nextcloudpi/commit/c63cb27) (2019-09-29) nc-backup: exclude group folders in dataless backup diff --git a/etc/ncp-config.d/letsencrypt.cfg b/etc/ncp-config.d/letsencrypt.cfg index 9af75451..b31c8cf4 100644 --- a/etc/ncp-config.d/letsencrypt.cfg +++ b/etc/ncp-config.d/letsencrypt.cfg @@ -13,6 +13,12 @@ "suggest": "mycloud.ownyourbits.com" }, { + "id": "OTHER_DOMAIN", + "name": "Additional domain", + "value": "", + "suggest": "optional.cloud.ownyourbits.com" + }, + { "id": "EMAIL", "name": "Email", "value": "mycloud@ownyourbits.com", |