also save hostname in trusted domains

Signed-off-by: nachoparker <nacho@ownyourbits.com>
This commit is contained in:
nachoparker 2021-10-15 09:01:20 -06:00
parent c75db63260
commit cf4cfd81a8
3 changed files with 5 additions and 4 deletions

View File

@ -13,8 +13,8 @@ while :; do
sleep 3
done
# set "${TRUSTED_DOMAINS[ip]}"
ncc config:system:set trusted_domains 1 --value=${ip}
ncc config:system:set trusted_domains "${TRUSTED_DOMAINS[ip]}" --value="${ip}"
ncc config:system:set trusted_domains "${TRUSTED_DOMAINS[hostname]}" --value="$(hostname -f)"
# we might need to retry if redis is not ready
while :; do

View File

@ -16,7 +16,8 @@ export NCDIR=/var/www/nextcloud
export TRUSTED_DOMAINS=(
[ip]=1 [dnsmasq]=2 [nc_domain]=3 [nextcloudpi-local]=5 [docker_overwrite]=6
[nextcloudpi]=7 [nextcloudpi-lan]=8 [public_ip]=11 [letsencrypt_1]=12
[letsencrypt_2]=13 [trusted_domain_1]=20 [trusted_domain_1]=21 [trusted_domain_1]=22)
[letsencrypt_2]=13 [hostname]=14 [trusted_domain_1]=20 [trusted_domain_2]=21 [trusted_domain_3]=22
)
command -v jq &>/dev/null || {
apt-get update

2
ncp.sh
View File

@ -205,7 +205,7 @@ EOF
# LIMIT LOG SIZE
grep -q maxsize /etc/logrotate.d/apache2 || sed -i /weekly/amaxsize2M /etc/logrotate.d/apache2
cat >> /etc/logrotate.d/ncp <<'EOF'
cat > /etc/logrotate.d/ncp <<'EOF'
/var/log/ncp.log
{
rotate 4