You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduce a downlink-only WebSocket relay feature and status UI controls. Changes include:
- README: document new relay-related env vars and Cloudflare Tunnel usage for exposing wss://.
- deploy/.env.macbook: add placeholder RELAY_TOKEN and cloudflared config paths.
- docker-compose.macbook-base.yml: expose port 9089, enable relay envs, and add a cloudflared service to publish the relay via a tunnel.
- src/ws_relay.py: make the relay read a live token (from /app/relay_token or env), require tokens per LAN policy, and apply the live token to auth checks.
- src/status_server.py: add /relay-info GET and /relay-token POST endpoints; persist token to /app/relay_token so UI changes take effect immediately.
- status/index.html: add relay card to status UI (port, token input, copy/save), replace the old packet-rate / seq-tape visuals with a 60s health mosaic, and wire UI to new endpoints (load/save token).
- src/data.py: adjust status_map pruning range and status_buffer slice to cover the larger window used by the UI mosaic.
These changes enable remote viewers to connect to a base-station WebSocket (port 9089) with an optional token, and document a recommended secure exposure path via Cloudflare Tunnel. UI changes allow operators to view and update the token without restarting services.
The base station can publish the live telemetry WebSocket through a downlink-only relay on port `9089`. The relay connects upstream to the normal local WebSocket (`9080`) and rebroadcasts frames to viewers; downstream messages are not forwarded back to the car or base station.
295
+
296
+
### Enable the relay
297
+
298
+
For the MacBook base stack this is already enabled in `deploy/docker-compose.macbook-base.yml`:
299
+
300
+
```yaml
301
+
ENABLE_WS_RELAY=true
302
+
RELAY_UPSTREAM_WS=ws://127.0.0.1:9080
303
+
RELAY_LISTEN_PORT=9089
304
+
RELAY_TOKEN=<optional passcode>
305
+
```
306
+
307
+
You can set or change the token from the status page at `http://localhost:8080`. Tokens saved from the UI take effect for new relay connections immediately.
308
+
309
+
Local viewers can connect to:
310
+
311
+
```text
312
+
ws://<base-station-ip>:9089?token=<token>
313
+
```
314
+
315
+
### Forward with Cloudflare Tunnel
316
+
317
+
Cloudflare Tunnel is the recommended way to expose the relay as secure `wss://` without opening inbound firewall ports.
0 commit comments