LibrePortal/scripts/webui/webui_install_image.sh
librelad 16571134b5 refactor(paths): scrub residual /docker references in display text + comments
Audit follow-up — after a full-repo sweep, the only remaining functional /docker
refs are intentional (the legacy compat shim + the env-overridden legacy-safe
backend default). Fix the last user-visible/stale ones:
- config-options.js: backup PATH_MODE 'auto' label no longer hardcodes
  /docker/backups (the path is relocatable) — describes the behaviour instead.
- config.js / setup-detector.js / webui_install_image.sh: refresh comments that
  named /docker to the relocatable system/containers roots.

No behaviour change. Active container app scripts already use $containers_dir;
the remaining /docker hits across the tree are docker-compose.yml filenames,
/var/lib/docker, the docker binary, relative array paths, docs/site, and the
unused/ graveyard.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: librelad <librelad@digitalangels.vip>
2026-05-25 17:18:46 +01:00

39 lines
2.0 KiB
Bash
Executable File

#!/bin/bash
installLibrePortalImageWebUI()
{
isHeader "LibrePortal WebUI Image"
isNotice "Building the LibrePortal WebUI Docker image..."
# The copy below writes into the dockerinstall-owned containers root. On a
# fresh install the general traversal/ownership reconcile runs LATER, so at
# this point the system root is still 750 (untraversable by the container user)
# and the containers root may still be manager-owned — the copy would fail.
# Establish traversal + containers-root ownership FIRST.
fixFolderPermissions
local result=$(copyFolder "$install_containers_dir/libreportal" "$containers_dir" "$sudo_user_name")
checkSuccess "Copy the LibrePortal to the containers folder"
reconcileWebuiDirOwnership
# copyFolder just restored the TEMPLATE docker-compose.yml, which carries raw
# #LIBREPORTAL|TAG|VALUE placeholders. On a fresh install the following
# dockerInstallApp (installLibrePortalAppWebUI) substitutes them; but on a
# REBUILD/update (libreportal already installed — this also runs via the WebUI
# deploy) nothing else does, leaving the at-rest compose unparseable by a plain
# `docker compose` (e.g. "invalid boolean: HEALTHCHECK_DATA"). Re-apply the tag
# processors here — the same self-heal up_app.sh uses — so the runtime compose
# is always fully substituted at rest, not just when started via the CLI.
if declare -F dockerConfigSetupFileWithData >/dev/null 2>&1 \
&& [[ "$(dockerCheckAppInstalled libreportal docker)" != "not_installed" ]]; then
initializeAppVariables libreportal >/dev/null 2>&1 || true
dockerConfigSetupFileWithData libreportal >/dev/null 2>&1 || true
checkSuccess "Re-applied LibrePortal WebUI compose tag substitutions"
fi
isNotice "Building libreportal-service image, this may take a while..."
local result=$(runFileOp docker build -t libreportal-service -f $containers_dir/libreportal/Dockerfile $containers_dir/libreportal >/dev/null 2>&1)
checkSuccess "Built LibrePortal WebUI Docker image"
}