From bbfc45925e82c364519b9d796758003365bc9005 Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Tue, 11 Aug 2026 22:11:18 +0200 Subject: feat(node): Phase 11 — production-ready daemon with WebRTC, WS, chat, HTTP MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The node daemon was previously a skeleton that only started QUIC/TCP servers and the local web UI. All browser-facing functionality (WebRTC, hub WebSocket, chat store, HTTP file API) lived in QE demo scripts. This rewrites daemon.py to be fully self-contained: - WebRTC transport for browser clients (aiortc DataChannel) - Hub WebSocket task (signaling, revocations, WebRTC offers) - ChatStore per group (SQLite in ~/.local/share/meshbay/) - HTTP file API per group (create_http_app on configured port) - Graceful shutdown (all transports, stores, tasks) - hub_client: _ws tracking + send_ws() for chat notifications - config: data_dir field for persistent state - systemd: security hardening (ProtectSystem, StateDirectory) Co-Authored-By: Claude Opus 4.6 --- packaging/systemd/meshbay-node.service | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'packaging') diff --git a/packaging/systemd/meshbay-node.service b/packaging/systemd/meshbay-node.service index e64934f..edff7f1 100644 --- a/packaging/systemd/meshbay-node.service +++ b/packaging/systemd/meshbay-node.service @@ -1,5 +1,5 @@ [Unit] -Description=MeshBay Node — local file host and streaming server +Description=MeshBay Node — P2P file host, streaming, and chat Documentation=https://meshbay.org/docs After=network-online.target Wants=network-online.target @@ -12,18 +12,23 @@ Group=%i # Per-user service: systemctl enable --now meshbay-node@$USER WorkingDirectory=%h -# Override unlock mode in ~/.config/meshbay/hub.env +# Secrets: MESHBAY_PASSWORD (hub login), MESHBAY_UNLOCK_KEY (keystore) EnvironmentFile=-%h/.config/meshbay/node.env -# Alternative: MESHBAY_UNLOCK_KEY= in environment file (chmod 600) ExecStart=/usr/bin/meshbay-node --config %h/.config/meshbay/node.toml Restart=on-failure RestartSec=10 TimeoutStopSec=30 +# Data: chat DBs, indexes — default ~/.local/share/meshbay/ +StateDirectory=meshbay + # Security hardening NoNewPrivileges=true PrivateTmp=true +ProtectSystem=strict +ReadWritePaths=%h/.config/meshbay %h/.local/share/meshbay +# Groups' shared_dir paths must be added to ReadWritePaths if outside ~ [Install] WantedBy=default.target -- cgit v1.2.3