fix(iso): repo-root paths broke when builder moved into _archived/

BUILD_VERSION/EXPECTED_VERSION/LOCAL_RELEASE, the backend container build
context, and the neode-ui/web-dist/apps/demo/docker copies all resolved
one level short (image-recipe/ instead of the repo root), so the builder
never found the prebuilt binary and its container fallback died on
'COPY core ./core'. configs/ references were already correct.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Dorian
2026-07-13 15:23:34 +01:00
co-authored by Claude Fable 5
parent f600eaf145
commit b800288550
@@ -67,7 +67,7 @@ echo "$BUILD_NUM" | sudo tee "$BUILD_COUNTER_FILE" > /dev/null 2>/dev/null || BU
GIT_SHORT=$(cd "$SCRIPT_DIR/.." && git rev-parse --short HEAD 2>/dev/null || echo "dev") GIT_SHORT=$(cd "$SCRIPT_DIR/.." && git rev-parse --short HEAD 2>/dev/null || echo "dev")
# Version format: major.minor.patch-prerelease (semver) # Version format: major.minor.patch-prerelease (semver)
# Read version from Cargo.toml (single source of truth) # Read version from Cargo.toml (single source of truth)
BUILD_VERSION=$(grep '^version' "$SCRIPT_DIR/../core/archipelago/Cargo.toml" 2>/dev/null | head -1 | sed 's/version = "//;s/"//' || echo "0.0.0") BUILD_VERSION=$(grep '^version' "$SCRIPT_DIR/../../core/archipelago/Cargo.toml" 2>/dev/null | head -1 | sed 's/version = "//;s/"//' || echo "0.0.0")
echo "Build #${BUILD_NUM} (${BUILD_VERSION}, commit ${GIT_SHORT})" echo "Build #${BUILD_NUM} (${BUILD_VERSION}, commit ${GIT_SHORT})"
# Architecture-dependent variables # Architecture-dependent variables
@@ -1073,7 +1073,7 @@ BACKEND_CAPTURED=0
# ISO — it grabbed an Apr-18 1.4.0 binary and the fleet rejected the # ISO — it grabbed an Apr-18 1.4.0 binary and the fleet rejected the
# fips.yaml it wrote out on Activate). The expected version is the one # fips.yaml it wrote out on Activate). The expected version is the one
# compiled into this build run. # compiled into this build run.
EXPECTED_VERSION="$(grep '^version' "$(cd "$SCRIPT_DIR/.." && pwd)/core/archipelago/Cargo.toml" | head -1 | sed 's/.*"\(.*\)".*/\1/')" EXPECTED_VERSION="$(grep '^version' "$(cd "$SCRIPT_DIR/../.." && pwd)/core/archipelago/Cargo.toml" | head -1 | sed 's/.*"\(.*\)".*/\1/')"
echo " Expected backend version (from Cargo.toml): $EXPECTED_VERSION" echo " Expected backend version (from Cargo.toml): $EXPECTED_VERSION"
verify_backend_version() { verify_backend_version() {
@@ -1093,7 +1093,7 @@ verify_backend_version() {
} }
# Check for local release binary first (works for both BUILD_FROM_SOURCE and normal mode) # Check for local release binary first (works for both BUILD_FROM_SOURCE and normal mode)
LOCAL_RELEASE="$(cd "$SCRIPT_DIR/.." && pwd)/core/target/release/archipelago" LOCAL_RELEASE="$(cd "$SCRIPT_DIR/../.." && pwd)/core/target/release/archipelago"
if [ -f "$LOCAL_RELEASE" ]; then if [ -f "$LOCAL_RELEASE" ]; then
if verify_backend_version "$LOCAL_RELEASE"; then if verify_backend_version "$LOCAL_RELEASE"; then
cp "$LOCAL_RELEASE" "$ARCH_DIR/bin/archipelago" cp "$LOCAL_RELEASE" "$ARCH_DIR/bin/archipelago"
@@ -1141,7 +1141,7 @@ RUN cd core && cargo build --release --bin archipelago
BACKENDFILE BACKENDFILE
BACKEND_IMAGE="localhost/archipelago-backend:iso" BACKEND_IMAGE="localhost/archipelago-backend:iso"
if $CONTAINER_CMD build --platform $CONTAINER_PLATFORM -t "$BACKEND_IMAGE" -f "$BACKEND_DOCKERFILE" "$SCRIPT_DIR/.."; then if $CONTAINER_CMD build --platform $CONTAINER_PLATFORM -t "$BACKEND_IMAGE" -f "$BACKEND_DOCKERFILE" "$SCRIPT_DIR/../.."; then
echo " Extracting backend binary..." echo " Extracting backend binary..."
BACKEND_CONTAINER=$($CONTAINER_CMD create --platform $CONTAINER_PLATFORM "$BACKEND_IMAGE") BACKEND_CONTAINER=$($CONTAINER_CMD create --platform $CONTAINER_PLATFORM "$BACKEND_IMAGE")
$CONTAINER_CMD cp "$BACKEND_CONTAINER:/build/core/target/release/archipelago" "$ARCH_DIR/bin/" && \ $CONTAINER_CMD cp "$BACKEND_CONTAINER:/build/core/target/release/archipelago" "$ARCH_DIR/bin/" && \
@@ -1211,9 +1211,9 @@ if [ -f "$WORK_DIR/archipelago-wg" ]; then
fi fi
# Copy NostrVPN UI dashboard for nginx serving # Copy NostrVPN UI dashboard for nginx serving
if [ -d "$SCRIPT_DIR/../docker/nostr-vpn-ui" ]; then if [ -d "$SCRIPT_DIR/../../docker/nostr-vpn-ui" ]; then
mkdir -p "$ARCH_DIR/web-ui/nostr-vpn" mkdir -p "$ARCH_DIR/web-ui/nostr-vpn"
cp "$SCRIPT_DIR/../docker/nostr-vpn-ui/index.html" "$ARCH_DIR/web-ui/nostr-vpn/" cp "$SCRIPT_DIR/../../docker/nostr-vpn-ui/index.html" "$ARCH_DIR/web-ui/nostr-vpn/"
echo " ✅ NostrVPN UI dashboard included" echo " ✅ NostrVPN UI dashboard included"
fi fi
@@ -1247,24 +1247,24 @@ if [ "$WEBUI_CAPTURED" = "0" ]; then
if [ "$BUILD_FROM_SOURCE" != "1" ]; then if [ "$BUILD_FROM_SOURCE" != "1" ]; then
echo " ⚠️ Could not capture from live server, building from source..." echo " ⚠️ Could not capture from live server, building from source..."
fi fi
cd "$SCRIPT_DIR/../neode-ui" cd "$SCRIPT_DIR/../../neode-ui"
echo " Installing frontend dependencies..." echo " Installing frontend dependencies..."
npm ci --prefer-offline 2>&1 | tail -3 npm ci --prefer-offline 2>&1 | tail -3
if npm run build 2>&1 | tail -5; then if npm run build 2>&1 | tail -5; then
if [ -d "$SCRIPT_DIR/../web/dist/neode-ui" ]; then if [ -d "$SCRIPT_DIR/../../web/dist/neode-ui" ]; then
echo " Including web UI from web/dist/neode-ui..." echo " Including web UI from web/dist/neode-ui..."
cp -r "$SCRIPT_DIR/../web/dist/neode-ui/"* "$ARCH_DIR/web-ui/" cp -r "$SCRIPT_DIR/../../web/dist/neode-ui/"* "$ARCH_DIR/web-ui/"
echo " ✅ Web UI built ($(du -sh "$ARCH_DIR/web-ui" | cut -f1))" echo " ✅ Web UI built ($(du -sh "$ARCH_DIR/web-ui" | cut -f1))"
fi fi
else else
echo " ⚠️ Web UI build failed" echo " ⚠️ Web UI build failed"
# Try to use existing build # Try to use existing build
if [ -d "$SCRIPT_DIR/../web/dist/neode-ui" ]; then if [ -d "$SCRIPT_DIR/../../web/dist/neode-ui" ]; then
echo " Using existing web UI build..." echo " Using existing web UI build..."
cp -r "$SCRIPT_DIR/../web/dist/neode-ui/"* "$ARCH_DIR/web-ui/" cp -r "$SCRIPT_DIR/../../web/dist/neode-ui/"* "$ARCH_DIR/web-ui/"
elif [ -d "$SCRIPT_DIR/../neode-ui/dist" ]; then elif [ -d "$SCRIPT_DIR/../../neode-ui/dist" ]; then
echo " Using neode-ui/dist..." echo " Using neode-ui/dist..."
cp -r "$SCRIPT_DIR/../neode-ui/dist/"* "$ARCH_DIR/web-ui/" cp -r "$SCRIPT_DIR/../../neode-ui/dist/"* "$ARCH_DIR/web-ui/"
else else
echo " ❌ No web UI available" echo " ❌ No web UI available"
exit 1 exit 1
@@ -1280,7 +1280,7 @@ AIUI_INCLUDED=0
# tried first so ISO builds on a fresh clone work without needing any # tried first so ISO builds on a fresh clone work without needing any
# external AIUI checkout. # external AIUI checkout.
for AIUI_DIR in \ for AIUI_DIR in \
"$SCRIPT_DIR/../demo/aiui" \ "$SCRIPT_DIR/../../demo/aiui" \
"$SCRIPT_DIR/../../AIUI/packages/app/dist" \ "$SCRIPT_DIR/../../AIUI/packages/app/dist" \
"$HOME/AIUI/packages/app/dist" \ "$HOME/AIUI/packages/app/dist" \
"/home/archipelago/AIUI/packages/app/dist" \ "/home/archipelago/AIUI/packages/app/dist" \
@@ -1307,9 +1307,9 @@ if [ "$AIUI_INCLUDED" = "0" ]; then
fi fi
# Copy app manifests # Copy app manifests
if [ -d "$SCRIPT_DIR/../apps" ]; then if [ -d "$SCRIPT_DIR/../../apps" ]; then
echo " Including app manifests..." echo " Including app manifests..."
cp -r "$SCRIPT_DIR/../apps" "$ARCH_DIR/" cp -r "$SCRIPT_DIR/../../apps" "$ARCH_DIR/"
fi fi
# Copy Plymouth theme files for installation on target # Copy Plymouth theme files for installation on target
@@ -1925,7 +1925,7 @@ fi
# Bundle docker UI source files for building custom UIs on first boot # Bundle docker UI source files for building custom UIs on first boot
# Always bundle — these are tiny HTML/CSS files, not container images # Always bundle — these are tiny HTML/CSS files, not container images
if true; then if true; then
DOCKER_UI_DIR="$SCRIPT_DIR/../docker" DOCKER_UI_DIR="$SCRIPT_DIR/../../docker"
if [ -d "$DOCKER_UI_DIR" ]; then if [ -d "$DOCKER_UI_DIR" ]; then
echo " Bundling docker UI source files..." echo " Bundling docker UI source files..."
mkdir -p "$ARCH_DIR/docker" mkdir -p "$ARCH_DIR/docker"