mirror of
https://github.com/nextcloud/nextcloudpi.git
synced 2026-01-10 15:12:01 -03:30
Letsencrypt: support second domain (#1025)
This commit is contained in:
parent
a208a02a53
commit
310877f61c
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -12,6 +12,12 @@
|
||||
"value": "mycloud.ownyourbits.com",
|
||||
"suggest": "mycloud.ownyourbits.com"
|
||||
},
|
||||
{
|
||||
"id": "OTHER_DOMAIN",
|
||||
"name": "Additional domain",
|
||||
"value": "",
|
||||
"suggest": "optional.cloud.ownyourbits.com"
|
||||
},
|
||||
{
|
||||
"id": "EMAIL",
|
||||
"name": "Email",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user