From 9ffc8e49246172a3d793f59795f4f33d781ec457 Mon Sep 17 00:00:00 2001 From: librelad Date: Tue, 26 May 2026 23:42:12 +0100 Subject: [PATCH] chore(cleanup): retire two stale leftovers from the lazy-load + subdomain work MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit initilize_files.sh's load-comment said "Phase 6 will tackle this with a precompiled cache file" — but Phase 6 deliberately shipped a different (simpler) win, and Phase 7 was reconsidered and rejected (the ~30 ms saving doesn't justify the invalidation complexity across every CFG write site). Rewrite the comment to describe current behaviour: the two config scans run because bash can't lazy-load variables, and the precompile was looked at and dropped. app_generate.sh had a `read -p "" host_name` inside a `while true` with no break — anyone who actually ran `libreportal app generate` would have hung at the hostname prompt forever. The value was then fed into a `sed 's/HOST_NAME=test/HOST_NAME='"$host_name"'/g'` against the new app's .config file, but the post-2e4f420 template no longer carries HOST_NAME=test (per-port subdomains in the PORT row drive routing now). So the prompt was infinite-looping to gather a value that fed a no-op sed. Drop both — the function loses no real capability since the subdomain field is set per-port via the standard PORT row. Co-Authored-By: Claude Opus 4.7 Signed-off-by: librelad --- scripts/app/app_generate.sh | 7 ------- scripts/source/loading/initilize_files.sh | 8 +++++--- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/scripts/app/app_generate.sh b/scripts/app/app_generate.sh index 2a008b2..1dc1b52 100755 --- a/scripts/app/app_generate.sh +++ b/scripts/app/app_generate.sh @@ -35,11 +35,6 @@ appGenerate() echo "" done - while true; do - isQuestion "Please enter the hostname (e.g., a hostname 'test' would set up the domain: test.yourdomain.com): " - read -p "" host_name - done - while true; do isQuestion "Please enter a short description (e.g a Finance Mananger): " read -p "" app_description @@ -106,8 +101,6 @@ appGenerate() checkSuccess "Update $app_name.config - all cases of template to $app_name" local result=$(runInstallOp sed -i '' -e 's/TEMPLATE/'"$full_caps_app_name"'/g' "$app_config_file" > /dev/null 2>&1) checkSuccess "Update $app_name.config - all cases of TEMPLATE to $full_caps_app_name" - local result=$(runInstallOp sed -i '' -e 's/HOST_NAME=test/HOST_NAME='"$host_name"'/g' "$app_config_file" > /dev/null 2>&1) - checkSuccess "Updating Config - HOST_NAME to $app_name" while true; do echo "" diff --git a/scripts/source/loading/initilize_files.sh b/scripts/source/loading/initilize_files.sh index a5db116..0f53b38 100755 --- a/scripts/source/loading/initilize_files.sh +++ b/scripts/source/loading/initilize_files.sh @@ -140,9 +140,11 @@ sourceInitilize() # # Under LP_LAZY=1 with a present manifest, the container scan is replaced # by autoload stubs in function_manifest.sh — sourcing every container - # installer eagerly would defeat the lazy optimisation. The two config - # scans still run because bash can't lazy-load variables (Phase 6 will - # tackle this with a precompiled cache file). + # installer eagerly would defeat the lazy optimisation. Both config scans + # still run because bash can't lazy-load variables; precompiling them was + # considered (Phase 7) and rejected — the ~30 ms saving doesn't justify + # the invalidation complexity (updateConfigOption writes happen across + # many code paths). sourceScanFiles "libreportal_configs"; sourceScanFiles "app_configs"; if [[ "$LP_LAZY" == "1" ]] && declare -p LP_FN_MAP >/dev/null 2>&1; then