1 Node Agent
Claude edited this page 2026-06-29 21:37:15 +00:00

Node-Agent

Rust-Agent auf den Proxmox-Hosts. Verbindet ausgehend per WebSocket zum Backend, dispatcht Commands, führt pvesh/qm/pct aus, öffnet PTYs und lauscht für VM-Guest-Agenten auf TCP :9100. Deployt als einzelnes statisches Binary theprox-node-agent (kein venv/Python nötig).

Die frühere Python-Variante (theprox_agent/, node_agent.py, bundle.py) wurde entfernt (Issue #2). Rust ist die einzige kanonische Variante. Archiv: Git-Tag archive/python-node-agent.

Quellen

Rust-Crate in Node-Agent/src/.

Datei Zweck
main.rs Mainloop, run_once, Reconnect, Keepalive
config.rs Config (/etc/theprox-agent/agent.conf)
ws.rs WebSocket-Session (Sink/Source)
auth.rs Auth/Handshake
dispatcher.rs Command-Routing + Read-Watchdog
commands.rs / commands_async.rs Command-Implementierungen
data.rs Scan/Daten-Sammlung (Live-Intervall via set_interval)
outbox.rs Gemeinsame bounded Outbox + Forwarder
vm_listener.rs TCP :9100 für VM-Guests
vm_binaries.rs VM-Agent-Binaries ausliefern
tunnel.rs / rdp_tunnel.rs Reverse-Tunnel
log_tail.rs Log-Streaming
self_update.rs Self-Update (lädt /node-agent-binary/{arch})
proxmox.rs pvesh/qm/pct Wrapper
term.rs PTY-Terminals

Bauen nach Änderung (Version in Cargo.toml erhöhen):

cd Node-Agent && cargo build --release --target x86_64-unknown-linux-musl \
  && cp target/x86_64-unknown-linux-musl/release/theprox-node-agent theprox-node-agent-x86_64

Config (/etc/theprox-agent/agent.conf)

SERVER_URL, TOKEN, NODE_NAME, SCAN_INTERVAL. Fehlt die Datei, werden Env-Vars gelesen (siehe Node-Agent/systemd/README.md).

Betrieb (systemd)

  • Service: theprox-agent (Node-Agent/systemd/theprox-agent.service)
  • Logs: journalctl -u theprox-agent -f
  • Neustart: systemctl restart theprox-agent

Install

curl -fsSL http://SERVER:8765/install/<TOKEN> | bash

Token pro-Host einmalig, via UI rotierbar.

Versionierung

Jede Änderung an Agent-Code → Version erhöhen + in notes/changelog.md dokumentieren. Self-Update via agent.self_update (→ CommandLog).