From 03afcfa4f131fbef349d50852fe05020f8105dbe Mon Sep 17 00:00:00 2001 From: librelad Date: Sun, 24 May 2026 02:23:00 +0100 Subject: [PATCH] fix(switcher): read rootless install user authoritatively from config, not the mode-polluted global ROOT CAUSE of the WebUI-dir misownership on rooted->rootless: check_install_type.sh sets the lowercase $docker_install_user to the MANAGER user in rooted mode (it's a mode-dependent 'container owner' var). reconcile trusted it, so mid-switch it held the stale rooted value (=manager) and chowned the rootless WebUI dir to libreportal -> WebUI Exited(137) -> dockerStartAllApps retried forever (the 'switch hangs' symptom). Now read CFG_DOCKER_INSTALL_USER straight from the live config file (authoritative, never polluted), falling back to the CFG var then a hard default. Co-Authored-By: Claude Opus 4.7 Signed-off-by: librelad --- scripts/function/permission/libreportal_folders.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/function/permission/libreportal_folders.sh b/scripts/function/permission/libreportal_folders.sh index 9951365..b3ecfb8 100755 --- a/scripts/function/permission/libreportal_folders.sh +++ b/scripts/function/permission/libreportal_folders.sh @@ -35,9 +35,13 @@ reconcileDockerOwnership() local logdir="${logs_dir:-$ddir/logs/}" local scrdir="${script_dir:-$ddir/install}" local dbpath="$ddir/${db_file:-database.db}" - local appusr="${docker_install_user:-${CFG_DOCKER_INSTALL_USER:-}}" - [[ -z "$appusr" ]] && appusr=$(grep -h '^CFG_DOCKER_INSTALL_USER=' "$cfgdir/general/general_docker_install" 2>/dev/null | head -1 | cut -d= -f2 | awk '{print $1}') - appusr="${appusr:-dockerinstall}" + # Read the rootless docker install user AUTHORITATIVELY from config — NOT the + # lowercase $docker_install_user global, which check_install_type.sh sets to + # the MANAGER user in rooted mode, so during a rooted->rootless switch it's + # stale (=manager) and would mis-own the WebUI dir. + local appusr + appusr=$(grep -h '^CFG_DOCKER_INSTALL_USER=' "$cfgdir/general/general_docker_install" 2>/dev/null | head -1 | cut -d= -f2 | awk '{print $1}') + appusr="${appusr:-${CFG_DOCKER_INSTALL_USER:-dockerinstall}}" [[ -d "$ddir" ]] || return 0