TOTAL REFACTOR SVO

This commit is contained in:
v 2026-10-26 13:44:54 +03:00
parent 9361094805
commit 547a895837
5 changed files with 8 additions and 22 deletions

View file

@ -22,8 +22,8 @@ check_target() {
fi fi
} }
check_target "Proxmox Host (PVE)" "192.168.1.177" 8006 check_target "Proxmox" "192.168.1.177" 8006
check_target "Edge Router (VyOS)" "192.168.1.2" 22 check_target "Vyos" "192.168.1.2" 22
check_target "Technitium DNS" "10.0.10.11" 53 check_target "Technitium DNS" "10.0.10.11" 53
check_target "OpenBao Vault" "10.0.10.12" 8200 check_target "OpenBao Vault" "10.0.10.12" 8200
check_target "Forgejo GitOps" "10.0.10.13" 3000 check_target "Forgejo GitOps" "10.0.10.13" 3000

View file

@ -6,22 +6,15 @@ ensure_prerequisites() {
log_info "Восстанавливаем маршрут к ${NET_PREFIX} через VyOS (${VYOS_ROUTER_IP})..." log_info "Восстанавливаем маршрут к ${NET_PREFIX} через VyOS (${VYOS_ROUTER_IP})..."
sudo ip route replace "${NET_PREFIX}" via "${VYOS_ROUTER_IP}" 2>/dev/null || true sudo ip route replace "${NET_PREFIX}" via "${VYOS_ROUTER_IP}" 2>/dev/null || true
fi fi
local target_helper="!${ZARYA_DIR}/bin/zarya git-credential" local target_helper="!${ZARYA_DIR}/bin/zarya git-credential"
local current_helper local current_helper
current_helper=$(git config --global --get credential."https://${GIT_HOST}".helper 2>/dev/null || true) current_helper=$(git config --global --get credential."https://${GIT_HOST}".helper 2>/dev/null || true)
if [[ "${current_helper}" != "${target_helper}" ]]; then if [[ "${current_helper}" != "${target_helper}" ]]; then
git config --global credential."https://${GIT_HOST}".helper "${target_helper}" git config --global credential."https://${GIT_HOST}".helper "${target_helper}"
fi fi
local direct_helper local direct_helper
direct_helper=$(git config --global --get credential."http://10.0.10.13:3000".helper 2>/dev/null || true) direct_helper=$(git config --global --get credential."http://10.0.10.13:3000".helper 2>/dev/null || true)
if [[ "${direct_helper}" != "${target_helper}" ]]; then if [[ "${direct_helper}" != "${target_helper}" ]]; then
git config --global credential."http://10.0.10.13:3000".helper "${target_helper}" git config --global credential."http://10.0.10.13:3000".helper "${target_helper}"
fi 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
} }

View file

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
set -uo pipefail 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 "## 1. Гипервизор Proxmox VE (192.168.1.177)"
echo "### Память хоста, Uptime и Температура CPU:" echo "### Память хоста, Uptime и Температура CPU:"
echo '```text' echo '```text'

View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
set -uo pipefail set -uo pipefail
SSH_CMD="ssh -n -o BatchMode=yes -o ConnectTimeout=4 fin21" SSH_CMD="ssh -n -o BatchMode=yes -o ConnectTimeout=4 n1.srv"
echo "## 2. Периметр: Белый VPS (Host: fin21, IP: 153.76.194.24)" echo "## 2. Периметр: Белый VPS (Host-1)"
echo "### WireGuard wg0 на VPS:" echo "### WireGuard wg0 на VPS:"
echo '```text' echo '```text'
timeout 4s ${SSH_CMD} "sudo wg show wg0" 2>&1 || echo "VPS или WireGuard недоступен" timeout 4s ${SSH_CMD} "sudo wg show wg0" 2>&1 || echo "VPS или WireGuard недоступен"

View file

@ -1,32 +1,25 @@
#!/bin/bash #!/bin/bash
set -uo pipefail set -uo pipefail
SSH_VYOS="ssh -n -o BatchMode=yes -o ConnectTimeout=3 vyos" 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 "## 4. Сервисы Tier-0 (Air-Gap фундамент)"
echo "### Technitium DNS (10.0.10.11:53):" 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 "* **Внутренний домен (*.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 "* **Внешний резолв (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 "### OpenBao Vault (10.0.10.12:8200):"
echo '```json' echo '```json'
timeout 3s ${SSH_VYOS} "curl -s http://10.0.10.12:8200/v1/sys/seal-status" 2>&1 || echo '{"error": "Vault недоступен"}' timeout 3s ${SSH_VYOS} "curl -s http://10.0.10.12:8200/v1/sys/seal-status" 2>&1 || echo '{"error": "Vault недоступен"}'
echo '```' echo '```'
echo "### Zot OCI Registry (10.0.10.15:5000):" echo "### Zot OCI Registry (10.0.10.15:5000):"
echo '```json' echo '```json'
timeout 3s ${SSH_VYOS} "curl -s http://10.0.10.15:5000/v2/_catalog" 2>&1 || echo '{"error": "Zot недоступен"}' timeout 3s ${SSH_VYOS} "curl -s http://10.0.10.15:5000/v2/_catalog" 2>&1 || echo '{"error": "Zot недоступен"}'
echo '```' echo '```'
echo "### Forgejo GitOps Server (10.0.10.13:3000):" echo "### Forgejo GitOps Server (10.0.10.13:3000):"
echo '```json' echo '```json'
timeout 3s ${SSH_VYOS} "curl -s http://10.0.10.13:3000/api/v1/version" 2>&1 || echo '{"error": "Forgejo недоступен"}' timeout 3s ${SSH_VYOS} "curl -s http://10.0.10.13:3000/api/v1/version" 2>&1 || echo '{"error": "Forgejo недоступен"}'
echo '```' echo '```'
echo "### Ядерный NFS nfsd (nas.t0 - 10.0.10.14):"
echo "### Ядерный NFS nfsd (storage0 - 10.0.10.14):"
echo '```text' 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 '```'
echo "---" echo "---"