diff --git a/scripts/function/permission/libreportal_folders.sh b/scripts/function/permission/libreportal_folders.sh index 44df614..aafe379 100755 --- a/scripts/function/permission/libreportal_folders.sh +++ b/scripts/function/permission/libreportal_folders.sh @@ -25,7 +25,8 @@ reconcileDockerOwnership() # The control plane is owned by the MANAGER user in BOTH modes. root:root was # never the intended model — it only ever showed up as an artifact of # un-de-sudo'd commands (sudo creating files as root instead of libreportal). - local owner="$sudo_user_name" + local owner="${sudo_user_name:-libreportal}" + local appusr="${docker_install_user:-$CFG_DOCKER_INSTALL_USER}" # Swap ONLY the owner on our own control-plane files; never reset mode bits # (so nothing that validates its permissions gets surprised). The only two @@ -52,7 +53,7 @@ reconcileDockerOwnership() local webui_dir="${containers_dir}libreportal" if [[ -d "$webui_dir" ]]; then local app_owner="$owner" - [[ "$mode" == "rootless" ]] && app_owner="$docker_install_user" + [[ "$mode" == "rootless" ]] && app_owner="$appusr" runSystem chown -R "$app_owner:$app_owner" "$webui_dir" fi