Files
proxmox/scripts/archive/consolidated/verify/validate-configuration.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

123 lines
3.7 KiB
Bash
Executable File

#!/usr/bin/env bash
# Comprehensive Configuration Validation Script
# Validates all configurations against master reference documents
set -euo pipefail
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
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
CYAN='\033[0;36m'
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"; }
log_section() { echo -e "\n${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"; echo -e "${CYAN}$1${NC}"; echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}\n"; }
ERRORS=0
WARNINGS=0
log_section "Configuration Validation"
# 1. Validate VMID conflicts
log_info "1. Checking VMID conflicts..."
if bash "${SCRIPT_DIR}/check-vmid-conflicts.sh" 2>&1 | grep -q "No conflicts\|All verified"; then
log_success "VMID conflicts: None"
else
log_error "VMID conflicts detected"
((ERRORS++))
fi
# 2. Validate IP conflicts
log_info "2. Checking IP conflicts..."
if bash "${SCRIPT_DIR}/check-ip-conflicts.sh" 2>&1 | grep -q "No conflicts\|All verified"; then
log_success "IP conflicts: None"
else
log_error "IP conflicts detected"
((ERRORS++))
fi
# 3. Validate master documents exist
log_info "3. Validating master documents..."
MASTER_DOCS=(
"docs/11-references/MASTER_VMID_INVENTORY.md"
"docs/11-references/IP_ADDRESS_REGISTRY.md"
"docs/11-references/NETWORK_CONFIGURATION_MASTER.md"
"docs/11-references/SUBMODULE_RELATIONSHIP_MAP.md"
"docs/11-references/CONFIGURATION_FILE_INVENTORY.md"
"docs/11-references/PLACEHOLDER_IMPLEMENTATIONS.md"
)
for doc in "${MASTER_DOCS[@]}"; do
if [ -f "${PROJECT_ROOT}/${doc}" ]; then
log_success "Master document exists: ${doc}"
else
log_error "Master document missing: ${doc}"
((ERRORS++))
fi
done
# 4. Validate IP configuration file
log_info "4. Validating IP configuration file..."
if [ -f "${PROJECT_ROOT}/config/ip-addresses.conf" ]; then
log_success "IP configuration file exists"
# Check for required variables
REQUIRED_VARS=(
"PROXMOX_HOST_ML110"
"PROXMOX_HOST_R630_01"
"PROXMOX_HOST_R630_02"
"RPC_CORE_1"
"IP_BLOCKSCOUT"
)
for var in "${REQUIRED_VARS[@]}"; do
if grep -q "^${var}=" "${PROJECT_ROOT}/config/ip-addresses.conf"; then
log_success "Required variable defined: ${var}"
else
log_warn "Required variable missing: ${var}"
((WARNINGS++))
fi
done
else
log_error "IP configuration file missing"
((ERRORS++))
fi
# 5. Validate .gitmodules
log_info "5. Validating .gitmodules..."
if [ -f "${PROJECT_ROOT}/.gitmodules" ]; then
log_success ".gitmodules exists"
# Check for local paths
if grep -q "url = \./" "${PROJECT_ROOT}/.gitmodules"; then
log_warn "Local paths found in .gitmodules (explorer-monorepo)"
((WARNINGS++))
fi
else
log_error ".gitmodules missing"
((ERRORS++))
fi
# Summary
log_section "Validation Summary"
if [ $ERRORS -eq 0 ] && [ $WARNINGS -eq 0 ]; then
log_success "All validations passed!"
exit 0
elif [ $ERRORS -eq 0 ]; then
log_warn "Validations passed with $WARNINGS warnings"
exit 0
else
log_error "Validation failed with $ERRORS errors and $WARNINGS warnings"
exit 1
fi