Files
proxmox/scripts/nginx-proxy-manager/post-install-migration.sh
defiQUG fbda1b4beb
Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
docs: Ledger Live integration, contract deploy learnings, NEXT_STEPS updates
- ADD_CHAIN138_TO_LEDGER_LIVE: Ledger form done; public code review repo bis-innovations/LedgerLive; init/push commands
- CONTRACT_DEPLOYMENT_RUNBOOK: Chain 138 gas price 1 gwei, 36-addr check, TransactionMirror workaround
- CONTRACT_*: AddressMapper, MirrorManager deployed 2026-02-12; 36-address on-chain check
- NEXT_STEPS_FOR_YOU: Ledger done; steps completable now (no LAN); run-completable-tasks-from-anywhere
- MASTER_INDEX, OPERATOR_OPTIONAL, SMART_CONTRACTS_INVENTORY_SIMPLE: updates
- LEDGER_BLOCKCHAIN_INTEGRATION_COMPLETE: bis-innovations/LedgerLive reference

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 15:46:57 -08:00

77 lines
2.4 KiB
Bash
Executable File

#!/bin/bash
set -euo pipefail
# Load IP configuration
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
source "${PROJECT_ROOT}/config/ip-addresses.conf" 2>/dev/null || true
# Post-installation migration script
# Run this AFTER NPMplus is installed
set -e
PROXMOX_HOST="${1:-192.168.11.11}"
NEW_CONTAINER_ID="${2}"
CONTAINER_IP="${3}"
if [ -z "$NEW_CONTAINER_ID" ] || [ -z "$CONTAINER_IP" ]; then
echo "Usage: $0 [PROXMOX_HOST] [CONTAINER_ID] [CONTAINER_IP]"
echo ""
echo "Example:"
echo " $0 ${PROXMOX_HOST_R630_01:-192.168.11.11} 106 192.168.11.27"
exit 1
fi
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "🔄 Post-Installation Migration"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
# Get admin password
echo "🔑 Retrieving admin password..."
ADMIN_PASSWORD=$(ssh root@"$PROXMOX_HOST" "pct exec $NEW_CONTAINER_ID -- bash -c '
if [ -f /opt/.npm_pwd ]; then
grep -i password /opt/.npm_pwd | cut -d: -f2 | tr -d \" \"
else
docker logs npmplus 2>/dev/null | grep -i \"Creating a new user\" | tail -1 | grep -oP \"password: \K[^\s]+\" || echo \"\"
fi
'" 2>/dev/null || echo "")
if [ -z "$ADMIN_PASSWORD" ]; then
echo " ⚠️ Could not retrieve password automatically"
read -sp " Enter NPMplus admin password: " ADMIN_PASSWORD
echo ""
else
echo " ✅ Admin password retrieved"
fi
# Wait for NPMplus to be ready
echo ""
echo "⏳ Waiting for NPMplus to be ready..."
for i in {1..30}; do
if ssh root@"$PROXMOX_HOST" "pct exec $NEW_CONTAINER_ID -- docker ps --filter 'name=npmplus' --format '{{.Status}}' 2>/dev/null" | grep -q "Up"; then
echo " ✅ NPMplus is running"
break
fi
echo " ⏳ Waiting... ($i/30)"
sleep 2
done
# Migrate configurations
echo ""
echo "🚀 Migrating configurations..."
echo "$ADMIN_PASSWORD" | bash scripts/nginx-proxy-manager/migrate-configs-to-npmplus.sh \
"$PROXMOX_HOST" \
"$NEW_CONTAINER_ID" \
"https://$CONTAINER_IP:81"
echo ""
echo "✅ Migration complete!"
echo ""
echo "📋 Next: Update UDM Pro port forwarding:"
echo " HTTP: 76.53.10.36:80 → $CONTAINER_IP:80"
echo " HTTPS: 76.53.10.36:443 → $CONTAINER_IP:443"
echo ""