Files
proxmox/scripts/archive/consolidated/fix/fix-ssl-certificate-all-hosts.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

106 lines
3.2 KiB
Bash
Executable File

#!/bin/bash
# Fix SSL Certificate Error 596 on All Proxmox Host Nodes
# This runs the fix on each Proxmox HOST (not containers)
# Usage: ./scripts/fix-ssl-certificate-all-hosts.sh
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
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
log_info() { echo -e "${BLUE}[INFO]${NC} $1"; }
log_success() { echo -e "${GREEN}[✓]${NC} $1"; }
log_warn() { echo -e "${YELLOW}[⚠]${NC} $1"; }
log_error() { echo -e "${RED}[✗]${NC} $1"; }
# Proxmox cluster nodes (HOST nodes, not containers)
declare -A HOSTS
HOSTS[ml110]="${PROXMOX_HOST_ML110}"
HOSTS[r630-01]="${PROXMOX_HOST_R630_01}"
HOSTS[r630-02]="${PROXMOX_HOST_R630_02}"
HOSTS[r630-03]="${IP_SERVICE_13:-${IP_SERVICE_13:-${IP_SERVICE_13:-${IP_SERVICE_13:-192.168.11.13}}}}"
HOSTS[r630-04]="${IP_DEVICE_14:-${IP_DEVICE_14:-${IP_DEVICE_14:-${IP_DEVICE_14:-192.168.11.14}}}}"
fix_host() {
local host_ip="$1"
local host_name="${2:-$host_ip}"
log_info "=== Fixing SSL certificates on ${host_name} (${host_ip}) ==="
echo ""
# Test connectivity
if ! ping -c 2 -W 2 "$host_ip" >/dev/null 2>&1; then
log_error "Host ${host_ip} is NOT reachable"
return 1
fi
log_info "Running SSL certificate fix on ${host_name}..."
echo ""
# Execute commands on the Proxmox HOST (not in a container)
ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 root@"$host_ip" bash <<'ENDSSH'
set -e
echo "Step 1: Regenerating SSL certificates..."
pvecm updatecerts -f
echo "✓ Certificates regenerated"
echo ""
echo "Step 2: Restarting Proxmox services..."
systemctl restart pveproxy pvedaemon
sleep 2
echo "✓ Services restarted"
echo ""
echo "Step 3: Verifying services..."
if systemctl is-active --quiet pveproxy && systemctl is-active --quiet pvedaemon; then
echo "✓ pveproxy: active"
echo "✓ pvedaemon: active"
else
echo "⚠ Some services may not be running properly"
systemctl status pveproxy --no-pager -l | head -3 || true
systemctl status pvedaemon --no-pager -l | head -3 || true
fi
echo ""
ENDSSH
if [ $? -eq 0 ]; then
log_success "SSL certificate fix completed for ${host_name}"
else
log_error "SSL certificate fix failed for ${host_name}"
return 1
fi
echo "----------------------------------------"
echo ""
}
# Main execution
log_info "Fixing SSL certificates on all Proxmox host nodes..."
echo ""
for host_name in "${!HOSTS[@]}"; do
host_ip="${HOSTS[$host_name]}"
fix_host "$host_ip" "$host_name" || log_warn "Failed to fix ${host_name}, continuing..."
done
log_success "All fix attempts complete!"
echo ""
log_info "Next steps:"
log_info " 1. Clear browser cache and cookies"
log_info " 2. Access Proxmox UI: https://<host-ip>:8006"
log_info " 3. Accept certificate warning if prompted"
echo ""