Files
proxmox/scripts/archive/consolidated/fix/fix-ssl-complete.sh.bak
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

80 lines
3.0 KiB
Bash
Executable File

#!/bin/bash
set -euo pipefail
# Complete SSL Configuration Fix Script
# This script resets NPM password and configures all SSL certificates
set -e
PROXMOX_HOST="192.168.11.11"
CONTAINER_ID=105
NPM_URL="http://192.168.11.26:81"
EMAIL="nsatoshi2007@hotmail.com"
# PASSWORD should come from environment variable
PASSWORD="${NPM_PASSWORD:-${1:-}}"
if [ -z "$PASSWORD" ]; then
echo "❌ NPM_PASSWORD environment variable is required"
echo " Set it in ~/.env file: NPM_PASSWORD=your-password"
exit 1
fi
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "🔒 Complete SSL Configuration Fix"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
# Step 1: Reset password
echo "📋 Step 1: Resetting NPM password..."
bash scripts/nginx-proxy-manager/reset-npm-password.sh "$PASSWORD" "$EMAIL" || {
echo "⚠️ Password reset failed, continuing anyway..."
}
# Step 2: Wait a moment for password to take effect
echo ""
echo "⏳ Waiting 3 seconds for password to sync..."
sleep 3
# Step 3: Test authentication
echo ""
echo "📋 Step 2: Testing authentication..."
TOKEN_RESPONSE=$(curl -s -X POST "$NPM_URL/api/tokens" \
-H "Content-Type: application/json" \
-d "{\"identity\":\"$EMAIL\",\"secret\":\"$PASSWORD\"}" 2>&1)
TOKEN=$(echo "$TOKEN_RESPONSE" | jq -r '.token // empty' 2>/dev/null || echo "")
if [ -z "$TOKEN" ] || [ "$TOKEN" = "null" ]; then
ERROR_MSG=$(echo "$TOKEN_RESPONSE" | jq -r '.error.message // "Unknown error"' 2>/dev/null || echo "$TOKEN_RESPONSE")
echo "❌ Authentication failed: $ERROR_MSG"
echo ""
echo "💡 Manual steps required:"
echo " 1. Access NPM UI: $NPM_URL"
echo " 2. Try logging in with: $EMAIL / $PASSWORD"
echo " 3. If that fails, use 'Forgot Password' feature"
echo " 4. Then run: node scripts/nginx-proxy-manager/configure-ssl-api.js"
exit 1
fi
echo "✅ Authentication successful"
echo ""
# Step 4: Configure SSL using API script
echo "📋 Step 3: Configuring SSL certificates..."
cd /home/intlc/projects/proxmox
export NPM_URL="$NPM_URL"
export NPM_EMAIL="$EMAIL"
export NPM_PASSWORD="$PASSWORD"
node scripts/nginx-proxy-manager/configure-ssl-api.js
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "✅ SSL Configuration Complete"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
echo "📋 Next steps:"
echo " 1. Wait 1-2 minutes for Let's Encrypt certificates to be issued"
echo " 2. Test HTTPS: curl -I https://sankofa.nexus"
echo " 3. Verify all domains: bash scripts/check-east-west-ssl-status.sh"
echo ""