From 9d6fd25c41cd965ad23c1571867a50a60a6dc64e Mon Sep 17 00:00:00 2001 From: librelad Date: Tue, 18 Aug 2026 22:40:24 +0100 Subject: [PATCH] Point an instance's APP_NAME at its own slug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit instanceCreate re-namespaced the config KEYS (CFG__* -> CFG__*) but left APP_NAME's VALUE at the type. installApp resolves the app it operates on from CFG__APP_NAME, so `instance create bookstack fwtest` ran the entire install pipeline against the BASE app: "Install bookstack", the base deployed dir, compose down/up on the already-running base container, base DB row re-stamped — and the instance never installed at all. Only the template dir was left behind. Every base app ships APP_NAME == its own slug; stamp instances the same. Instance install still does not complete after this: the cloned compose keeps the type's tag namespace (#LIBREPORTAL|BOOKSTACK_APP_KEY_1_TAG|...) while the config now defines CFG__*, so the placeholders never substitute and the pre-start guard refuses to launch. Fixing that is a separate change to _instanceRewriteCompose. Co-Authored-By: Claude Opus 5 --- scripts/instance/instance_create.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/instance/instance_create.sh b/scripts/instance/instance_create.sh index cb6c463..dbbe5c8 100644 --- a/scripts/instance/instance_create.sh +++ b/scripts/instance/instance_create.sh @@ -182,6 +182,14 @@ instanceCreate() { type_title=$(instanceTypeCfg "$type" "TITLE") [[ -z "$type_title" ]] && type_title="$type" + # APP_NAME must follow the slug. The sed above re-namespaces the KEY but + # leaves the VALUE at the type ("bookstack"), and installApp resolves the app + # it operates on from CFG__APP_NAME — so an instance install ran the + # whole pipeline against the BASE app instead: same deployed dir, same ports, + # compose down/up on the already-running base container, base DB row updated, + # and the instance itself never installed. Every base app ships APP_NAME == + # its own slug; this keeps instances to that invariant. + _instanceSetCfg "CFG_${slug_u}_APP_NAME" "$slug" "$cfg" _instanceSetCfg "CFG_${slug_u}_INSTANCE_OF" "$type" "$cfg" _instanceSetCfg "CFG_${slug_u}_MULTI_INSTANCE" "false" "$cfg" _instanceSetCfg "CFG_${slug_u}_TITLE" "${type_title} · ${id}" "$cfg"