Refactor configuration and scripts for Archipelago backend and ISO build

- Updated Cargo.toml to remove unnecessary package backtrace optimizations.
- Changed default bind host and port in config.rs for broader accessibility.
- Renamed state_manager to _state_manager in server.rs for clarity.
- Updated user field to _user in PodmanClient and DockerRuntime for consistency.
- Modified build-debian-iso.sh to enhance welcome message and backend startup instructions.
- Improved archipelago-menu.sh to display backend status and updated Web UI URL.
- Enhanced install-to-disk.sh for better package management and user creation during installation.
This commit is contained in:
Dorian
2026-02-01 05:42:05 +00:00
parent c9722a34f6
commit 66c823e2fd
13 changed files with 2019 additions and 76 deletions
+81 -7
View File
@@ -314,9 +314,9 @@ ln -sf ../archipelago-ssh.service "$ISO_CUSTOM/etc/systemd/system/multi-user.tar
# Create system-wide profile script that runs on ANY login
mkdir -p "$ISO_CUSTOM/etc/profile.d"
cat > "$ISO_CUSTOM/etc/profile.d/archipelago.sh" <<'PROFILE_EOF'
cat > "$ISO_CUSTOM/etc/profile.d/z99-archipelago.sh" <<'PROFILE_EOF'
#!/bin/bash
# Archipelago auto-start - runs on login
# Archipelago auto-start - runs on login (z99 = runs last)
# Only run once per session and only in interactive shells
if [ -n "$ARCHIPELAGO_STARTED" ] || [ ! -t 0 ]; then
@@ -333,23 +333,97 @@ for dev in /run/live/medium /lib/live/mount/medium /cdrom; do
fi
done
# Get IP address
IP=$(hostname -I 2>/dev/null | awk '{print $1}')
[ -z "$IP" ] && IP=$(ip -4 addr show | grep -oP '(?<=inet\s)\d+(\.\d+){3}' | grep -v '127.0.0.1' | head -1)
# Show welcome banner ALWAYS
clear
echo ""
echo " ╔═══════════════════════════════════════════════════════════╗"
echo " ║ ║"
echo " ║ 🏝️ ARCHIPELAGO BITCOIN NODE OS ║"
echo " ║ ║"
echo " ║ Your sovereign Bitcoin infrastructure ║"
echo " ║ ║"
echo " ╚═══════════════════════════════════════════════════════════╝"
echo ""
if [ -n "$IP" ]; then
echo " ┌─────────────────────────────────────────────────────────────┐"
echo " │ 🌐 Web UI: http://$IP:5678 │"
echo " │ 📡 SSH: ssh user@$IP (password: archipelago) │"
echo " └─────────────────────────────────────────────────────────────┘"
echo ""
fi
if [ -z "$BOOT_MEDIA" ]; then
echo " ⚠️ Boot media not found at /run/live/medium"
echo ""
echo " Manual commands:"
echo " archipelago - Start backend server"
echo " archipelago-menu - Open setup menu"
echo ""
return 0 2>/dev/null || exit 0
fi
# Install archipelago command if not present
echo " 📍 Boot media: $BOOT_MEDIA"
echo ""
# Install archipelago commands if not present
if [ ! -f /usr/local/bin/archipelago ] && [ -f "$BOOT_MEDIA/archipelago/bin/archipelago" ]; then
sudo cp "$BOOT_MEDIA/archipelago/bin/archipelago" /usr/local/bin/ 2>/dev/null
sudo chmod +x /usr/local/bin/archipelago 2>/dev/null
fi
# Run auto-start
if [ -f "$BOOT_MEDIA/archipelago/auto-start.sh" ]; then
source "$BOOT_MEDIA/archipelago/auto-start.sh"
if [ ! -f /usr/local/bin/archipelago-menu ] && [ -f "$BOOT_MEDIA/archipelago/bin/archipelago-menu" ]; then
sudo cp "$BOOT_MEDIA/archipelago/bin/archipelago-menu" /usr/local/bin/ 2>/dev/null
sudo chmod +x /usr/local/bin/archipelago-menu 2>/dev/null
fi
# Copy scripts to /opt
if [ ! -d /opt/archipelago/scripts ] && [ -d "$BOOT_MEDIA/archipelago/scripts" ]; then
sudo mkdir -p /opt/archipelago
sudo cp -r "$BOOT_MEDIA/archipelago/scripts" /opt/archipelago/ 2>/dev/null
sudo chmod +x /opt/archipelago/scripts/*.sh 2>/dev/null
fi
# Start web backend in background if available
if command -v archipelago >/dev/null 2>&1; then
if ! pgrep -f "archipelago" >/dev/null 2>&1; then
echo " 🚀 Starting Archipelago backend on port 5678..."
nohup archipelago >/tmp/archipelago.log 2>&1 &
sleep 2
else
echo " ✅ Archipelago backend already running"
fi
fi
echo ""
echo " Commands:"
echo " archipelago-menu - Open interactive setup menu"
echo " archipelago - Start/restart backend server"
echo ""
read -p " Press Enter to open the setup menu (or Ctrl+C to skip)... "
# Launch the menu
if [ -f /opt/archipelago/scripts/archipelago-menu.sh ]; then
exec bash /opt/archipelago/scripts/archipelago-menu.sh
elif [ -f "$BOOT_MEDIA/archipelago/scripts/archipelago-menu.sh" ]; then
exec bash "$BOOT_MEDIA/archipelago/scripts/archipelago-menu.sh"
fi
PROFILE_EOF
chmod +x "$ISO_CUSTOM/etc/profile.d/archipelago.sh"
chmod +x "$ISO_CUSTOM/etc/profile.d/z99-archipelago.sh"
# Also add to /etc/skel/.bashrc as fallback for new user sessions
mkdir -p "$ISO_CUSTOM/etc/skel"
cat >> "$ISO_CUSTOM/etc/skel/.bashrc" <<'BASHRC_EOF'
# Archipelago auto-start fallback
if [ -z "$ARCHIPELAGO_STARTED" ] && [ -t 0 ]; then
[ -f /etc/profile.d/z99-archipelago.sh ] && source /etc/profile.d/z99-archipelago.sh
fi
BASHRC_EOF
# Modify GRUB config for Archipelago branding
echo ""