Add network config (Netplan, Caddy) to installation guide

2026-03-08 06:54:20 +00:00
parent 304198ebbd
commit 173f7815c2

@@ -2,14 +2,59 @@
Steps to set up a fresh Agap server from scratch. 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 ```bash
sudo ./nvidia-docker-install.sh # Docker + NVIDIA Container Toolkit sudo ./nvidia-docker-install.sh # Docker + NVIDIA Container Toolkit
./install-cuda.sh # CUDA toolkit (no driver) ./install-cuda.sh # CUDA toolkit (no driver)
``` ```
## 2. Zabbix Agent (host) ## 3. Zabbix Agent (host)
Install agent and plugins: Install agent and plugins:
@@ -43,7 +88,7 @@ In Zabbix UI, link these templates to the `AgapHost` host:
- **Linux by Zabbix agent active** - **Linux by Zabbix agent active**
- **Nvidia by Zabbix agent 2 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`: 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 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 ```bash
sudo crontab -e 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 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: Start all Docker services: