re-introduce limiting the php-fpm port to certain containers

Signed-off-by: Simon L <szaimen@e.mail.de>
This commit is contained in:
Simon L 2023-11-13 15:53:17 +01:00
parent 85933dd149
commit 72ecbfec49
4 changed files with 31 additions and 24 deletions

View file

@ -491,8 +491,14 @@ else
fi fi
# AIO app # AIO app
if [ "$(php /var/www/html/occ config:app:get nextcloud-aio enabled)" != "yes" ]; then if [ "$THIS_IS_AIO" = "true" ]; then
php /var/www/html/occ app:enable nextcloud-aio if [ "$(php /var/www/html/occ config:app:get nextcloud-aio enabled)" != "yes" ]; then
php /var/www/html/occ app:enable nextcloud-aio
fi
else
if [ "$(php /var/www/html/occ config:app:get nextcloud-aio enabled)" != "no" ]; then
php /var/www/html/occ app:disable nextcloud-aio
fi
fi fi
# Notify push # Notify push

View file

@ -131,26 +131,25 @@ if ! sudo -E -u www-data bash /entrypoint.sh; then
exit 1 exit 1
fi fi
# The below was disabled again because it fails on some deployment methods, e.g. on kubernetes while [ "$THIS_IS_AIO" = "true" ] && [ -z "$(dig nextcloud-aio-apache A +short +search)" ]; do
# There is apparently no way to make this work reliably automatically echo "Waiting for nextcloud-aio-apache to start..."
# while [ -z "$(dig nextcloud-aio-apache A +short +search)" ]; do sleep 5
# echo "Waiting for nextcloud-aio-apache to start..." done
# sleep 5
# done set -x
# # shellcheck disable=SC2235
# set -x if [ "$THIS_IS_AIO" = "true" ] && ([ "$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 +search | 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 +search | 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 +search | 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 +search | 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 sed -i "/^listen.allowed_clients/s/,,/,/g" /usr/local/etc/php-fpm.d/www.conf
# sed -i "/^listen.allowed_clients/s/,,/,/g" /usr/local/etc/php-fpm.d/www.conf sed -i "/^listen.allowed_clients/s/,$//" /usr/local/etc/php-fpm.d/www.conf
# sed -i "/^listen.allowed_clients/s/,$//" /usr/local/etc/php-fpm.d/www.conf grep listen.allowed_clients /usr/local/etc/php-fpm.d/www.conf
# grep listen.allowed_clients /usr/local/etc/php-fpm.d/www.conf fi
# fi set +x
# set +x
exec "$@" exec "$@"

View file

@ -32,6 +32,7 @@ echo "$OUTPUT" | yq -P > ./manual-install/containers.yml
cd manual-install || exit cd manual-install || exit
sed -i "s|'||g" containers.yml sed -i "s|'||g" containers.yml
sed -i '/display_name:/d' containers.yml sed -i '/display_name:/d' containers.yml
sed -i '/THIS_IS_AIO:/d' containers.yml
sed -i '/stop_grace_period:/s/$/s/' containers.yml sed -i '/stop_grace_period:/s/$/s/' containers.yml
sed -i '/: \[\]/d' containers.yml sed -i '/: \[\]/d' containers.yml
sed -i 's|- source: |- |' containers.yml sed -i 's|- source: |- |' containers.yml

View file

@ -212,7 +212,8 @@
"DOCKER_SOCKET_PROXY_ENABLED=%DOCKER_SOCKET_PROXY_ENABLED%", "DOCKER_SOCKET_PROXY_ENABLED=%DOCKER_SOCKET_PROXY_ENABLED%",
"REMOVE_DISABLED_APPS=%REMOVE_DISABLED_APPS%", "REMOVE_DISABLED_APPS=%REMOVE_DISABLED_APPS%",
"APACHE_PORT=%APACHE_PORT%", "APACHE_PORT=%APACHE_PORT%",
"APACHE_IP_BINDING=%APACHE_IP_BINDING%" "APACHE_IP_BINDING=%APACHE_IP_BINDING%",
"THIS_IS_AIO=true"
], ],
"restart": "unless-stopped", "restart": "unless-stopped",
"devices": [ "devices": [