e.stopPropagation()}>
Geraet hinzufuegen
@@ -373,37 +340,7 @@ ssh root@
'/bin/sh /tmp/install.sh'
Geraet "{result.name}" erfolgreich angelegt (ID: {result.id?.substring(0, 12)}...)
-
-
-
Installationsanleitung
-
- {installCmd}
-
-
-
-
-
-
- Backend URL:
- {BACKEND_URL}
-
-
-
- API Key:
- {API_KEY}
-
-
-
-
-
- Der Agent verbindet sich nach der Installation automatisch mit dem Backend.
- Hostname und IP werden beim ersten Heartbeat aktualisiert.
-
+
>
)}
diff --git a/frontend/src/pages/ProxmoxServers.jsx b/frontend/src/pages/ProxmoxServers.jsx
index f23f297..f5ae076 100644
--- a/frontend/src/pages/ProxmoxServers.jsx
+++ b/frontend/src/pages/ProxmoxServers.jsx
@@ -2,7 +2,8 @@ import { useEffect, useState, useMemo } from 'react'
import api from '../api/client'
import StatusBadge from '../components/StatusBadge'
import ProxmoxPanel from '../components/ProxmoxPanel'
-import { Search, ChevronUp, ChevronDown, Plus, Copy, Check, X } from 'lucide-react'
+import { Search, ChevronUp, ChevronDown, Plus, X } from 'lucide-react'
+import InstallGuide from '../components/InstallGuide'
export default function ProxmoxServers() {
const [agents, setAgents] = useState([])
@@ -273,10 +274,6 @@ function AddServerDialog({ customers, result, onAdd, onClose }) {
const [custId, setCustId] = useState('')
const [error, setError] = useState('')
const [submitting, setSubmitting] = useState(false)
- const [copied, setCopied] = useState(null)
-
- const BACKEND_URL = 'https://192.168.85.13:8443'
- const API_KEY = '01532e5a7c9e70bf2757df77a2f5b9b9'
const handleSubmit = async () => {
if (!name.trim()) { setError('Name ist erforderlich'); return }
@@ -290,81 +287,9 @@ function AddServerDialog({ customers, result, onAdd, onClose }) {
setSubmitting(false)
}
- const copyText = (text, id) => {
- navigator.clipboard.writeText(text)
- setCopied(id)
- setTimeout(() => setCopied(null), 2000)
- }
-
- const CopyBtn = ({ text, id }) => (
-
- )
-
- const installCmd = `# Proxmox/Linux Server Installation:
-
-# 1. Agent + Updater auf den Server kopieren:
-scp build/rmm-agent-linux build/rmm-updater-linux root@
:/tmp/
-
-# 2. Installation auf dem Server:
-ssh root@ 'bash -s' << 'INSTALL'
- mkdir -p /usr/local/bin /etc/rmm
-
- cp /tmp/rmm-agent-linux /usr/local/bin/rmm-agent
- cp /tmp/rmm-updater-linux /usr/local/bin/rmm-updater
- chmod +x /usr/local/bin/rmm-agent /usr/local/bin/rmm-updater
-
- # Config erstellen:
- cat > /etc/rmm/config.yaml << EOF
-backend_url: ${BACKEND_URL}
-api_key: ${API_KEY}
-agent_name: ${name || ''}
-heartbeat_interval: 30
-insecure: true
-EOF
-
- # Agent Service:
- cat > /etc/systemd/system/rmm-agent.service << EOF
-[Unit]
-Description=RMM Agent
-After=network.target
-
-[Service]
-Type=simple
-User=root
-ExecStart=/usr/local/bin/rmm-agent
-Restart=always
-RestartSec=10
-
-[Install]
-WantedBy=multi-user.target
-EOF
-
- # Updater Service:
- cat > /etc/systemd/system/rmm-updater.service << EOF
-[Unit]
-Description=RMM Updater
-After=network.target
-
-[Service]
-Type=simple
-User=root
-ExecStart=/usr/local/bin/rmm-updater
-Restart=always
-RestartSec=30
-
-[Install]
-WantedBy=multi-user.target
-EOF
-
- systemctl daemon-reload
- systemctl enable --now rmm-agent rmm-updater
-INSTALL`
-
return (
-
e.stopPropagation()}>
+
e.stopPropagation()}>
Server hinzufuegen
@@ -412,37 +337,7 @@ INSTALL`
Server "{result.name}" erfolgreich angelegt (ID: {result.id?.substring(0, 12)}...)
-
-
-
Installationsanleitung
-
- {installCmd}
-
-
-
-
-
-
- Backend URL:
- {BACKEND_URL}
-
-
-
- API Key:
- {API_KEY}
-
-
-
-
-
- Der Agent verbindet sich nach der Installation automatisch mit dem Backend.
- Hostname und IP werden beim ersten Heartbeat aktualisiert.
-
+
>
)}
diff --git a/opnsense-plugin/install.sh b/opnsense-plugin/install.sh
index 34ee55b..b34f84f 100755
--- a/opnsense-plugin/install.sh
+++ b/opnsense-plugin/install.sh
@@ -2,12 +2,13 @@
#
# RMM Agent Plugin Installer fuer OPNsense
#
-# Usage:
-# scp install.sh rmm-agent root@opnsense:/tmp/
-# ssh root@opnsense '/bin/sh /tmp/install.sh'
+# Usage (automatischer Download):
+# fetch -o /tmp/install.sh "https://git.cynfo.net/christian/rmm/raw/branch/main/opnsense-plugin/install.sh"
+# sh /tmp/install.sh
#
-# Oder remote:
-# cat install.sh | ssh root@opnsense '/bin/sh'
+# Oder mit lokalen Binaries:
+# scp install.sh rmm-agent rmm-updater-freebsd root@opnsense:/tmp/
+# ssh root@opnsense '/bin/sh /tmp/install.sh'
#
set -e
@@ -15,17 +16,36 @@ set -e
BASEDIR="/tmp"
BINARY="${BASEDIR}/rmm-agent"
UPDATER_BINARY="${BASEDIR}/rmm-updater"
+BACKEND_URL="https://192.168.85.13:8443"
+API_KEY="01532e5a7c9e70bf2757df77a2f5b9b9"
echo "========================================"
echo " RMM Agent Plugin Installer"
echo "========================================"
-# Pruefen ob Binary vorhanden
+# Binaries herunterladen wenn nicht lokal vorhanden
if [ ! -f "${BINARY}" ]; then
- echo "FEHLER: ${BINARY} nicht gefunden."
- echo "Bitte vorher das Binary kopieren:"
- echo " scp rmm-agent root@opnsense:/tmp/"
- exit 1
+ echo "[*] Binaries nicht lokal gefunden — lade vom Backend..."
+ /usr/local/bin/fetch --no-verify-peer -o "${BASEDIR}/rmm-bundle.zip" \
+ "${BACKEND_URL}/api/v1/firmware/download?platform=freebsd&api_key=${API_KEY}"
+ if [ ! -f "${BASEDIR}/rmm-bundle.zip" ]; then
+ echo "FEHLER: Download fehlgeschlagen."
+ echo "Pruefe Backend-Erreichbarkeit: ${BACKEND_URL}"
+ exit 1
+ fi
+ cd "${BASEDIR}"
+ unzip -o rmm-bundle.zip 2>/dev/null || true
+ # ZIP enthaelt rmm-agent und rmm-updater-freebsd
+ if [ -f "${BASEDIR}/rmm-updater-freebsd" ] && [ ! -f "${UPDATER_BINARY}" ]; then
+ mv "${BASEDIR}/rmm-updater-freebsd" "${UPDATER_BINARY}"
+ fi
+ rm -f rmm-bundle.zip
+ echo " Download OK"
+ if [ ! -f "${BINARY}" ]; then
+ echo "FEHLER: ${BINARY} nach Download nicht vorhanden."
+ echo "Firmware-ZIP muss 'rmm-agent' enthalten."
+ exit 1
+ fi
fi
# Alten Agent stoppen falls vorhanden