Revise BUILD-GUIDE and enhance ISO build process
- Updated BUILD-GUIDE.md to streamline instructions for building the Archipelago Auto-Installer ISO, including prerequisites and post-installation steps. - Added detailed sections on capturing the live server state and building from source. - Enhanced Docker and Podman integration in build scripts for improved backend and web UI capture. - Introduced new app metadata for "IndeedHub" in the Docker package scanner and updated UI components for better installation progress tracking. - Improved styling and functionality in the Bitcoin UI for a more cohesive user experience.
This commit is contained in:
@@ -5,17 +5,29 @@
|
||||
# This creates an ISO that automatically installs to the internal disk
|
||||
# with minimal user interaction - similar to StartOS experience.
|
||||
#
|
||||
# CRITICAL: This script CAPTURES the LIVE SERVER state by default.
|
||||
# Set DEV_SERVER to point to your development server.
|
||||
#
|
||||
# Usage:
|
||||
# DEV_SERVER=archipelago@192.168.1.228 ./build-auto-installer-iso.sh
|
||||
# OR just: ./build-auto-installer-iso.sh (uses default server)
|
||||
#
|
||||
# To build from source instead:
|
||||
# BUILD_FROM_SOURCE=1 ./build-auto-installer-iso.sh
|
||||
#
|
||||
# Features:
|
||||
# - Pre-built root filesystem (no network needed during install)
|
||||
# - Auto-detects internal disk (skips USB boot drive)
|
||||
# - Automatic installation with progress display
|
||||
# - Boots directly to web UI after install
|
||||
#
|
||||
# Usage: ./build-auto-installer-iso.sh
|
||||
#
|
||||
|
||||
set -e
|
||||
|
||||
# Configuration
|
||||
DEV_SERVER="${DEV_SERVER:-archipelago@192.168.1.228}"
|
||||
BUILD_FROM_SOURCE="${BUILD_FROM_SOURCE:-0}"
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
WORK_DIR="$SCRIPT_DIR/build/auto-installer"
|
||||
OUTPUT_DIR="$SCRIPT_DIR/results"
|
||||
@@ -26,6 +38,13 @@ echo "╔═══════════════════════
|
||||
echo "║ Building Archipelago Auto-Installer ISO (StartOS-like) ║"
|
||||
echo "╚════════════════════════════════════════════════════════════════╝"
|
||||
echo ""
|
||||
if [ "$BUILD_FROM_SOURCE" = "1" ]; then
|
||||
echo "📦 Mode: Building from SOURCE CODE"
|
||||
else
|
||||
echo "📦 Mode: Capturing LIVE SERVER state"
|
||||
echo " Server: $DEV_SERVER"
|
||||
fi
|
||||
echo ""
|
||||
|
||||
# Check for required tools
|
||||
check_tools() {
|
||||
@@ -243,53 +262,114 @@ mkdir -p "$ARCH_DIR/scripts"
|
||||
echo " Including root filesystem..."
|
||||
cp "$ROOTFS_TAR" "$ARCH_DIR/rootfs.tar"
|
||||
|
||||
# Build and copy backend binary
|
||||
echo " Building backend binary for Linux x86_64..."
|
||||
BACKEND_DOCKERFILE="$WORK_DIR/Dockerfile.backend"
|
||||
cat > "$BACKEND_DOCKERFILE" <<'BACKENDFILE'
|
||||
# Capture backend binary from live server
|
||||
if [ "$BUILD_FROM_SOURCE" = "1" ]; then
|
||||
echo " Building backend binary from source..."
|
||||
else
|
||||
echo " Capturing backend binary from live server..."
|
||||
fi
|
||||
|
||||
# Try to get from live server first (unless BUILD_FROM_SOURCE=1)
|
||||
BACKEND_CAPTURED=0
|
||||
if [ "$BUILD_FROM_SOURCE" != "1" ]; then
|
||||
# Check if we're running on the server itself (localhost or same machine)
|
||||
if [ "$DEV_SERVER" = "localhost" ] || [ "$DEV_SERVER" = "127.0.0.1" ]; then
|
||||
# Direct copy from local filesystem
|
||||
if [ -f "/usr/local/bin/archipelago" ]; then
|
||||
cp "/usr/local/bin/archipelago" "$ARCH_DIR/bin/archipelago"
|
||||
chmod +x "$ARCH_DIR/bin/archipelago"
|
||||
echo " ✅ Backend captured from local system ($(du -h "$ARCH_DIR/bin/archipelago" | cut -f1))"
|
||||
BACKEND_CAPTURED=1
|
||||
fi
|
||||
else
|
||||
# Remote copy via SCP
|
||||
if scp "$DEV_SERVER:/usr/local/bin/archipelago" "$ARCH_DIR/bin/archipelago" 2>/dev/null; then
|
||||
chmod +x "$ARCH_DIR/bin/archipelago"
|
||||
echo " ✅ Backend captured from remote server ($(du -h "$ARCH_DIR/bin/archipelago" | cut -f1))"
|
||||
BACKEND_CAPTURED=1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$BACKEND_CAPTURED" = "0" ]; then
|
||||
if [ "$BUILD_FROM_SOURCE" != "1" ]; then
|
||||
echo " ⚠️ Could not capture from live server, building from source..."
|
||||
fi
|
||||
BACKEND_DOCKERFILE="$WORK_DIR/Dockerfile.backend"
|
||||
cat > "$BACKEND_DOCKERFILE" <<'BACKENDFILE'
|
||||
FROM rust:1.93-bookworm as builder
|
||||
WORKDIR /build
|
||||
COPY core ./core
|
||||
RUN cd core && cargo build --release --bin archipelago
|
||||
BACKENDFILE
|
||||
|
||||
if $CONTAINER_CMD build --platform linux/amd64 -t archipelago-backend -f "$BACKEND_DOCKERFILE" "$SCRIPT_DIR/.." 2>&1 | tail -20; then
|
||||
echo " Extracting backend binary..."
|
||||
BACKEND_CONTAINER=$($CONTAINER_CMD create --platform linux/amd64 archipelago-backend)
|
||||
$CONTAINER_CMD cp "$BACKEND_CONTAINER:/build/core/target/release/archipelago" "$ARCH_DIR/bin/" && \
|
||||
echo " ✅ Backend binary included ($(du -h "$ARCH_DIR/bin/archipelago" | cut -f1))"
|
||||
$CONTAINER_CMD rm "$BACKEND_CONTAINER"
|
||||
else
|
||||
echo " ⚠️ Backend build failed - using existing binary if available"
|
||||
if [ -f "$SCRIPT_DIR/../core/target/release/archipelago" ]; then
|
||||
cp "$SCRIPT_DIR/../core/target/release/archipelago" "$ARCH_DIR/bin/"
|
||||
echo " Using local backend binary (may not be compatible)"
|
||||
if $CONTAINER_CMD build --platform linux/amd64 -t archipelago-backend -f "$BACKEND_DOCKERFILE" "$SCRIPT_DIR/.." 2>&1 | tail -20; then
|
||||
echo " Extracting backend binary..."
|
||||
BACKEND_CONTAINER=$($CONTAINER_CMD create --platform linux/amd64 archipelago-backend)
|
||||
$CONTAINER_CMD cp "$BACKEND_CONTAINER:/build/core/target/release/archipelago" "$ARCH_DIR/bin/" && \
|
||||
echo " ✅ Backend binary built ($(du -h "$ARCH_DIR/bin/archipelago" | cut -f1))"
|
||||
$CONTAINER_CMD rm "$BACKEND_CONTAINER"
|
||||
else
|
||||
echo " ❌ Backend build failed and server capture failed"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Build and copy web UI
|
||||
echo " Building web UI..."
|
||||
cd "$SCRIPT_DIR/../neode-ui"
|
||||
if npm run build 2>&1 | tail -5; then
|
||||
if [ -d "$SCRIPT_DIR/../web/dist/neode-ui" ]; then
|
||||
echo " Including web UI from web/dist/neode-ui..."
|
||||
cp -r "$SCRIPT_DIR/../web/dist/neode-ui" "$ARCH_DIR/web-ui"
|
||||
echo " ✅ Web UI included ($(du -sh "$ARCH_DIR/web-ui" | cut -f1))"
|
||||
fi
|
||||
# Capture web UI from live server
|
||||
if [ "$BUILD_FROM_SOURCE" = "1" ]; then
|
||||
echo " Building web UI from source..."
|
||||
else
|
||||
echo " ⚠️ Web UI build failed"
|
||||
# Try to use existing build
|
||||
if [ -d "$SCRIPT_DIR/../web/dist/neode-ui" ]; then
|
||||
echo " Using existing web UI build..."
|
||||
cp -r "$SCRIPT_DIR/../web/dist/neode-ui" "$ARCH_DIR/web-ui"
|
||||
elif [ -d "$SCRIPT_DIR/../neode-ui/dist" ]; then
|
||||
echo " Using neode-ui/dist..."
|
||||
cp -r "$SCRIPT_DIR/../neode-ui/dist" "$ARCH_DIR/web-ui"
|
||||
echo " Capturing web UI from live server..."
|
||||
fi
|
||||
mkdir -p "$ARCH_DIR/web-ui"
|
||||
|
||||
# Try to get from live server first (unless BUILD_FROM_SOURCE=1)
|
||||
WEBUI_CAPTURED=0
|
||||
if [ "$BUILD_FROM_SOURCE" != "1" ]; then
|
||||
# Check if we're running on the server itself
|
||||
if [ "$DEV_SERVER" = "localhost" ] || [ "$DEV_SERVER" = "127.0.0.1" ]; then
|
||||
# Direct copy from local filesystem
|
||||
if [ -d "/opt/archipelago/web-ui" ] && [ "$(ls -A /opt/archipelago/web-ui 2>/dev/null)" ]; then
|
||||
cp -r /opt/archipelago/web-ui/* "$ARCH_DIR/web-ui/"
|
||||
echo " ✅ Web UI captured from local system ($(du -sh "$ARCH_DIR/web-ui" | cut -f1))"
|
||||
WEBUI_CAPTURED=1
|
||||
fi
|
||||
else
|
||||
echo " ❌ No web UI available"
|
||||
# Remote copy via rsync
|
||||
if rsync -az "$DEV_SERVER:/opt/archipelago/web-ui/" "$ARCH_DIR/web-ui/" 2>/dev/null && [ "$(ls -A "$ARCH_DIR/web-ui")" ]; then
|
||||
echo " ✅ Web UI captured from remote server ($(du -sh "$ARCH_DIR/web-ui" | cut -f1))"
|
||||
WEBUI_CAPTURED=1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
cd "$SCRIPT_DIR"
|
||||
|
||||
if [ "$WEBUI_CAPTURED" = "0" ]; then
|
||||
if [ "$BUILD_FROM_SOURCE" != "1" ]; then
|
||||
echo " ⚠️ Could not capture from live server, building from source..."
|
||||
fi
|
||||
cd "$SCRIPT_DIR/../neode-ui"
|
||||
if npm run build 2>&1 | tail -5; then
|
||||
if [ -d "$SCRIPT_DIR/../web/dist/neode-ui" ]; then
|
||||
echo " Including web UI from web/dist/neode-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))"
|
||||
fi
|
||||
else
|
||||
echo " ⚠️ Web UI build failed"
|
||||
# Try to use existing build
|
||||
if [ -d "$SCRIPT_DIR/../web/dist/neode-ui" ]; then
|
||||
echo " Using existing web UI build..."
|
||||
cp -r "$SCRIPT_DIR/../web/dist/neode-ui/"* "$ARCH_DIR/web-ui/"
|
||||
elif [ -d "$SCRIPT_DIR/../neode-ui/dist" ]; then
|
||||
echo " Using neode-ui/dist..."
|
||||
cp -r "$SCRIPT_DIR/../neode-ui/dist/"* "$ARCH_DIR/web-ui/"
|
||||
else
|
||||
echo " ❌ No web UI available"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
cd "$SCRIPT_DIR"
|
||||
fi
|
||||
|
||||
# Copy app manifests
|
||||
if [ -d "$SCRIPT_DIR/../apps" ]; then
|
||||
@@ -792,8 +872,8 @@ cat > "$OVERLAY_DIR/etc/profile.d/z99-archipelago-installer.sh" <<'AUTOSTART'
|
||||
#!/bin/bash
|
||||
# Auto-start Archipelago installer on login
|
||||
|
||||
# Only run once, only in interactive terminal, only for regular users
|
||||
if [ -n "$INSTALLER_STARTED" ] || [ ! -t 0 ]; then
|
||||
# Only run once
|
||||
if [ -n "$INSTALLER_STARTED" ]; then
|
||||
return 0 2>/dev/null || exit 0
|
||||
fi
|
||||
export INSTALLER_STARTED=1
|
||||
|
||||
Reference in New Issue
Block a user