docs: vollstaendige Installationsanleitung im Schnellstart
- Schritt-fuer-Schritt: Voraussetzungen, Konfiguration, DB-Setup, Bauen, Backend-Deploy, Frontend-Deploy, Agent-Installation - .env-basierte Konfiguration dokumentiert (kein config.js mehr) - 2FA-Einrichtung als empfohlener erster Schritt nach Login erwaehnt - Troubleshooting-Tabelle fuer haeufige Probleme - Standardpasswort Start!123 entfernt (wird beim ersten Start generiert)
This commit is contained in:
parent
9035da89ce
commit
65c0e6145b
173
README.md
173
README.md
@ -158,13 +158,170 @@ Client ──► Backend:ProxyPort ──► WebSocket (Binary) ──► Agent
|
|||||||
|
|
||||||
## Schnellstart
|
## Schnellstart
|
||||||
|
|
||||||
|
### 1. Voraussetzungen
|
||||||
|
|
||||||
|
**Backend-Server** (Linux, Debian 12+ empfohlen):
|
||||||
```bash
|
```bash
|
||||||
make all # Backend + Agent + Updater bauen
|
# PostgreSQL 17 + TimescaleDB
|
||||||
make certs # TLS-Zertifikate generieren
|
apt install -y postgresql postgresql-client
|
||||||
make deploy-backend # Backend deployen
|
# TimescaleDB: https://docs.timescale.com/self-hosted/latest/install/
|
||||||
```
|
```
|
||||||
|
|
||||||
Agent auf OPNsense installieren → siehe [agent-bsd/README.md](agent-bsd/README.md)
|
**Build-System** (macOS oder Linux):
|
||||||
|
```bash
|
||||||
|
# Go 1.24+
|
||||||
|
go version # muss >= 1.24 sein
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 2. Konfiguration
|
||||||
|
|
||||||
|
**Backend:**
|
||||||
|
```bash
|
||||||
|
cp backend/config.yaml.example backend/config.yaml
|
||||||
|
```
|
||||||
|
```yaml
|
||||||
|
# backend/config.yaml (wichtigste Felder)
|
||||||
|
listen_addr: ":8443"
|
||||||
|
db_dsn: "postgres://rmm:PASSWORT@localhost:5432/rmm?sslmode=disable"
|
||||||
|
jwt_secret: "ZUFAELLIGER_STRING_MIN_32_ZEICHEN"
|
||||||
|
api_key: "ZUFAELLIGER_API_KEY"
|
||||||
|
```
|
||||||
|
|
||||||
|
**Frontend:**
|
||||||
|
```bash
|
||||||
|
cp frontend/.env.example frontend/.env
|
||||||
|
```
|
||||||
|
```env
|
||||||
|
# frontend/.env
|
||||||
|
VITE_BACKEND_HOST=192.168.1.100 # IP/Hostname deines Backend-Servers
|
||||||
|
VITE_BACKEND_PORT=8443
|
||||||
|
VITE_API_KEY=DEIN_API_KEY # muss mit backend/config.yaml api_key übereinstimmen
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 3. Datenbank anlegen
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Als postgres-User auf dem Backend-Server:
|
||||||
|
sudo -u postgres psql << 'SQL'
|
||||||
|
CREATE USER rmm WITH PASSWORD 'PASSWORT';
|
||||||
|
CREATE DATABASE rmm OWNER rmm;
|
||||||
|
\c rmm
|
||||||
|
CREATE EXTENSION IF NOT EXISTS timescaledb;
|
||||||
|
SQL
|
||||||
|
```
|
||||||
|
|
||||||
|
Die Tabellen werden beim ersten Backend-Start automatisch angelegt (Auto-Migration).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 4. Bauen
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Alles in einem Schritt:
|
||||||
|
make all
|
||||||
|
|
||||||
|
# Oder einzeln:
|
||||||
|
make backend # → build/rmm-backend (linux/amd64)
|
||||||
|
make agent-bsd # → build/rmm-agent-bsd (freebsd/amd64)
|
||||||
|
make agent-linux # → build/rmm-agent-linux (linux/amd64)
|
||||||
|
make frontend # → frontend/dist/
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 5. Backend deployen
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Binary + Config auf den Server kopieren:
|
||||||
|
scp build/rmm-backend root@<backend-server>:/opt/rmm/
|
||||||
|
scp backend/config.yaml root@<backend-server>:/opt/rmm/
|
||||||
|
|
||||||
|
# Systemd-Service einrichten:
|
||||||
|
cat > /etc/systemd/system/rmm-backend.service << 'EOF'
|
||||||
|
[Unit]
|
||||||
|
Description=RMM Backend
|
||||||
|
After=network.target postgresql.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStart=/opt/rmm/rmm-backend
|
||||||
|
WorkingDirectory=/opt/rmm
|
||||||
|
Restart=always
|
||||||
|
RestartSec=5
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
EOF
|
||||||
|
|
||||||
|
systemctl daemon-reload
|
||||||
|
systemctl enable --now rmm-backend
|
||||||
|
systemctl status rmm-backend
|
||||||
|
```
|
||||||
|
|
||||||
|
Der erste Start legt automatisch einen Admin-User an (Credentials werden ins Log geschrieben).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 6. Frontend deployen
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Build (mit .env-Konfiguration aus Schritt 2):
|
||||||
|
cd frontend && npm install && npm run build
|
||||||
|
|
||||||
|
# Auf Web-Server kopieren (z.B. Nginx):
|
||||||
|
scp -r frontend/dist/* root@<frontend-server>:/var/www/html/
|
||||||
|
|
||||||
|
# Nginx-Konfiguration (einfach):
|
||||||
|
cat > /etc/nginx/sites-available/rmm << 'EOF'
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
root /var/www/html;
|
||||||
|
index index.html;
|
||||||
|
location / { try_files $uri $uri/ /index.html; }
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
ln -s /etc/nginx/sites-available/rmm /etc/nginx/sites-enabled/
|
||||||
|
nginx -t && systemctl reload nginx
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 7. Agent auf OPNsense installieren
|
||||||
|
|
||||||
|
Im Frontend: **Firewall hinzufügen** → Installationsanleitung mit vorbefülltem Installationsbefehl anzeigen.
|
||||||
|
|
||||||
|
Oder manuell:
|
||||||
|
```bash
|
||||||
|
# Auf der OPNsense Firewall (als root):
|
||||||
|
scp build/rmm-agent-bsd root@<opnsense-ip>:/tmp/rmm-agent
|
||||||
|
scp opnsense-plugin/install.sh root@<opnsense-ip>:/tmp/install.sh
|
||||||
|
ssh root@<opnsense-ip> 'sh /tmp/install.sh'
|
||||||
|
```
|
||||||
|
|
||||||
|
Vollständige Anleitung: [agent-bsd/README.md](agent-bsd/README.md)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 8. Erste Anmeldung & 2FA
|
||||||
|
|
||||||
|
1. Frontend unter `http://<frontend-server>` aufrufen
|
||||||
|
2. Mit dem beim ersten Backend-Start erstellten Admin-Account anmelden
|
||||||
|
3. Einstellungen → **Zwei-Faktor-Authentifizierung** → Einrichten (empfohlen)
|
||||||
|
4. TOTP-Secret in Aegis / Google Authenticator eingeben, ersten Code bestätigen
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
| Problem | Lösung |
|
||||||
|
|---------|--------|
|
||||||
|
| Backend startet nicht | `journalctl -u rmm-backend -f` — häufig DB-Verbindung oder Port belegt |
|
||||||
|
| Agent verbindet nicht | API-Key in `agent/config.yaml` prüfen, TLS-Zertifikat ggf. als trusted markieren |
|
||||||
|
| Frontend zeigt keine Daten | `VITE_BACKEND_HOST` und `VITE_API_KEY` in `.env` prüfen, neu bauen |
|
||||||
|
| TimescaleDB fehlt | `CREATE EXTENSION timescaledb` in der rmm-Datenbank ausführen |
|
||||||
|
|
||||||
## Dateistruktur
|
## Dateistruktur
|
||||||
|
|
||||||
@ -210,12 +367,12 @@ rmm/
|
|||||||
- **Persistente Agent-ID**: Ueberlebt Agent- und Backend-Neustarts
|
- **Persistente Agent-ID**: Ueberlebt Agent- und Backend-Neustarts
|
||||||
- **FreeBSD-kompatibel**: Volle Pfade (/usr/bin/netstat etc.), daemon statt nohup
|
- **FreeBSD-kompatibel**: Volle Pfade (/usr/bin/netstat etc.), daemon statt nohup
|
||||||
|
|
||||||
## Zugangsdaten
|
## Zugangsdaten (nach Installation)
|
||||||
|
|
||||||
```
|
```
|
||||||
Backend: https://your-backend:8443
|
Backend: https://<backend-ip>:8443
|
||||||
API-Key: YOUR_API_KEY
|
API-Key: in backend/config.yaml → api_key
|
||||||
Frontend: http://your-backend (admin / Start!123)
|
Frontend: https://<frontend-ip> (Login: admin / Passwort beim ersten Start gesetzt)
|
||||||
```
|
```
|
||||||
|
|
||||||
## Lizenz
|
## Lizenz
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user