Infrastructure: nginx/headscale configs + docs + DR script + auto-sync

This commit is contained in:
root committed 2026-09-23 16:09:15 +03:00
1 parent 0e7c26d00b
commit e9de479e49
20 files changed
+836 -36

No files matched your search

+45
View File
@@ -0,0 +1,45 @@
# 📖 Операционный Runbook
## Ежедневные проверки
### 1. Статус доменов
for d in n8n git status vault finance recipes music sync; do
echo "$d $(curl -4 -s -o /dev/null -w '%{http_code}' --max-time 20 https://$d.buryans.ru/)"
done
### 2. VPN ноды
ssh root@193.233.210.184 'headscale nodes list | grep -v "An updated"'
### 3. Туннель
ssh root@193.233.210.184 'tailscale ping -c 3 pve-elrytdwg'
## Еженедельно
ssh root@193.233.210.184 'apt update && apt upgrade -y'
ssh root@193.233.210.184 'ls -lh /root/backups/'
## Ежемесячно
headscale preauthokeys create --user buryan-hub --reusable --expiration 30d
certbot certificates
## Аварии
### VPS недоступен
1. Геб-консоль провайдѴаа → reboot
2. ҰайнийЇслучай: reinstall + deploy/install-on-new-vps.sh
### PVE потерял LAN
1. systemctl stop tailscaled
2. ping 192.168.1.1 (должен заработать)
3. tailscale set --accept-routes=false --accept-dns=false
4. systemctl start tailscaled
### Headscale не стартует
journalctl -u headscale -n 50
Откат конфига: cd /root/buryan-infra && git checkout HEAD~1 -- vps/headscale/config.yaml
scp vps/headscale/config.yaml root@193.233.210.184:/etc/headscale/
ssh root@193.233.210.184 'systemctl restart headscale'
### Домен 504/000
1. ssh root@192.168.1.10 'curl -I http://192.168.1.XXX:PORT/'
2. ssh root@193.233.210.184 'cat /etc/nginx/sites-available/domain.buryans.ru'
3. ssh root@193.233.210.184 'tailscale ping pve-elrytdwg'
+24
View File
@@ -0,0 +1,24 @@
# 🔧 Troubleshooting
## VPN не подключщается
connection refused → ssh root@193.233.210.184 'ufw allow 8443/tcp'
timeout → ss -ulnp | grep 3478; systemctl restart headscale
## Домены 504/000
Все домены 504 → headscale nodes list; переподключить PVE
Один домен 400/502 → curl -I http://192.168.1.XXX:PORT/ с PVE
## PVE без LAN
ping 192.168.1.1 не работает:
1. systemctl stop tailscaled
2. ping 192.168.1.1
3. systemctl start tailscaled
4. tailscale set --accept-routes=false --accept-dns=false
## Headscale
noise.private_key_path required → обновить конфиг
context deadline exceeded → usermod -aG headscale root && systemctl restart headscale
## SSL
certificate expired → certbot renew --force-renewal
too many certificates → ждать 7 дней
+35
View File
@@ -0,0 +1,35 @@
# � Подключение к Headscale VPN
Server: https://headscale.buryans.ru
## Генераци� auth key
ssh root@193.233.210.184 'headscale preauthkeys create --user buryan-hub --reusable --expiration 30d'
## Android
1. Tailscale из Google Play
2. Меню входа → Custom server → https://headscale.buryans.ru
3. Signin → �траницааоме�тра�трациш �� nodekey:XXXX
4. �д VPS: headscale nodes register --user buryan-hub --key nodekey:XXXX
(д/´aô/tbô.ô,4aô-t.ôc´`t.ˆ›Ý\›˜[Ý ]HXYØØ[HÜ™\ [ÑH››ÙZÙ^N–ØKYŒ NW^Í�HŠB�Kˆ4,4,4-t`4-tb4.4c VPN, отключить оптимижацию батареи длÑ� Tailscale
Deep link альтерндотѸ во�тернаатти : tailscale://login?authokey=KEY&server=https://headscale.buryans.ru
## iOS
App Store Tailscale → Change Server → https://headscale.buryans.ru → auth key
## Windows
winget install tailscale
tailscale up --login-server=https://headscale.buryans.ru --authkey=KEY
## Linux
curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up --login-server=https://headscale.buryans.ru --authkey=KEY --accept-routes=false --accept-dns=false
## macOS
brew install --cask tailscale
/Applications/Tailscale.app/Contents/MacOS/Tailscale up --login-server=https://headscale.buryans.ru --authkey=KEY
## Провеео
tailscale status
ping 192.168.1.108
Браый в�улер: http://192.168.1.108:5680 (n8n)