Reorganize Docker socket connection check

Signed-off-by: Yunhao Jiang <39151399+yunhao-jiang@users.noreply.github.com>
This commit is contained in:
Yunhao Jiang 2025-11-28 17:56:58 -08:00 committed by GitHub
parent 4a2a8dd002
commit 08f6625e5c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -75,15 +75,6 @@ elif ! sudo -E -u www-data test -r /var/run/docker.sock; then
fi
fi
# Check if api version is supported
if ! sudo -E -u www-data docker info &>/dev/null; then
print_red "Cannot connect to the docker socket. Cannot proceed."
echo "Did you maybe remove group read permissions for the docker socket? AIO needs them in order to access the docker socket."
echo "If SELinux is enabled on your host, see https://github.com/nextcloud/all-in-one#are-there-known-problems-when-selinux-is-enabled"
echo "If you are on TrueNas SCALE, see https://github.com/nextcloud/all-in-one#can-i-run-aio-on-truenas-scale"
exit 1
fi
# Docker api version check
API_VERSION_FILE="$(find ./ -name DockerActionManager.php | head -1)"
API_VERSION="$(grep -oP 'const string API_VERSION.*\;' "$API_VERSION_FILE" | grep -oP '[0-9]+.[0-9]+' | head -1)"
@ -115,6 +106,15 @@ else
fi
fi
# Check if api version is supported
if ! sudo -E -u www-data docker info &>/dev/null; then
print_red "Cannot connect to the docker socket. Cannot proceed."
echo "Did you maybe remove group read permissions for the docker socket? AIO needs them in order to access the docker socket."
echo "If SELinux is enabled on your host, see https://github.com/nextcloud/all-in-one#are-there-known-problems-when-selinux-is-enabled"
echo "If you are on TrueNas SCALE, see https://github.com/nextcloud/all-in-one#can-i-run-aio-on-truenas-scale"
exit 1
fi
# Check Storage drivers
STORAGE_DRIVER="$(sudo -E -u www-data docker info | grep "Storage Driver")"
# Check if vfs is used: https://github.com/nextcloud/all-in-one/discussions/1467