feat(mesh): drive MeshService through the MeshMonitor HTTP gateway (Phase 2)
CI / build + unit (pull_request) Successful in 1m17s

Rewire MeshService off the raw TCP socket + codec onto the Phase-1
MeshMonitorClient contract (HttpMeshMonitorClient in production,
FakeMeshMonitorClient in tests): status/messages/nodes/channels/telemetry
are polled (15s/1s/30s/5min/60s) instead of streamed, outbound broadcasts
and DMs go through client.send(), respond/inject/notifier/command/battery/
weather behavior and all /api/* + MCP endpoint shapes are preserved.
The fake TCP bridge is deleted and every consumer spec (mesh service, MCP
controller, command auto-responder, battery alerts) now drives the real
service through the widened fake client. Docker compose drops
MESH_HOST/MESH_PORT and adds the MESHMONITOR_* env (token from .env,
self-signed TLS via NODE_TLS_REJECT_UNAUTHORIZED=0).

Live smoke against https://meshmonitor.kkhost.pl: getStatus ->
{connected:true, myNodeNum:3994646728, longName:'SP8MK Bot',
nodeResponsive:true}; getNodes -> 104 nodes.

Build green, suite 17 files / 245 tests (baseline 234).
This commit is contained in:
2026-10-13 00:42:02 +00:00
parent f80340ae6e
commit f6b884dfdf
14 changed files with 2221 additions and 2487 deletions
+6 -2
View File
@@ -3,8 +3,12 @@ services:
build: .
environment:
TZ: Europe/Warsaw
MESH_HOST: 192.168.1.4
MESH_PORT: '4403'
MESHMONITOR_API_TOKEN: ${MESHMONITOR_API_TOKEN:-}
MESHMONITOR_API_BASE: ${MESHMONITOR_API_BASE:-https://meshmonitor.kkhost.pl/api/v1}
MESHMONITOR_SOURCE: ${MESHMONITOR_SOURCE:-default}
MESHMONITOR_TIMEOUT_MS: ${MESHMONITOR_TIMEOUT_MS:-15000}
# the gateway uses a self-signed certificate
NODE_TLS_REJECT_UNAUTHORIZED: '0'
MESH_DB_PATH: ./data/mesh-bot.db
MESH_POLL_MS: '1000'
MESH_NOTIFY_CHANNEL: '${MESH_NOTIFY_CHANNEL:-3}'