From 138a43e69b1e5c6a7bcbdd31be92616c50ade173 Mon Sep 17 00:00:00 2001 From: cynfo3000 Date: Fri, 6 Mar 2026 10:07:15 +0100 Subject: [PATCH] =?UTF-8?q?docs:=20updater/README.md=20erstellt=20(cross-p?= =?UTF-8?q?latform,=20FreeBSD+Linux),=20Komponenten-Tabelle=20erg=C3=A4nzt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 +- updater/README.md | 101 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 updater/README.md diff --git a/README.md b/README.md index 54ca8e0..02e9366 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ Client ──► Backend:ProxyPort ──► WebSocket (Binary) ──► Agent | **Backend** | REST API, WebSocket Hub, Tunnel Manager, PostgreSQL + TimescaleDB | [docs/BACKEND.md](docs/BACKEND.md) | | **Agent BSD** | OPNsense/FreeBSD Agent — Installation, Firmware, OTA-Updates, OPNsense-Updates | [agent-bsd/README.md](agent-bsd/README.md) | | **Agent Linux** | Linux/Proxmox Agent — Installation, Monitoring, Remote-Commands | [agent-linux/README.md](agent-linux/README.md) | +| **Updater** | OTA-Update-Daemon fuer Agent-Binaries (FreeBSD + Linux, cross-platform) | [updater/README.md](updater/README.md) | | **Frontend** | React + Vite + TailwindCSS Web-Frontend | [docs/FRONTEND.md](docs/FRONTEND.md) | | **API** | Vollstaendige REST API mit allen Endpoints | [docs/API.md](docs/API.md) | @@ -149,7 +150,7 @@ rmm/ │ ├── monitor/monitor.go │ ├── api/ # REST Handler, Auth, Middleware │ └── ws/ # WebSocket Hub, Tunnel Manager -├── updater/main.go # Separater Update-Daemon +├── updater/ # OTA-Update-Daemon (FreeBSD + Linux) ├── frontend/ # React + Vite + TailwindCSS │ └── src/ ├── opnsense-plugin/ # OPNsense MVC Plugin + Installer diff --git a/updater/README.md b/updater/README.md new file mode 100644 index 0000000..f95008d --- /dev/null +++ b/updater/README.md @@ -0,0 +1,101 @@ +# RMM Updater + +Separater Update-Daemon für RMM-Agents. Läuft neben dem Agent und übernimmt +OTA-Updates (Over-the-Air) ohne manuelle Eingriffe. + +**Cross-Platform:** Ein Quellcode, zwei Build-Targets — FreeBSD (OPNsense) und Linux. +Die Plattform wird zur Laufzeit per `runtime.GOOS` erkannt. + +--- + +## Wie es funktioniert + +1. Backend setzt `update_requested = true` für einen Agent (manuell oder via Frontend) +2. Updater pollt alle 60s: `GET /api/v1/firmware?platform=` +3. Wenn neue Version verfügbar: ZIP-Bundle herunterladen + SHA256 prüfen +4. Agent stoppen → Binary ersetzen → Agent starten +5. Bei Fehler: automatischer Rollback auf `.bak`-Backup +6. `update_requested` wird zurückgesetzt + +--- + +## Plattform-spezifische Pfade + +| | FreeBSD (OPNsense) | Linux | +|--|--|--| +| Agent-Binary | `/usr/local/rmm/rmm-agent` | `/usr/local/bin/rmm-agent` | +| Updater-Binary | `/usr/local/rmm/rmm-updater` | `/usr/local/bin/rmm-updater` | +| Config | `/usr/local/etc/rmm-agent/config.yaml` | `/etc/rmm/config.yaml` | +| Service stoppen | `service rmm-agent stop` | `systemctl stop rmm-agent` | +| Service starten | `service rmm-agent start` | `systemctl start rmm-agent` | +| Logs | `/var/log/rmm-updater.log` | `journalctl -u rmm-updater` | +| ZIP-Name Agent | `rmm-agent` | `rmm-agent-linux` | +| ZIP-Name Updater | `rmm-updater-freebsd` | `rmm-updater-linux` | + +--- + +## Konfiguration + +Liest dieselbe `config.yaml` wie der Agent — keine eigene Konfigurationsdatei nötig. + +```yaml +backend_url: "https://BACKEND_IP:8443" +api_key: "DEIN_API_KEY" +insecure: true +``` + +--- + +## Bauen + +```bash +# Auf dem Build-Server +cd /opt/rmm + +# FreeBSD +make updater-freebsd VERSION=1.0.3 +# → build/rmm-updater-freebsd + +# Linux +make updater-linux VERSION=1.0.3 +# → build/rmm-updater-linux + +# Beides + Agent in einem ZIP (empfohlen) +make release VERSION=1.0.3 +# → build/release/rmm-freebsd-1.0.3.zip (rmm-agent + rmm-updater-freebsd + install.sh) +# → build/release/rmm-linux-1.0.3.zip (rmm-agent-linux + rmm-updater-linux + install.sh) +``` + +--- + +## Service-Management + +### FreeBSD (OPNsense) + +```bash +service rmm_updater status +service rmm_updater start | stop | restart +tail -f /var/log/rmm-updater.log +``` + +### Linux + +```bash +systemctl status rmm-updater +systemctl start | stop | restart rmm-updater +journalctl -u rmm-updater -f +``` + +--- + +## Update manuell auslösen (API) + +```bash +# Einzelnen Agent updaten +curl -sk -X POST "https://BACKEND_IP:8443/api/v1/agents/AGENT_ID/request-update" \ + -H "X-API-Key: DEIN_API_KEY" + +# Alle Agents updaten +curl -sk -X POST "https://BACKEND_IP:8443/api/v1/agents/request-update-all" \ + -H "X-API-Key: DEIN_API_KEY" +```