From d4bab9bb1bc3f2d273f91a9a5c039ed8a451c9e6 Mon Sep 17 00:00:00 2001 From: librelad Date: Tue, 26 May 2026 17:26:40 +0100 Subject: [PATCH] fix(init): skip the routine update check on the first install run MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Triage of a broken fresh install: 1. init.sh → all root setup → completeInitMessage hands off to `libreportal run install` as the manager. 2. start.sh sources load_sources.sh, which calls sourceCheckFiles "run". 3. sourceCheckFiles "run" calls checkUpdates — its only path to startLoad on a non-local mode is via the git/release recovery branches. 4. git fails (the deployed install dir has no .git), lpFetchRelease fails (no reachable release manifest), none of the recovery branches converge on startLoad, and the install silently exits with WebUI + service unset. Fix: completeInitMessage exports LIBREPORTAL_INITIAL_INSTALL=1, and the sourceCheckFiles "run" branch calls startLoad directly when that's set — same endpoint the local-mode branch hits. We just installed the latest code from this tree; checking for updates on the first run was nonsensical and the recovery gauntlet would only break things. Confirmed by re-running uninstall + install: the install now reaches the Pre-Installation / database / WebUI build / crontab / WebUI compose-up steps and produces a working WebUI. (A separate compose-tag bug surfaced next — fixed in the follow-up commit.) Co-Authored-By: Claude Opus 4.7 Signed-off-by: librelad --- init.sh | 8 +++++++- scripts/source/loading/check_files.sh | 13 ++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/init.sh b/init.sh index 430f525..8851bba 100755 --- a/init.sh +++ b/init.sh @@ -1574,7 +1574,13 @@ completeInitMessage() isNotice "Starting LibrePortal installation as $sudo_user_name user..." # Switch to libreportal user and run the install command - if sudo -u "$sudo_user_name" LIBREPORTAL_SKIP_LOGO=1 bash -c "libreportal run install"; then + # LIBREPORTAL_INITIAL_INSTALL=1 tells the runtime entry (check_files.sh) to + # skip the routine update check on this very first run — we just installed + # the latest code from this very tree, and the update path would otherwise + # try to git-pull (no .git in the deployed install dir) or lpFetchRelease + # (no release manifest reachable yet), failing in ways that leave the + # WebUI / task-processor uninstalled. + if sudo -u "$sudo_user_name" LIBREPORTAL_SKIP_LOGO=1 LIBREPORTAL_INITIAL_INSTALL=1 bash -c "libreportal run install"; then # Install done — tighten the manager's broad install-phase sudo down to # the scoped runtime allowlist. initScopedSudoers diff --git a/scripts/source/loading/check_files.sh b/scripts/source/loading/check_files.sh index ae983af..bb1b127 100755 --- a/scripts/source/loading/check_files.sh +++ b/scripts/source/loading/check_files.sh @@ -20,7 +20,18 @@ sourceCheckFiles() if [[ $flag == "run" ]]; then isSuccessful "All files found and loaded for startup." detectOS; - checkUpdates; + # Fresh install (set by init.sh's completeInitMessage handoff): skip + # the routine update check and go straight to startLoad. We just + # installed the latest code — the update path's git-pull / release + # re-fetch would fail on a tree without .git or a reachable manifest + # and leave the WebUI / task-processor uninstalled. All of + # checkUpdates' own success branches converge on startLoad anyway; + # we just bypass the recovery gauntlet that doesn't apply here. + if [[ "$LIBREPORTAL_INITIAL_INSTALL" == "1" ]]; then + startLoad + else + checkUpdates + fi # This is where the CLI command starts elif [[ $flag == "cli" ]]; then detectOS;