47 Commits

Author SHA1 Message Date
cynfo3000
4023a14fe1 feat: Agent zeigt Warnung wenn er nicht den Kunden-Key nutzt
- last_api_key Spalte in agents, wird bei Heartbeat gesetzt
- GetAgentsByCustomer liefert last_api_key mit
- Frontend: rot + Warnsymbol wenn Key abweicht vom Kunden-Agent-Key
- Grau wenn noch kein Heartbeat mit Key-Info
2026-03-10 00:23:59 +01:00
cynfo3000
20a976767b fix: getCustomerAgents liefert status + agent_version 2026-03-10 00:21:58 +01:00
cynfo3000
ebd8f1ebb8 fix: agent permission erlaubt /api/v1/agent/register (BSD Agent braucht das zum Start) 2026-03-10 00:15:17 +01:00
cynfo3000
5cc3476479 feat: Kunden-Seite zeigt API-Keys beim Aufklappen
- Klick auf Kundenzeile klappt Key-Panel auf
- Zeigt Agent + Read-only Keys mit Permission-Badge
- Key teilweise maskiert, Kopier-Button vorhanden
- Backend: GET /api/v1/customers/{id}/apikeys
- DB: ListCustomerAPIKeys() nach customer_id gefiltert
2026-03-10 00:06:16 +01:00
cynfo3000
fba824da8b fix: Agent-Key braucht 'agent' Permission, nicht 'read'
- Auto-Erstellung bei neuem Kunden: jetzt agent-Key + read-Key
- agent: fuer OPNsense/Linux Agents (WS + Heartbeat)
- read:  fuer externe Lesezugriffe / Dashboards
- Agent-Keys fuer alle 4 Kunden nachtraglich erstellt
2026-03-10 00:03:19 +01:00
cynfo3000
15ad9be8e7 feat: Auto Read-only API-Key bei Kunden-Erstellung
- createCustomer erstellt automatisch einen customer-scoped Read-only Key
- Response gibt Customer + neuen API-Key zurueck
- Bestehende 4 Kunden Keys nachtraglich erstellt
2026-03-09 23:56:47 +01:00
cynfo3000
ec30be7246 security: API-Key Permissions + Customer-Scoping
- DB Migration: api_keys bekommt 'permissions' + 'customer_id' Spalten
- Permissions: agent | read | write | admin
  - agent:  nur /api/v1/agent/ws + /api/v1/agent/heartbeat
  - read:   GET-Endpoints (optional customer-scoped)
  - write:  alles ausser Terminal
  - admin:  voll (Terminal bleibt JWT-only)
- Bestehende Keys werden auf 'admin' migriert (Abwaertskompatibilitaet)
- Frontend: API-Key Verwaltung zeigt Permissions-Badge + Kunden-Scope
- API-Client: createAPIKey nimmt jetzt permissions + customer_id
2026-03-09 23:52:26 +01:00
cynfo3000
91385b42d1 security: Terminal-Endpoint JWT-only (kein API-Key Zugriff)
- Neue JWTOnlyAuth Middleware: akzeptiert nur JWT, kein API-Key
- Terminal-Route aus allgemeinem CombinedAuth raus, eigener Mount
- API-Keys für Monitoring/Automation erlaubt, aber Terminal braucht
  echten Login mit User/Pass + 2FA
- ?token= Query-Param weiterhin erlaubt (Browser-WS kann kein Header setzen)
2026-03-09 23:44:12 +01:00
cynfo3000
e9a47bee26 fix: Terminal Auth per JWT-Token statt leerem API-Key
- TerminalModal nutzt jetzt JWT aus localStorage (api.getToken()) fuer WS-Auth
- Backend Middleware: ?token= Query-Parameter fuer WebSocket JWT-Auth
- Behebt: api_key= leer -> 401 -> Terminal nicht erreichbar
2026-03-09 23:39:38 +01:00
cynfo3000
358682e5f3 fix: Backend platform-aware Agent-Update (nicht mehr hardcoded freebsd) 2026-03-09 20:31:26 +01:00
cynfo3000
291d2e3c17 feat: VM/CT Start/Stop im Frontend + Agent proxmox_action Handler
- Agent: neuer 'proxmox_action' Command (start/stop/shutdown fuer VMs und LXC)
- Backend: POST /api/v1/agents/{id}/proxmox/action Endpoint
- Frontend: Start/Stop/Shutdown Buttons in VMs- und Container-Tab
  - Play (gruen) = starten (nur wenn gestoppt)
  - Power (gelb) = Graceful Shutdown (nur VMs, nur wenn running)
  - Stop (rot) = Hard Stop (wenn running)
- api/client.js: proxmoxAction() Methode
2026-03-09 20:22:45 +01:00
cynfo3000
10684dfc0a feat: TOTP 2FA + diverse Verbesserungen
2FA (TOTP):
- backend/api/auth.go: zweistufiger Login-Flow mit Pending-Token (5min),
  Endpunkte /2fa/validate, /2fa/setup, /2fa/confirm, /2fa/disable
- backend/db/users.go: GetUserByID, SetTOTPSecret, EnableTOTP, DisableTOTP
- backend/db/postgres.go: Migration totp_secret + totp_enabled Spalten
- backend/models/user.go: TOTPEnabled/TOTPSecret Felder, neue Request-Typen
- backend/main.go: neue Routen registriert (/2fa/validate ohne Auth, rest geschuetzt)
- backend/go.mod+sum: github.com/pquerna/otp hinzugefuegt
- frontend/src/pages/Login.jsx: zweistufiger Login (Passwort -> TOTP)
- frontend/src/pages/SettingsPage.jsx: TwoFactorSection mit Setup/Deaktivieren
- frontend/src/stores/auth.js: validateTOTP Action
- frontend/src/api/client.js: setupTOTP, confirmTOTP, disableTOTP, validateTOTP

Weitere Aenderungen (unstaged -> jetzt committed):
- frontend/src/components/ScriptModal.jsx: neu
- frontend/src/components/AgentPanel.jsx: Erweiterungen
- frontend/src/components/ProxmoxPanel.jsx: Erweiterungen
- agent-linux/ws/handler.go: Erweiterungen
- backend/api/scheduler.go + tasks.go: Erweiterungen
- backend/db/tasks.go + models/task.go: Erweiterungen
2026-03-08 19:17:43 +01:00
cynfo3000
c76868e806 feat: Updates-Tab, Aufgaben-Tab ProxmoxPanel, security_only Tasks, 3x Netzwerk-Charts, Updates-Spalte Übersicht, dist-upgrade, DeleteAgent cascades metrics 2026-03-07 14:30:12 +01:00
cynfo3000
257eee0c83 fix: HTTP/2 deaktivieren fuer WebSocket-Kompatibilitaet (Terminal WSS) 2026-03-07 00:29:07 +01:00
cynfo3000
67a337ed9f feat: Web Terminal (xterm.js + PTY over WebSocket) + SSH-Copy-Karte im Tunnel-Tab 2026-03-07 00:20:03 +01:00
cynfo3000
e565039743 fix: Linux-Agent Update — platform im Heartbeat mitschicken, Backend nutzt plattformspezifische Firmware statt hardcoded freebsd 2026-03-06 23:41:22 +01:00
cynfo3000
a036849565 fix: hostname-basiertes Agent-Matching entfernt — gleiche Kurzhostnames (z.B. PVE-REP) bei verschiedenen Kunden bekamen dieselbe ID 2026-03-06 23:26:09 +01:00
cynfo3000
c1d1bd8a5e feat: PBS Collector — automatische Erkennung, Datastores + Tasks + GC, Frontend-Tab 'Backup Server' 2026-03-06 23:02:54 +01:00
cynfo3000
9cb504fea1 feat: Interface-Durchsatz-Chart — Backend berechnet RX/TX-Rate (bps), Frontend zeigt Dual-Sparkline per Klick auf Interface 2026-03-06 22:00:33 +01:00
cynfo3000
aca013b848 feat: PF States Chart (Sparkline letzte 8h) — Backend schreibt pf_states in TimescaleDB, Frontend zeigt SVG-Sparkline 2026-03-06 21:47:47 +01:00
cynfo3000
48ac353d28 Initial commit — cynfo RMM (clean history, no secrets) 2026-03-06 09:18:45 +01:00
cynfo3000
d4b6ca86e5 feat: Task Health Check + customer_number in webhook payload
- Task model: CustomerNumber field (K-Nummer aus customers.number)
- DB: taskSelectCols joined c.number, scanTask scans CustomerNumber
- Hub: WaitForAgentOnline() polls until agent reconnects or timeout
- Scheduler: executeUpdateWithHealthCheck() waits for agent reconnect after update
  - health_check: {agent_online: bool, checked_at: RFC3339} in result
  - Status: completed_with_warning wenn Update OK aber Agent offline bleibt
- Frontend: Task-Tabelle zeigt Status-Badge (lauft/fehler/warnung/abgebr.)
2026-03-05 10:53:08 +01:00
cynfo3000
721fd5008f Feature: Recurring jobs with professional scheduling dialog 2026-03-05 09:39:41 +01:00
cynfo3000
f4a28463b7 Feature: PF States, HAProxy + Caddy collectors and dashboard 2026-03-05 09:29:14 +01:00
cynfo3000
7908ae26a0 Feature: Task Scheduler - planned tasks with webhook support 2026-03-05 08:59:53 +01:00
cynfo3000
5b503e6dba Feature: System settings in DB - configurable backend URLs and API key 2026-03-04 23:57:14 +01:00
cynfo3000
70b10a4291 Feature: Audit-Log - tracks all user actions with timestamps 2026-03-04 23:45:01 +01:00
cynfo3000
06189a1468 Feature: Sicherheit Tab - SSH Login Audit + Session History 2026-03-04 23:16:18 +01:00
cynfo3000
57a5a3d3ee Add systemd service file + update install docs 2026-03-04 09:22:10 +01:00
cynfo3000
7f5bb07409 Security: remove hardcoded credentials, use placeholders and config 2026-03-04 08:17:37 +01:00
cynfo3000
25a6cc2a1a Installer-Paket System: Backend speichert/served ZIP, Frontend Upload+Download, install.sh auto-download von Backend statt Git 2026-03-03 23:37:31 +01:00
cynfo3000
eb52507c08 install.sh + frontend: use external URL dsbmueller.spdns.org:8443, configurable via RMM_BACKEND env 2026-03-03 23:17:58 +01:00
cynfo3000
7f9fbd257f Linux/Proxmox Agent + Plattform-Updater + Proxmox Frontend
- agent-linux/: Kompletter Linux/Proxmox RMM Agent
  - Collectors: CPU, Memory, Disk, Network, Services, Updates, Proxmox (VMs, Container, Storage, ZFS), Backups
  - Backup Collector: Jobs nach Node gefiltert (Cluster-aware)
  - WebSocket: Tunnel-Support, writeMux fuer stabile Verbindungen
  - Systemd Service Template

- updater/: Plattform-unabhaengiger Updater (FreeBSD + Linux)
  - runtime.GOOS erkennt Plattform automatisch
  - FreeBSD: /usr/local/rmm/, service rmm_agent
  - Linux: /usr/local/bin/, /etc/rmm/, systemctl rmm-agent
  - Firmware-Download mit ?platform= Parameter

- frontend/: Proxmox-Bereich
  - ProxmoxServers.jsx: Eigene Seite fuer PVE Server mit VM/CT Counts
  - ProxmoxPanel.jsx: Detail-Panel mit Uebersicht, VMs, Container, Storage, ZFS, Tunnel, Dienste, Updates, Backups
  - Agents.jsx: Filtert Linux-Agents raus (nur OPNsense)
  - Sidebar: Proxmox Navigationspunkt
  - Installationsanleitung mit rmm-agent-linux + rmm-updater-linux

- backend: Platform-Feld fuer Agents, Firmware multi-platform
2026-03-01 22:03:18 +01:00
cynfo3000
c114df215a Fix: SettingsController in install.sh aktualisiert (rmmagent[general] Parsing) 2026-03-01 01:37:35 +01:00
cynfo3000
e74cdce0ba Agent-Updater, Multi-Plattform Firmware, Frontend Firmware-Seite, Agent-Tab, Zertifikate-Redesign
Updater:
- Separater Go-Daemon (rmm-updater) als eigener rc.d Service
- Pollt alle 60s: Firmware vorhanden + Hash unterschiedlich + Flag gesetzt
- Download -> SHA256 Verify -> Agent Stop -> Replace -> Agent Start
- Automatisches Rollback bei Fehler
- Deployed und getestet auf allen 3 Firewalls (.1, .19, .33)

Backend:
- Firmware-DB multi-plattform (freebsd/linux/windows)
- update_requested Flag pro Agent in agents Tabelle
- Heartbeat-Response liefert update_available wenn Flag gesetzt
- Neue Endpoints: request-update, request-update-all, firmware/download
- Auth: JWT + CombinedAuth Middleware (API-Key OR JWT)
- Customers CRUD + Agent-Zuordnung
- Users CRUD + Passwort-Aenderung

Frontend:
- Firmware-Seite: Multi-Plattform Upload, Agent-Liste mit Update-Trigger
- Agent-Tab im AgentPanel: Update-Button, nuetzliche Befehle, Agent-Info
- Zertifikate-Tab redesigned: Karten-Layout mit Restlaufzeit und Farbbalken
- Sidebar: Firmware-Eintrag hinzugefuegt

Plugin:
- install.sh erweitert: Installiert Agent + Updater + rc.d Services
- rmm_updater rc.d Service

README:
- Architektur-Diagramm erweitert (Frontend + Updater)
- Auth, Customers, Users, Firmware API dokumentiert
- Updater-Flow dokumentiert
- Frontend-Seiten und Deploy beschrieben
- DB-Schema aktualisiert (neue Tabellen)
- Dateistruktur erweitert (updater/, frontend/, firmware.go, auth.go)
2026-02-28 22:43:03 +01:00
cynfo3000
616a0cb6ac Frontend: Firewall-Tabelle mit CPU/RAM/Disk/Uptime/Gateways, sortierbar, Slide-in Detail-Panel mit Tabs (Uebersicht, Interfaces, Dienste, VPN, Routen, DHCP, Zertifikate, Backups) 2026-02-28 16:03:02 +01:00
cynfo3000
c6c8257cf0 Backend: Customers, Auth (JWT), Agent-Kundenzuordnung, CORS 2026-02-28 15:28:02 +01:00
cynfo3000
3f3d555658 Cron-Jobs Collector: System-Crontab + OPNsense config.xml Jobs
- Neuer Collector: agent/collector/cron.go
- Zwei Quellen: crontab -l (System) + config.xml OPNsense-Jobs
- Daten im Heartbeat unter 'cron_jobs'
- Pro Job: source, schedule, enabled, command, description, uuid, origin
- Backend Model CronJob in models/system.go
- Getestet: 18 Jobs auf Produktion (8 System + 10 OPNsense)
- README + Dateistruktur aktualisiert
- Agent auf allen 3 Firewalls deployed
2026-02-28 13:19:09 +01:00
cynfo3000
c72b791796 Agent-Status und Inaktivitaets-Erkennung implementiert
- Status wird aus last_heartbeat berechnet (online/stale/offline/unknown)
- GET /agents und GET /agents/{id} liefern status Feld
- agent_events Tabelle fuer Event-Tracking (Migration automatisch)
- Inaktivitaets-Monitor als Goroutine (prueft alle 60s, schreibt Events bei Statuswechsel)
- WebSocket Connect/Disconnect Events werden automatisch geschrieben
- API-Endpoints: GET /agents/events und GET /agents/{id}/events (?limit=N&type=X)
- DB-Methoden: InsertAgentEvent, GetAgentEvents, GetAllAgentEvents, GetAgentStatus
- README aktualisiert (Status-Doku, Events API, Dateistruktur)
2026-02-28 13:13:13 +01:00
cynfo3000
5d7a3cbcc1 SQLite durch PostgreSQL + TimescaleDB ersetzt
- Backend DB komplett auf PostgreSQL 17 + TimescaleDB 2.25.1 umgestellt
- pgx pure-Go Driver (kein CGO), modernc/sqlite entfernt
- Hypertable 'metrics' fuer Time-Series Daten
- Automatische Metrik-Extraktion bei jedem Heartbeat:
  CPU, RAM, Uptime, Disk, Network-Traffic, Gateway RTT/Loss
- Retention Policy: 90 Tage, Compression nach 7 Tagen
- Neue API-Endpoints: GET /metrics (raw) + GET /metrics/summary (aggregiert)
- time_bucket() Aggregation (5min, 1h, etc.)
- config.yaml: database-Block statt db_path
- docs/POSTGRES_SETUP.md: Installationsanleitung
- README aktualisiert
2026-02-28 12:48:14 +01:00
cynfo3000
c10c311424 WireGuard Peer Management: Add/List/Delete Peers via API
- Agent: wg_add_peer, wg_delete_peer, wg_list_peers Commands
- Keypair-Generierung auf der Firewall (wg genkey/pubkey)
- Automatische IP-Vergabe aus dem Tunnel-Subnetz
- WAN-IP Auto-Detection via Default-Route Interface
- Endpoint als Parameter uebergebbar (fuer DynDNS etc.)
- Config-Aenderungen direkt in config.xml (Go-basiert, kein PHP)
- configctl wireguard configure fuer Live-Reload
- Client-Config in Response (ready for import)
- Server-Name default: ALWAYSON_VPN
- Backend: 3 neue API-Endpoints (POST/GET/DELETE)
- README mit vollstaendiger Dokumentation
2026-02-28 11:22:18 +01:00
cynfo3000
e7beada405 Config-Backup Feature: Agent liest config.xml, Backend speichert versioniert mit Deduplizierung
- Agent: neuer 'backup' Command (SHA256 Hash, Base64 Transfer)
- Backend: config_backups Tabelle in SQLite
- API: trigger, list, download (JSON/XML), delete, diff
- Deduplizierung: gleicher Hash = kein neuer Eintrag
- WebSocket ReadLimit auf 4MB erhoeht (grosse config.xml)
- README aktualisiert mit Backup-Docs
2026-02-28 10:44:09 +01:00
cynfo3000
ebc70f17eb Update-Commands: update, major_update, update_check, reboot
Agent:
- update: opnsense-update + pkg upgrade -y, optionaler Reboot
- major_update: opnsense-update -r <version>, optionaler Reboot
- update_check: Prueft Core- und Paket-Updates, liefert Details
- reboot: Shutdown mit konfigurierbarer Verzoegerung

Backend:
- Synchrone API-Endpoints (warten auf Agent-Response)
- Response-Waiter-System im Hub (Command-ID basiert)
- Konfigurierbare Timeouts pro Command-Typ
- POST /agents/{id}/update[-check] und /major-update und /reboot

README mit Update-Beispielen und API-Doku aktualisiert
2026-02-28 09:01:04 +01:00
cynfo3000
68e712b3a3 Meilenstein 2: Session-basierte TCP-Tunnel
- Tunnel unterstuetzen mehrere gleichzeitige TCP-Verbindungen
- Jede Proxy-Verbindung bekommt eigene Session-ID
- Agent: Lazy-Connect (Ziel-Verbindung erst bei Datentransfer)
- Backend: Ready-Handshake (wartet auf Agent-Bestaetigung)
- Binary WebSocket Messages mit Session-ID statt Tunnel-ID
- Connection.Close() Race-Condition behoben (sync.Once)
- SendToAgent/SendBinaryToAgent mit Timeout statt Blocking
- Hub verarbeitet Agent-Responses (Session-Confirm)
- README komplett aktualisiert
2026-02-28 08:53:10 +01:00
cynfo3000
fa68e191f9 Fix Tunnel: ID-Sync Backend<->Agent, bidirektionaler Proxy, API-Key via Query-Param
- Backend gibt tunnel_id vor, Agent uebernimmt sie
- Proxy-Verbindung bidirektional: Daten vom Agent zurueck an TCP-Client
- Middleware akzeptiert api_key als Query-Parameter (fuer WebSocket)
- Getestet: OPNsense WebUI erreichbar ueber Tunnel
2026-02-28 07:52:38 +01:00
cynfo3000
f47154787d WebSocket-Infrastruktur: bidirektionaler Command-Kanal + TCP-Tunnel
- Agent: WS-Client mit Reconnect, Command-Handler (exec, tunnel_open/close/data)
- Backend: WS-Hub, Tunnel-Manager mit dynamischen Proxy-Ports (10000-20000)
- API: /agents/{id}/exec, /tunnel, /tunnels, /proxy/{tunnel_id}
- Binary WebSocket Messages fuer effiziente Tunnel-Daten
- gorilla/websocket (pure Go, kein CGO)
- README aktualisiert
2026-02-28 07:42:33 +01:00
cynfo3000
6120d0cffa Initial commit: RMM Agent + Backend
- Go Agent (FreeBSD/amd64) fuer OPNsense
- Go Backend (Linux/amd64) mit REST API + SQLite
- Collector: Hardware, CPU, Memory, Disks, Network, Services,
  WireGuard, DHCP (KEA/ISC/dnsmasq), Routes, Gateways,
  Certificates, Plugins, Updates
- Persistente Agent-ID
- TLS + API-Key Auth
- WebSocket-Infrastruktur (WIP): bidirektionaler Command-Kanal,
  TCP-Tunnel fuer Remote-Zugriff auf Firewall-WebUI
- Lastenheft und README
2026-02-28 07:38:14 +01:00