diff --git a/cmd/net.sh b/cmd/net.sh index 7a142eb..0815aa8 100755 --- a/cmd/net.sh +++ b/cmd/net.sh @@ -22,8 +22,8 @@ check_target() { fi } -check_target "Proxmox Host (PVE)" "192.168.1.177" 8006 -check_target "Edge Router (VyOS)" "192.168.1.2" 22 +check_target "Proxmox" "192.168.1.177" 8006 +check_target "Vyos" "192.168.1.2" 22 check_target "Technitium DNS" "10.0.10.11" 53 check_target "OpenBao Vault" "10.0.10.12" 8200 check_target "Forgejo GitOps" "10.0.10.13" 3000 diff --git a/lib/net.sh b/lib/net.sh index ed48c42..ff8124b 100644 --- a/lib/net.sh +++ b/lib/net.sh @@ -6,22 +6,15 @@ ensure_prerequisites() { log_info "Восстанавливаем маршрут к ${NET_PREFIX} через VyOS (${VYOS_ROUTER_IP})..." sudo ip route replace "${NET_PREFIX}" via "${VYOS_ROUTER_IP}" 2>/dev/null || true fi - local target_helper="!${ZARYA_DIR}/bin/zarya git-credential" local current_helper current_helper=$(git config --global --get credential."https://${GIT_HOST}".helper 2>/dev/null || true) if [[ "${current_helper}" != "${target_helper}" ]]; then git config --global credential."https://${GIT_HOST}".helper "${target_helper}" fi - local direct_helper direct_helper=$(git config --global --get credential."http://10.0.10.13:3000".helper 2>/dev/null || true) if [[ "${direct_helper}" != "${target_helper}" ]]; then git config --global credential."http://10.0.10.13:3000".helper "${target_helper}" fi - - local ssh_hosts="proxmox pve0 vyos vyos_router 10.0.* dns0 vault0 git0 storage0 registry0" - if [[ -f "${HOME}/.ssh/config" ]] && ! grep -q "IdentityFile ${RAM_KEY}" "${HOME}/.ssh/config"; then - printf "\nHost %s\n IdentityFile %s\n IdentitiesOnly yes\n" "${ssh_hosts}" "${RAM_KEY}" >> "${HOME}/.ssh/config" - fi } \ No newline at end of file diff --git a/state/01_pve.sh b/state/01_pve.sh index 4b54103..cf2eb17 100755 --- a/state/01_pve.sh +++ b/state/01_pve.sh @@ -1,6 +1,6 @@ #!/bin/bash set -uo pipefail -SSH_CMD="ssh -n -o BatchMode=yes -o ConnectTimeout=3 proxmox" +SSH_CMD="ssh -n -o BatchMode=yes -o ConnectTimeout=3 pve" echo "## 1. Гипервизор Proxmox VE (192.168.1.177)" echo "### Память хоста, Uptime и Температура CPU:" echo '```text' diff --git a/state/02_vps.sh b/state/02_vps.sh index 7881a10..5ef575b 100755 --- a/state/02_vps.sh +++ b/state/02_vps.sh @@ -1,7 +1,7 @@ #!/bin/bash set -uo pipefail -SSH_CMD="ssh -n -o BatchMode=yes -o ConnectTimeout=4 fin21" -echo "## 2. Периметр: Белый VPS (Host: fin21, IP: 153.76.194.24)" +SSH_CMD="ssh -n -o BatchMode=yes -o ConnectTimeout=4 n1.srv" +echo "## 2. Периметр: Белый VPS (Host-1)" echo "### WireGuard wg0 на VPS:" echo '```text' timeout 4s ${SSH_CMD} "sudo wg show wg0" 2>&1 || echo "VPS или WireGuard недоступен" diff --git a/state/04_tier0.sh b/state/04_tier0.sh index 417002e..cb4d5c4 100755 --- a/state/04_tier0.sh +++ b/state/04_tier0.sh @@ -1,32 +1,25 @@ #!/bin/bash set -uo pipefail - SSH_VYOS="ssh -n -o BatchMode=yes -o ConnectTimeout=3 vyos" -SSH_STORAGE="ssh -n -o BatchMode=yes -o ConnectTimeout=3 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -J vyos root@10.0.10.14" - +SSH_STORAGE="ssh -n -o BatchMode=yes -o ConnectTimeout=3 -J vyos nas.t0" echo "## 4. Сервисы Tier-0 (Air-Gap фундамент)" - echo "### Technitium DNS (10.0.10.11:53):" echo "* **Внутренний домен (*.svo88.space -> 10.0.30.200):** $(timeout 3s ${SSH_VYOS} "dig @10.0.10.11 vw.svo88.space +short" 2>&1 | tr '\n' ' ')" echo "* **Внешний резолв (google.com):** $(timeout 3s ${SSH_VYOS} "dig @10.0.10.11 google.com +short" 2>&1 | head -n1)" - echo "### OpenBao Vault (10.0.10.12:8200):" echo '```json' timeout 3s ${SSH_VYOS} "curl -s http://10.0.10.12:8200/v1/sys/seal-status" 2>&1 || echo '{"error": "Vault недоступен"}' echo '```' - echo "### Zot OCI Registry (10.0.10.15:5000):" echo '```json' timeout 3s ${SSH_VYOS} "curl -s http://10.0.10.15:5000/v2/_catalog" 2>&1 || echo '{"error": "Zot недоступен"}' echo '```' - echo "### Forgejo GitOps Server (10.0.10.13:3000):" echo '```json' timeout 3s ${SSH_VYOS} "curl -s http://10.0.10.13:3000/api/v1/version" 2>&1 || echo '{"error": "Forgejo недоступен"}' echo '```' - -echo "### Ядерный NFS nfsd (storage0 - 10.0.10.14):" +echo "### Ядерный NFS nfsd (nas.t0 - 10.0.10.14):" echo '```text' -timeout 4s ${SSH_STORAGE} "echo '== Активные экспорты ядра (exportfs):'; exportfs -v; echo ''; echo '== Емкость смонтированных ZFS-датасетов:'; df -h /media /torrents /backups /models; echo ''; echo '== Права точки монтирования OpenCloud:'; ls -ld /backups/opencloud-users" 2>&1 || echo "NFS (storage0) недоступен" +timeout 4s ${SSH_STORAGE} "echo '== Активные экспорты ядра (exportfs):'; exportfs -v; echo ''; echo '== Емкость смонтированных ZFS-датасетов:'; df -h /media /torrents /backups /models; echo ''; echo '== Права точки монтирования OpenCloud:'; ls -ld /backups/opencloud-users" 2>&1 || echo "NFS (nas.t0) недоступен" echo '```' echo "---" \ No newline at end of file