LibrePortal/scripts/checks/requirements/check_webui_image.sh
librelad ecd3db5632 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>
2026-05-24 13:39:06 +01:00

13 lines
395 B
Bash
Executable File

#!/bin/bash
checkLibrePortalWebUIImageRequirement()
{
if [[ $CFG_REQUIREMENT_WEBUI == "true" ]]; then
if runFileOp docker images --format "{{.Repository}}:{{.Tag}}" | grep -q "libreportal-service:latest"; then
isSuccessful "LibrePortal WebUI Docker Image appears to be setup."
else
isNotice "LibrePortal WebUI Docker Image has not been setup."
((preinstallneeded++))
fi
fi
}