nextcloud: allow to adjust name of nextcloud container

Signed-off-by: Simon L. <szaimen@e.mail.de>
This commit is contained in:
Simon L. 2024-11-28 10:59:41 +01:00
parent f723b7c685
commit e156e9ccfd
2 changed files with 9 additions and 3 deletions

View file

@ -593,11 +593,16 @@ if [ -n "$ADDITIONAL_TRUSTED_PROXY" ]; then
fi
# Get ipv4-address of Nextcloud
IPv4_ADDRESS="$(dig nextcloud-aio-nextcloud A +short +search | head -1)"
if [ -z "$NEXTCLOUD_HOST" ]; then
export NEXTCLOUD_HOST="nextcloud-aio-nextcloud"
fi
IPv4_ADDRESS="$(dig "$NEXTCLOUD_HOST" A +short +search | head -1)"
# Bring it in CIDR notation
# shellcheck disable=SC2001
IPv4_ADDRESS="$(echo "$IPv4_ADDRESS" | sed 's|[0-9]\+$|0/16|')"
if [ -n "$IPv4_ADDRESS" ]; then
php /var/www/html/occ config:system:set trusted_proxies 10 --value="$IPv4_ADDRESS"
fi
if [ -n "$ADDITIONAL_TRUSTED_DOMAIN" ]; then
php /var/www/html/occ config:system:set trusted_domains 2 --value="$ADDITIONAL_TRUSTED_DOMAIN"

View file

@ -178,6 +178,7 @@
}
],
"environment": [
"NEXTCLOUD_HOST=nextcloud-aio-nextcloud",
"POSTGRES_HOST=nextcloud-aio-database",
"POSTGRES_PORT=5432",
"POSTGRES_PASSWORD=%DATABASE_PASSWORD%",