fix(rootless): route requirement/disk docker checks through runFileOp
Three docker calls ran the binary directly (two plain, one sudo), so in rootless they hit /var/run/docker.sock (the rooted socket, absent) and printed 'Cannot connect to the Docker daemon' — the WebUI-image requirement check, the system-disk WebUI generator (docker system df), and the app-install fallback (docker ps). Route all three through runFileOp, which in rootless runs as the docker install user with DOCKER_HOST set and is argv-safe for --format, and in rooted runs as the manager via the docker group. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: librelad <librelad@digitalangels.vip>
This commit is contained in:
parent
dcbb3c1759
commit
ecd3db5632
@ -114,6 +114,6 @@ _appReqServiceInstalled()
|
|||||||
status=$(dockerCheckAppInstalled "$svc" "docker" 2>/dev/null)
|
status=$(dockerCheckAppInstalled "$svc" "docker" 2>/dev/null)
|
||||||
[[ "$status" == "installed" ]] && return 0 || return 1
|
[[ "$status" == "installed" ]] && return 0 || return 1
|
||||||
fi
|
fi
|
||||||
# Fallback: ask docker directly.
|
# Fallback: ask docker directly (mode-aware: rootless hits the rootless socket).
|
||||||
sudo docker ps -a --format '{{.Names}}' 2>/dev/null | grep -q "^${svc}-service$"
|
runFileOp docker ps -a --format '{{.Names}}' 2>/dev/null | grep -q "^${svc}-service$"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
checkLibrePortalWebUIImageRequirement()
|
checkLibrePortalWebUIImageRequirement()
|
||||||
{
|
{
|
||||||
if [[ $CFG_REQUIREMENT_WEBUI == "true" ]]; then
|
if [[ $CFG_REQUIREMENT_WEBUI == "true" ]]; then
|
||||||
if docker images --format "{{.Repository}}:{{.Tag}}" | grep -q "libreportal-service:latest"; then
|
if runFileOp docker images --format "{{.Repository}}:{{.Tag}}" | grep -q "libreportal-service:latest"; then
|
||||||
isSuccessful "LibrePortal WebUI Docker Image appears to be setup."
|
isSuccessful "LibrePortal WebUI Docker Image appears to be setup."
|
||||||
else
|
else
|
||||||
isNotice "LibrePortal WebUI Docker Image has not been setup."
|
isNotice "LibrePortal WebUI Docker Image has not been setup."
|
||||||
|
|||||||
@ -17,7 +17,7 @@ webuiSystemDisk() {
|
|||||||
local docker_percent="0"
|
local docker_percent="0"
|
||||||
|
|
||||||
if command -v docker &> /dev/null; then
|
if command -v docker &> /dev/null; then
|
||||||
docker_usage=$(docker system df --format "{{.Size}}" | head -1 2>/dev/null || echo "N/A")
|
docker_usage=$(runFileOp docker system df --format "{{.Size}}" 2>/dev/null | head -1 || echo "N/A")
|
||||||
if [[ "$docker_usage" != "N/A" ]]; then
|
if [[ "$docker_usage" != "N/A" ]]; then
|
||||||
# Convert Docker usage to GB for calculation
|
# Convert Docker usage to GB for calculation
|
||||||
docker_used=$(echo "$docker_usage" | sed 's/GB//g' | sed 's/MB//g' | awk '{print $1*1}' 2>/dev/null || echo "0")
|
docker_used=$(echo "$docker_usage" | sed 's/GB//g' | sed 's/MB//g' | awk '{print $1*1}' 2>/dev/null || echo "0")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user