From 173f7815c25f7ceba47da90d1066863f834f2c2e Mon Sep 17 00:00:00 2001 From: alvis Date: Sun, 8 Mar 2026 06:54:20 +0000 Subject: [PATCH] Add network config (Netplan, Caddy) to installation guide --- Agap-Installation.md | 55 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 50 insertions(+), 5 deletions(-) diff --git a/Agap-Installation.md b/Agap-Installation.md index 4bbebd5..69a7d25 100644 --- a/Agap-Installation.md +++ b/Agap-Installation.md @@ -2,14 +2,59 @@ Steps to set up a fresh Agap server from scratch. -## 1. GPU & Docker +## 1. Network + +### Netplan (bridge) + +Edit `/etc/netplan/50-cloud-init.yaml`: + +```yaml +network: + bridges: + br0: + interfaces: [enp4s0] + dhcp4: true + version: 2 +``` + +```bash +sudo netplan apply +``` + +> MAC address changes after bridge setup — router may assign a new IP. +> Interface name (`enp4s0`) may differ after hardware changes — check with `ip link show`. + +### Caddy (reverse proxy) + +[Install Caddy](https://caddyserver.com/docs/install#debian-ubuntu-raspbian), then configure `/etc/caddy/Caddyfile`: + +``` +haos.alogins.net { reverse_proxy http://192.168.1.141:8123 } +vi.alogins.net { reverse_proxy localhost:2283 } +zb.alogins.net { reverse_proxy localhost:81 } +git.alogins.net { reverse_proxy localhost:3000 } +ai.alogins.net { reverse_proxy localhost:3125 } +ntfy.alogins.net { reverse_proxy localhost:8840 } +``` + +(See `/etc/caddy/Caddyfile` for full config including VPN and other services.) + +```bash +sudo systemctl enable --now caddy +``` + +**Requirements:** +- Ports **80** and **443** forwarded on the router (source and target, remote IP empty) +- Port **10051** forwarded for Zabbix active agent connections + +## 2. GPU & Docker ```bash sudo ./nvidia-docker-install.sh # Docker + NVIDIA Container Toolkit ./install-cuda.sh # CUDA toolkit (no driver) ``` -## 2. Zabbix Agent (host) +## 3. Zabbix Agent (host) Install agent and plugins: @@ -43,7 +88,7 @@ In Zabbix UI, link these templates to the `AgapHost` host: - **Linux by Zabbix agent active** - **Nvidia by Zabbix agent 2 active** -## 3. Custom Zabbix UserParameters +## 4. Custom Zabbix UserParameters Add backup monitoring to `/etc/zabbix/zabbix_agent2.d/gitea_backup.conf`: @@ -59,7 +104,7 @@ UserParameter=dbs.backup.age,f=/mnt/backups/dbs/.last_sync; [ -f "$f" ] && echo UserParameter=immich.backup.age,f=/mnt/backups/media/.last_sync; [ -f "$f" ] && echo $(( $(date +%s) - $(stat -c %Y "$f") )) || echo -1 ``` -## 4. Root Cron Jobs +## 5. Root Cron Jobs ```bash sudo crontab -e @@ -72,7 +117,7 @@ Add: 30 3 * * * rsync -a --delete /mnt/ssd/dbs/ /mnt/backups/dbs/ >> /mnt/backups/dbs/cron.log 2>&1 && touch /mnt/backups/dbs/.last_sync ``` -## 5. Services +## 6. Services Start all Docker services: