Some checks failed
API CI / API Lint (push) Successful in 47s
API CI / API Type Check (push) Failing after 47s
API CI / API Test (push) Successful in 1m0s
API CI / API Build (push) Failing after 50s
API CI / Build Docker Image (push) Has been skipped
Build Crossplane Provider / build (push) Failing after 5m51s
CD Pipeline / Deploy to Staging (push) Failing after 29s
CI Pipeline / Lint and Type Check (push) Failing after 36s
CI Pipeline / Build (push) Has been skipped
CI Pipeline / Test Backend (push) Failing after 1m33s
CI Pipeline / Test Frontend (push) Failing after 30s
CI Pipeline / Security Scan (push) Failing after 1m16s
Crossplane Provider CI / Go Test (push) Failing after 3m23s
Crossplane Provider CI / Go Lint (push) Failing after 7m27s
Crossplane Provider CI / Go Build (push) Failing after 3m27s
Deploy to Staging / Deploy to Staging (push) Failing after 30s
Portal CI / Portal Lint (push) Failing after 21s
Portal CI / Portal Type Check (push) Failing after 21s
Portal CI / Portal Test (push) Failing after 21s
Portal CI / Portal Build (push) Failing after 22s
Test Suite / frontend-tests (push) Failing after 30s
Test Suite / api-tests (push) Failing after 49s
Test Suite / blockchain-tests (push) Failing after 30s
Type Check / type-check (map[directory:. name:root]) (push) Failing after 23s
Type Check / type-check (map[directory:api name:api]) (push) Failing after 21s
Type Check / type-check (map[directory:portal name:portal]) (push) Failing after 19s
Validate Configuration Files / validate (push) Failing after 1m52s
CD Pipeline / Deploy to Production (push) Has been skipped
Co-authored-by: Cursor <cursoragent@cursor.com>
147 lines
4.3 KiB
Bash
Executable File
147 lines
4.3 KiB
Bash
Executable File
#!/bin/bash
|
|
# SSH Commands for Proxmox Nodes
|
|
# Provides easy access to both Proxmox machines
|
|
|
|
set -e
|
|
|
|
# Load password from .env file
|
|
# Get the directory where this script is located
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
# Get the project root (one level up from scripts directory)
|
|
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
# Locate .env file in project root
|
|
ENV_FILE="$PROJECT_ROOT/.env"
|
|
|
|
if [[ -f "$ENV_FILE" ]]; then
|
|
# Source the password from .env (lines 45-46)
|
|
export PROXMOX_PASSWORD=$(sed -n '45,46p' "$ENV_FILE" | grep -E "PROXMOX_ROOT_PASS|^[^#]" | head -1 | cut -d'=' -f2 | tr -d '"' | tr -d "'")
|
|
else
|
|
echo "Warning: .env file not found. Password will need to be entered manually."
|
|
PROXMOX_PASSWORD=""
|
|
fi
|
|
|
|
# Colors
|
|
GREEN='\033[0;32m'
|
|
BLUE='\033[0;34m'
|
|
YELLOW='\033[1;33m'
|
|
NC='\033[0m'
|
|
|
|
# Configuration
|
|
ML110_01_IP="192.168.11.10"
|
|
R630_01_IP="192.168.11.11"
|
|
ML110_01_HOSTNAME="ml110-01"
|
|
R630_01_HOSTNAME="r630-01"
|
|
DEFAULT_USER="root"
|
|
|
|
echo "=========================================="
|
|
echo "Proxmox Node SSH Access"
|
|
echo "=========================================="
|
|
echo ""
|
|
|
|
# Function to display SSH command
|
|
show_ssh_command() {
|
|
local node_name=$1
|
|
local ip=$2
|
|
local hostname=$3
|
|
local user=$4
|
|
|
|
echo -e "${BLUE}${node_name}${NC}"
|
|
echo " IP Address: $ip"
|
|
echo " Hostname: $hostname"
|
|
echo " User: $user"
|
|
echo ""
|
|
echo " SSH Command:"
|
|
echo -e " ${GREEN}ssh ${user}@${ip}${NC}"
|
|
echo ""
|
|
if [[ -n "$hostname" ]]; then
|
|
echo " Or via hostname (if DNS configured):"
|
|
echo -e " ${GREEN}ssh ${user}@${hostname}${NC}"
|
|
fi
|
|
echo ""
|
|
}
|
|
|
|
# Display commands for both nodes
|
|
show_ssh_command "Site-1 (ML110-01)" "$ML110_01_IP" "$ML110_01_HOSTNAME" "$DEFAULT_USER"
|
|
show_ssh_command "Site-2 (R630-01)" "$R630_01_IP" "$R630_01_HOSTNAME" "$DEFAULT_USER"
|
|
|
|
echo "=========================================="
|
|
echo "Quick Access Commands"
|
|
echo "=========================================="
|
|
echo ""
|
|
echo "SSH to ML110-01:"
|
|
if command -v sshpass &> /dev/null && [[ -n "$PROXMOX_PASSWORD" ]]; then
|
|
echo -e " ${GREEN}sshpass -p '***' ssh root@${ML110_01_IP}${NC}"
|
|
echo " (Password loaded from .env)"
|
|
else
|
|
echo -e " ${GREEN}ssh root@${ML110_01_IP}${NC}"
|
|
fi
|
|
echo ""
|
|
echo "SSH to R630-01:"
|
|
if command -v sshpass &> /dev/null && [[ -n "$PROXMOX_PASSWORD" ]]; then
|
|
echo -e " ${GREEN}sshpass -p '***' ssh root@${R630_01_IP}${NC}"
|
|
echo " (Password loaded from .env)"
|
|
else
|
|
echo -e " ${GREEN}ssh root@${R630_01_IP}${NC}"
|
|
fi
|
|
echo ""
|
|
|
|
echo "=========================================="
|
|
echo "Verification Commands"
|
|
echo "=========================================="
|
|
echo ""
|
|
echo "Test connectivity to ML110-01:"
|
|
echo -e " ${GREEN}ping -c 3 ${ML110_01_IP}${NC}"
|
|
echo ""
|
|
echo "Test connectivity to R630-01:"
|
|
echo -e " ${GREEN}ping -c 3 ${R630_01_IP}${NC}"
|
|
echo ""
|
|
echo "Test SSH to ML110-01:"
|
|
if command -v sshpass &> /dev/null && [[ -n "$PROXMOX_PASSWORD" ]]; then
|
|
echo -e " ${GREEN}sshpass -p '***' ssh -o ConnectTimeout=5 root@${ML110_01_IP} 'hostname'${NC}"
|
|
else
|
|
echo -e " ${GREEN}ssh -o ConnectTimeout=5 root@${ML110_01_IP} 'hostname'${NC}"
|
|
fi
|
|
echo ""
|
|
echo "Test SSH to R630-01:"
|
|
if command -v sshpass &> /dev/null && [[ -n "$PROXMOX_PASSWORD" ]]; then
|
|
echo -e " ${GREEN}sshpass -p '***' ssh -o ConnectTimeout=5 root@${R630_01_IP} 'hostname'${NC}"
|
|
else
|
|
echo -e " ${GREEN}ssh -o ConnectTimeout=5 root@${R630_01_IP} 'hostname'${NC}"
|
|
fi
|
|
echo ""
|
|
|
|
echo "=========================================="
|
|
echo "Proxmox API Verification"
|
|
echo "=========================================="
|
|
echo ""
|
|
echo "Check Proxmox API on ML110-01:"
|
|
echo -e " ${GREEN}curl -k https://${ML110_01_IP}:8006/api2/json/version${NC}"
|
|
echo ""
|
|
echo "Check Proxmox API on R630-01:"
|
|
echo -e " ${GREEN}curl -k https://${R630_01_IP}:8006/api2/json/version${NC}"
|
|
echo ""
|
|
|
|
echo "=========================================="
|
|
echo "Useful Commands After SSH"
|
|
echo "=========================================="
|
|
echo ""
|
|
echo "Check Proxmox status:"
|
|
echo " pveversion"
|
|
echo " systemctl status pve-cluster"
|
|
echo ""
|
|
echo "List VMs:"
|
|
echo " qm list"
|
|
echo ""
|
|
echo "Check storage:"
|
|
echo " pvesm status"
|
|
echo ""
|
|
echo "Check network:"
|
|
echo " ip addr show"
|
|
echo " cat /etc/network/interfaces"
|
|
echo ""
|
|
echo "Check Ceph (if configured):"
|
|
echo " ceph status"
|
|
echo " ceph df"
|
|
echo ""
|
|
|