Files
proxmox/scripts/nginx-proxy-manager/run-update-npmplus-alltra-hybx-via-ssh.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

43 lines
2.7 KiB
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# Run update-npmplus-alltra-hybx-proxy-hosts.sh ON the Proxmox host (r630-01) via SSH.
# NPM password: from .env (NPM_PASSWORD) or via pct exec 10235 -- cat /opt/.npm_pwd. Run from repo root.
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
[ -f "$PROJECT_ROOT/config/ip-addresses.conf" ] && source "$PROJECT_ROOT/config/ip-addresses.conf" 2>/dev/null || true
[ -f "$PROJECT_ROOT/.env" ] && set +u && source "$PROJECT_ROOT/.env" 2>/dev/null || true && set -u
PROXMOX_HOST="${PROXMOX_HOST_R630_01:-${PROXMOX_R630_01:-192.168.11.11}}"
VMID=10235
REMOTE_DIR="/tmp/proxmox-npmplus-update-$$"
# Prefer third NPMplusspecific credentials (192.168.11.169), then fall back to primary NPMplus vars
NPM_PASSWORD_FOR_THIRD="${NPM_PASSWORD_ALLTRA_HYBX:-${NPM_PASSWORD:-}}"
NPM_EMAIL_FOR_REMOTE="${NPM_EMAIL_ALLTRA_HYBX:-${NPM_EMAIL:-admin@example.org}}"
if [ -z "$NPM_PASSWORD_FOR_THIRD" ]; then
echo "Getting NPM password from container $VMID via pct..."
NPM_PASSWORD_FOR_THIRD=$(ssh -n "root@$PROXMOX_HOST" "pct exec $VMID -- cat /opt/.npm_pwd 2>/dev/null" || true)
fi
if [ -z "$NPM_PASSWORD_FOR_THIRD" ]; then
echo "Set NPM_PASSWORD_ALLTRA_HYBX (or NPM_PASSWORD) in .env for third NPMplus (192.168.11.169:81), or ensure container $VMID has /opt/.npm_pwd."
exit 1
fi
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "Run NPMplus Alltra/HYBX update on Proxmox via SSH + pct"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "Host: $PROXMOX_HOST (r630-01) VMID: $VMID (NPMplus Alltra/HYBX)"
echo ""
# Copy minimal tree to remote so script can run with correct PROJECT_ROOT
ssh "root@$PROXMOX_HOST" "mkdir -p $REMOTE_DIR/config $REMOTE_DIR/scripts/nginx-proxy-manager"
scp -q "$PROJECT_ROOT/config/ip-addresses.conf" "root@$PROXMOX_HOST:$REMOTE_DIR/config/"
scp -q "$PROJECT_ROOT/scripts/nginx-proxy-manager/update-npmplus-alltra-hybx-proxy-hosts.sh" "root@$PROXMOX_HOST:$REMOTE_DIR/scripts/nginx-proxy-manager/"
# On Proxmox: run the update script with third NPMplus credentials (passed safely)
export NPM_PASSWORD_ESC NPM_EMAIL_ESC
NPM_PASSWORD_ESC=$(echo "$NPM_PASSWORD_FOR_THIRD" | sed "s/'/'\\\\''/g")
NPM_EMAIL_ESC=$(echo "${NPM_EMAIL_FOR_REMOTE:-}" | sed "s/'/'\\\\''/g")
ssh "root@$PROXMOX_HOST" "cd $REMOTE_DIR && NPM_PASSWORD='$NPM_PASSWORD_ESC' NPM_EMAIL='$NPM_EMAIL_ESC' bash ./scripts/nginx-proxy-manager/update-npmplus-alltra-hybx-proxy-hosts.sh; rc=\$?; rm -rf $REMOTE_DIR; exit \$rc"