Enhance development workflow and deployment practices for Archipelago

- Updated the Development-Workflow documentation to clarify deployment strategy, emphasizing direct deployment to the live system for testing.
- Added detailed instructions for the deployment command, including syncing code, building frontend and backend, and restarting services.
- Improved SSH key management section to assist with authentication issues.
- Expanded the testing workflow to include steps for checking logs and syncing changes back to the ISO build.
- Updated the ISO build integration section to ensure system-level changes are captured for future builds.
- Refactored various sections for clarity and completeness, including deployment paths and system configuration files.
This commit is contained in:
Dorian
2026-02-01 13:24:03 +00:00
parent 00d1af12f0
commit 34fc06726e
28 changed files with 1248 additions and 285 deletions
+24
View File
@@ -0,0 +1,24 @@
#!/bin/bash
# Quick script to check what's deployed on the target
echo "Checking deployed files on target..."
echo ""
echo "1. Web UI files:"
ssh archipelago@192.168.1.228 "ls -lh /opt/archipelago/web-ui/ | head -10"
echo ""
echo "2. Backend binary:"
ssh archipelago@192.168.1.228 "ls -lh /usr/local/bin/archipelago"
echo ""
echo "3. Backend service status:"
ssh archipelago@192.168.1.228 "sudo systemctl status archipelago --no-pager | head -15"
echo ""
echo "4. Nginx status:"
ssh archipelago@192.168.1.228 "sudo systemctl status nginx --no-pager | head -10"
echo ""
echo "5. Check one of the JS files for BUNDLED_APPS:"
ssh archipelago@192.168.1.228 "grep -l 'BUNDLED_APPS' /opt/archipelago/web-ui/assets/*.js | head -1"
+30
View File
@@ -0,0 +1,30 @@
#!/bin/bash
# Check what's actually in the deployed frontend
TARGET_HOST="${ARCHIPELAGO_TARGET:-archipelago@192.168.1.228}"
echo "Checking deployed frontend content..."
echo ""
echo "1. Search for 'bundledApps' variable in JS:"
ssh "$TARGET_HOST" "grep -o 'bundledApps' /opt/archipelago/web-ui/assets/*.js | wc -l"
echo ""
echo "2. Search for 'Bitcoin Knots' string:"
ssh "$TARGET_HOST" "grep -o 'Bitcoin Knots' /opt/archipelago/web-ui/assets/*.js | head -1"
echo ""
echo "3. Search for the v-for loop pattern:"
ssh "$TARGET_HOST" "grep -o 'v-for.*bundled' /opt/archipelago/web-ui/assets/*.js | head -1"
echo ""
echo "4. List all JS assets (to see if they updated):"
ssh "$TARGET_HOST" "ls -lh /opt/archipelago/web-ui/assets/*.js | head -10"
echo ""
echo "5. Check index.html timestamp:"
ssh "$TARGET_HOST" "stat /opt/archipelago/web-ui/index.html | grep Modify"
echo ""
echo "6. Try accessing the API from target:"
ssh "$TARGET_HOST" 'curl -s http://localhost:80/ | head -20'
+14 -6
View File
@@ -60,9 +60,9 @@ echo " Building frontend..."
ssh "$TARGET_HOST" "cd $TARGET_DIR/neode-ui && npm install --silent && npm run build" 2>&1 | sed 's/^/ /'
# Backend (if Rust is installed)
if ssh "$TARGET_HOST" "command -v cargo" >/dev/null 2>&1; then
if ssh "$TARGET_HOST" "source ~/.cargo/env 2>/dev/null && command -v cargo" >/dev/null 2>&1; then
echo " Building backend..."
ssh "$TARGET_HOST" "cd $TARGET_DIR/core && cargo build --release 2>&1" | tail -5 | sed 's/^/ /'
ssh "$TARGET_HOST" "source ~/.cargo/env && cd $TARGET_DIR/core && cargo build --release 2>&1" | tail -10 | sed 's/^/ /'
else
echo " ⚠️ Rust not installed on target, skipping backend build"
fi
@@ -71,19 +71,27 @@ if [ "$LIVE" = true ]; then
echo ""
echo "🚀 Deploying to live system..."
# Deploy backend
ssh "$TARGET_HOST" "sudo cp $TARGET_DIR/core/target/release/archipelago /usr/local/bin/ 2>/dev/null || true"
# Deploy backend (check if binary exists)
if ssh "$TARGET_HOST" "[ -f $TARGET_DIR/core/target/release/archipelago ]" 2>/dev/null; then
echo " Deploying backend binary..."
# Stop service first so we can overwrite the binary
ssh "$TARGET_HOST" "sudo systemctl stop archipelago"
ssh "$TARGET_HOST" "sudo cp $TARGET_DIR/core/target/release/archipelago /usr/local/bin/"
fi
# Deploy frontend
echo " Deploying frontend..."
ssh "$TARGET_HOST" "sudo rm -rf /opt/archipelago/web-ui/*"
ssh "$TARGET_HOST" "sudo cp -r $TARGET_DIR/neode-ui/dist/* /opt/archipelago/web-ui/"
ssh "$TARGET_HOST" "sudo cp -r $TARGET_DIR/web/dist/neode-ui/* /opt/archipelago/web-ui/"
ssh "$TARGET_HOST" "sudo chown -R 1000:1000 /opt/archipelago/web-ui"
# Restart services
ssh "$TARGET_HOST" "sudo systemctl restart archipelago nginx"
echo " Restarting services..."
ssh "$TARGET_HOST" "sudo systemctl start archipelago && sudo systemctl restart nginx"
echo ""
echo "✅ Deployed to live system!"
echo " Backend: $(ssh "$TARGET_HOST" 'sudo systemctl is-active archipelago')"
echo " Web UI: http://$(echo $TARGET_HOST | cut -d@ -f2)"
else
echo ""
Regular → Executable
View File
+24
View File
@@ -0,0 +1,24 @@
#!/bin/bash
# Test if the new backend binary has the bundled-app methods
TARGET_HOST="${ARCHIPELAGO_TARGET:-archipelago@192.168.1.228}"
echo "Testing backend RPC methods..."
echo ""
echo "1. Test container-list (should work):"
ssh "$TARGET_HOST" 'curl -s http://localhost:5678/rpc/v1 -X POST -H "Content-Type: application/json" -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"container-list\",\"params\":{}}"'
echo ""
echo ""
echo "2. Test bundled-app-start (should not error with 'method not found'):"
ssh "$TARGET_HOST" 'curl -s http://localhost:5678/rpc/v1 -X POST -H "Content-Type: application/json" -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"bundled-app-start\",\"params\":{\"app_id\":\"test\",\"image\":\"test\",\"ports\":[],\"volumes\":[]}}"'
echo ""
echo ""
echo "3. Check deployed frontend JS for bundled apps:"
ssh "$TARGET_HOST" "grep -o 'bitcoin-knots\\|bitcoinknots' /opt/archipelago/web-ui/assets/*.js 2>/dev/null | head -3"
echo ""
echo "4. Service Worker file (should exist):"
ssh "$TARGET_HOST" "ls -lh /opt/archipelago/web-ui/sw.js"
+30
View File
@@ -0,0 +1,30 @@
#!/bin/bash
# Verify the deployment is working correctly
TARGET_HOST="${ARCHIPELAGO_TARGET:-archipelago@192.168.1.228}"
echo "Checking deployment status..."
echo ""
echo "1. Backend binary timestamp:"
ssh "$TARGET_HOST" "ls -lh /usr/local/bin/archipelago | awk '{print \$6, \$7, \$8, \$9}'"
echo ""
echo "2. Backend service status:"
ssh "$TARGET_HOST" "sudo systemctl status archipelago --no-pager | head -20"
echo ""
echo "3. Test RPC method 'container-list':"
ssh "$TARGET_HOST" 'curl -s http://localhost:5678/rpc/v1 -X POST -H "Content-Type: application/json" -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"container-list\",\"params\":{}}" | jq .'
echo ""
echo "4. Check if bundled-app-start method exists (should not error):"
ssh "$TARGET_HOST" 'curl -s http://localhost:5678/rpc/v1 -X POST -H "Content-Type: application/json" -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"bundled-app-start\",\"params\":{\"app_id\":\"bitcoin-knots\",\"image\":\"test\",\"ports\":[],\"volumes\":[]}}" | jq .'
echo ""
echo "5. Frontend files timestamp:"
ssh "$TARGET_HOST" "ls -lh /opt/archipelago/web-ui/index.html | awk '{print \$6, \$7, \$8, \$9}'"
echo ""
echo "6. Check for BUNDLED_APPS in frontend JS:"
ssh "$TARGET_HOST" "grep -o 'bitcoin-knots' /opt/archipelago/web-ui/assets/*.js | head -1"