Skip to content

fix: secure-by-default Docker auth (#864) + CSI yield recovery (#866)#868

Open
ruvnet wants to merge 1 commit into
mainfrom
fix/864-866-docker-auth-csi-yield
Open

fix: secure-by-default Docker auth (#864) + CSI yield recovery (#866)#868
ruvnet wants to merge 1 commit into
mainfrom
fix/864-866-docker-auth-csi-yield

Conversation

@ruvnet
Copy link
Copy Markdown
Owner

@ruvnet ruvnet commented May 30, 2026

Fixes #864, fixes #866. Also documents the resolution for #852.

#864 — Docker no longer exposes the sensing API/stream unauthenticated

  • /ws/* now gated — new require_ws_token middleware protects /ws/sensing and /ws/introspection when RUVIEW_API_TOKEN is set. Token via ?token=<t> (browsers can't set WS headers) or Authorization: Bearer. Previously the live sensing WebSocket was open even with a token configured.
  • Entrypoint fails closeddocker-entrypoint.sh auto-generates a strong RUVIEW_API_TOKEN when none is supplied and prints it to the logs, so the default Docker deployment is never anonymous. Operators on a trusted, isolated LAN opt out explicitly with RUVIEW_ALLOW_UNAUTHENTICATED=1.
  • compose + Dockerfile wire the env vars; startup logs and the CI smoke test now assert secure-by-default (401 with no token) and the opt-out path.

Validation: 15 bearer_auth unit tests pass (7 new for WS), full sensing-server lib suite (436) green, compiles under the mqtt Docker feature, entrypoint POSIX-valid + token generator verified.

#866 — CSI callbacks were starving under the MGMT-only filter

Root cause: the csi_collector.c comment promised "probe-request injection at 10 Hz" but no such injection existed — under the MGMT-only promiscuous filter the node depended entirely on ambient beacons, so heavy DATA traffic (or a beacon-sparse room) yielded ~3 callbacks in 70 s, 0 pps.

  • Implemented the missing probe injection (csi_inject_probe_request + 10 Hz timer). Hardware testing showed it transmits reliably but management-frame CSI stays sparse on the C6.
  • Re-admitted DATA frames (MGMT+DATA). The original wDev_ProcessFiq SPI-cache crash that forced MGMT-only is now neutralized by the WiFi RX/TX IRAM optimizations + the existing 50 Hz early rate gate (CSI_MIN_PROCESS_INTERVAL_US). Kconfig CSI_PROMISC_MGMT_ONLY provides a fallback.

Hardware validation (ESP32-C6 on COM9):

Metric MGMT-only (before) MGMT+DATA, 50 Hz-gated (after)
Yield 0 pps (~3 cb / 20s) ~9 pps avg, peak 19
Presence/motion dead sensing restored
Panics over 35s 0 (no wDev_ProcessFiq)

#852 — "no docker image / denied" (informational)

Not a broken package: ghcr.io/ruvnet/wifi-densepose:latest is public (anonymous pull → HTTP 200). The reporter used ghcr.io/ruvnet/ruview, which doesn't exist. Correct names: ruvnet/wifi-densepose:latest (Docker Hub) / ghcr.io/ruvnet/wifi-densepose:latest.

🤖 Generated with claude-flow

…eld recovery (#866)

#864 — Docker no longer exposes the sensing API/stream unauthenticated:
- Add `require_ws_token` middleware gating `/ws/*` (sensing + introspection)
  with the API token via `?token=` (browser) or `Authorization: Bearer`
  (programmatic). Previously /ws/sensing was ungated even with a token set.
- docker-entrypoint.sh now fails closed: auto-generates a strong
  RUVIEW_API_TOKEN when none is supplied and prints it; explicit
  RUVIEW_ALLOW_UNAUTHENTICATED=1 restores the open LAN posture.
- compose/Dockerfile wire the env vars; startup logs + CI smoke test updated
  to assert secure-by-default (401 with no token) and the opt-out path.
- 7 new bearer_auth unit tests (15 total pass).

#866 — CSI callbacks were starving (~3 in 70s, 0pps) under the MGMT-only
promiscuous filter:
- The documented "10 Hz probe injection" never existed — implement it for
  real (csi_inject_probe_request + 10 Hz timer). Validated on ESP32-C6 (COM9):
  probe TX succeeds at 10 Hz, but management-frame CSI stays sparse.
- Re-admit DATA frames (MGMT+DATA) now that the original wDev_ProcessFiq
  SPI-cache crash is mitigated by WiFi RX/TX IRAM opts + the existing 50 Hz
  rate gate. Kconfig CSI_PROMISC_MGMT_ONLY falls back if needed.
- Hardware-validated on COM9: yield 0 -> ~9pps avg (peak 19), presence/motion
  sensing restored, 0 panics over 35s.

Co-Authored-By: claude-flow <ruv@ruv.net>
Comment thread docker/docker-compose.yml
# LAN with RUVIEW_ALLOW_UNAUTHENTICATED=1.
# REST: Authorization: Bearer <token>
# WS: ws://<host>:3001/ws/sensing?token=<token>
- RUVIEW_API_TOKEN=${RUVIEW_API_TOKEN:-}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants