mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-19 22:16:49 +00:00
fix dig inside kubernetes
Signed-off-by: Simon L <szaimen@e.mail.de>
This commit is contained in:
parent
713d155265
commit
ce84eb7bfe
5 changed files with 12 additions and 12 deletions
|
|
@ -18,7 +18,7 @@ while ! nc -z "$NEXTCLOUD_HOST" 9000; do
|
||||||
done
|
done
|
||||||
|
|
||||||
# Get ipv4-address of Apache
|
# Get ipv4-address of Apache
|
||||||
IPv4_ADDRESS="$(dig nextcloud-aio-apache A +short | head -1)"
|
IPv4_ADDRESS="$(dig nextcloud-aio-apache A +short +search | head -1)"
|
||||||
# Bring it in CIDR notation
|
# Bring it in CIDR notation
|
||||||
# shellcheck disable=SC2001
|
# shellcheck disable=SC2001
|
||||||
IPv4_ADDRESS="$(echo "$IPv4_ADDRESS" | sed 's|[0-9]\+$|1/32|')"
|
IPv4_ADDRESS="$(echo "$IPv4_ADDRESS" | sed 's|[0-9]\+$|1/32|')"
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,11 @@ while ! nc -z "$NEXTCLOUD_HOST" 9001; do
|
||||||
done
|
done
|
||||||
|
|
||||||
set -x
|
set -x
|
||||||
IPv4_ADDRESS_NC="$(dig nextcloud-aio-nextcloud IN A +short | grep '^[0-9.]\+$' | sort | head -n1)"
|
IPv4_ADDRESS_NC="$(dig nextcloud-aio-nextcloud IN A +short +search | grep '^[0-9.]\+$' | sort | head -n1)"
|
||||||
HAPROXYFILE="$(sed "s|NC_IPV4_PLACEHOLDER|$IPv4_ADDRESS_NC|" /haproxy.cfg)"
|
HAPROXYFILE="$(sed "s|NC_IPV4_PLACEHOLDER|$IPv4_ADDRESS_NC|" /haproxy.cfg)"
|
||||||
echo "$HAPROXYFILE" > /tmp/haproxy.cfg
|
echo "$HAPROXYFILE" > /tmp/haproxy.cfg
|
||||||
|
|
||||||
IPv6_ADDRESS_NC="$(dig nextcloud-aio-nextcloud AAAA +short | grep '^[0-9a-f:]\+$' | sort | head -n1)"
|
IPv6_ADDRESS_NC="$(dig nextcloud-aio-nextcloud AAAA +short +search | grep '^[0-9a-f:]\+$' | sort | head -n1)"
|
||||||
if [ -n "$IPv6_ADDRESS_NC" ]; then
|
if [ -n "$IPv6_ADDRESS_NC" ]; then
|
||||||
HAPROXYFILE="$(sed "s|NC_IPV6_PLACEHOLDER|$IPv6_ADDRESS_NC|" /tmp/haproxy.cfg)"
|
HAPROXYFILE="$(sed "s|NC_IPV6_PLACEHOLDER|$IPv6_ADDRESS_NC|" /tmp/haproxy.cfg)"
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -520,8 +520,8 @@ if [ "$COLLABORA_ENABLED" = 'yes' ]; then
|
||||||
# Fix https://github.com/nextcloud/all-in-one/issues/188:
|
# Fix https://github.com/nextcloud/all-in-one/issues/188:
|
||||||
php /var/www/html/occ config:system:set allow_local_remote_servers --type=bool --value=true
|
php /var/www/html/occ config:system:set allow_local_remote_servers --type=bool --value=true
|
||||||
# Make collabora more save
|
# Make collabora more save
|
||||||
COLLABORA_IPv4_ADDRESS="$(dig "$NC_DOMAIN" A +short | grep '^[0-9.]\+$' | sort | head -n1)"
|
COLLABORA_IPv4_ADDRESS="$(dig "$NC_DOMAIN" A +short +search | grep '^[0-9.]\+$' | sort | head -n1)"
|
||||||
COLLABORA_IPv6_ADDRESS="$(dig "$NC_DOMAIN" AAAA +short | grep '^[0-9a-f:]\+$' | sort | head -n1)"
|
COLLABORA_IPv6_ADDRESS="$(dig "$NC_DOMAIN" AAAA +short +search | grep '^[0-9a-f:]\+$' | sort | head -n1)"
|
||||||
COLLABORA_ALLOW_LIST="$(php /var/www/html/occ config:app:get richdocuments wopi_allowlist)"
|
COLLABORA_ALLOW_LIST="$(php /var/www/html/occ config:app:get richdocuments wopi_allowlist)"
|
||||||
if [ -n "$COLLABORA_IPv4_ADDRESS" ]; then
|
if [ -n "$COLLABORA_IPv4_ADDRESS" ]; then
|
||||||
if ! echo "$COLLABORA_ALLOW_LIST" | grep -q "$COLLABORA_IPv4_ADDRESS"; then
|
if ! echo "$COLLABORA_ALLOW_LIST" | grep -q "$COLLABORA_IPv4_ADDRESS"; then
|
||||||
|
|
|
||||||
|
|
@ -131,17 +131,17 @@ if ! sudo -E -u www-data bash /entrypoint.sh; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
while [ -z "$(dig nextcloud-aio-apache A +short)" ]; do
|
while [ -z "$(dig nextcloud-aio-apache A +short +search)" ]; do
|
||||||
echo "Waiting for nextcloud-aio-apache to start..."
|
echo "Waiting for nextcloud-aio-apache to start..."
|
||||||
sleep 5
|
sleep 5
|
||||||
done
|
done
|
||||||
|
|
||||||
set -x
|
set -x
|
||||||
if [ "$APACHE_PORT" = 443 ] || [ "$APACHE_IP_BINDING" = "127.0.0.1" ] || [ "$APACHE_IP_BINDING" = "::1" ]; then
|
if [ "$APACHE_PORT" = 443 ] || [ "$APACHE_IP_BINDING" = "127.0.0.1" ] || [ "$APACHE_IP_BINDING" = "::1" ]; then
|
||||||
IPv4_ADDRESS_APACHE="$(dig nextcloud-aio-apache A +short | grep '^[0-9.]\+$' | sort | head -n1)"
|
IPv4_ADDRESS_APACHE="$(dig nextcloud-aio-apache A +short +search | grep '^[0-9.]\+$' | sort | head -n1)"
|
||||||
IPv6_ADDRESS_APACHE="$(dig nextcloud-aio-apache AAAA +short | grep '^[0-9a-f:]\+$' | sort | head -n1)"
|
IPv6_ADDRESS_APACHE="$(dig nextcloud-aio-apache AAAA +short +search | grep '^[0-9a-f:]\+$' | sort | head -n1)"
|
||||||
IPv4_ADDRESS_MASTERCONTAINER="$(dig nextcloud-aio-mastercontainer A +short | grep '^[0-9.]\+$' | sort | head -n1)"
|
IPv4_ADDRESS_MASTERCONTAINER="$(dig nextcloud-aio-mastercontainer A +short +search | grep '^[0-9.]\+$' | sort | head -n1)"
|
||||||
IPv6_ADDRESS_MASTERCONTAINER="$(dig nextcloud-aio-mastercontainer AAAA +short | grep '^[0-9a-f:]\+$' | sort | head -n1)"
|
IPv6_ADDRESS_MASTERCONTAINER="$(dig nextcloud-aio-mastercontainer AAAA +short +search | grep '^[0-9a-f:]\+$' | sort | head -n1)"
|
||||||
|
|
||||||
sed -i "s|^;listen.allowed_clients|listen.allowed_clients|" /usr/local/etc/php-fpm.d/www.conf
|
sed -i "s|^;listen.allowed_clients|listen.allowed_clients|" /usr/local/etc/php-fpm.d/www.conf
|
||||||
sed -i "s|listen.allowed_clients.*|listen.allowed_clients = 127.0.0.1,::1,$IPv4_ADDRESS_APACHE,$IPv6_ADDRESS_APACHE,$IPv4_ADDRESS_MASTERCONTAINER,$IPv6_ADDRESS_MASTERCONTAINER|" /usr/local/etc/php-fpm.d/www.conf
|
sed -i "s|listen.allowed_clients.*|listen.allowed_clients = 127.0.0.1,::1,$IPv4_ADDRESS_APACHE,$IPv6_ADDRESS_APACHE,$IPv4_ADDRESS_MASTERCONTAINER,$IPv6_ADDRESS_MASTERCONTAINER|" /usr/local/etc/php-fpm.d/www.conf
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,8 @@ elif [ -z "$INTERNAL_SECRET" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
set -x
|
set -x
|
||||||
IPv4_ADDRESS_TALK="$(dig nextcloud-aio-talk IN A +short | grep '^[0-9.]\+$' | sort | head -n1)"
|
IPv4_ADDRESS_TALK="$(dig nextcloud-aio-talk IN A +short +search | grep '^[0-9.]\+$' | sort | head -n1)"
|
||||||
IPv6_ADDRESS_TALK="$(dig nextcloud-aio-talk AAAA +short | grep '^[0-9a-f:]\+$' | sort | head -n1)"
|
IPv6_ADDRESS_TALK="$(dig nextcloud-aio-talk AAAA +short +search | grep '^[0-9a-f:]\+$' | sort | head -n1)"
|
||||||
set +x
|
set +x
|
||||||
|
|
||||||
# Turn
|
# Turn
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue