BetterFrame/server/src/shared
Mitchell R e1a3cd1d05
fix: ONVIF single-kiosk ownership + rate limiting
Server-side:
- Bundle gen: when camera event_source is "auto", first kiosk to fetch
  bundle claims ownership → writes "kiosk:<id>" to camera row. Other
  kiosks see assigned owner and skip ONVIF subscription.
- Kiosk deletion resets event_source back to "auto" so next kiosk
  takes over.
- repo.getActiveOnvifOwners() for future use.

Kiosk-side:
- Only subscribe when event_source is "auto" or "kiosk:<MY_ID>".
  Skips "kiosk:<other_id>", "server", "none", "disabled".
- Poll interval: 3s → 10s (cameras were getting overwhelmed)
- CreatePullPoint backoff: exponential 30s→60s→120s...→600s max
- Pull errors: exponential 15s→30s→45s...→300s, resubscribe after 5
  consecutive failures instead of immediately.
- load_kiosk_id() helper reads from cached bundle.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-27 01:40:44 +02:00
..
cloud-cameras feat(cloud-cameras): add EZVIZ, Reolink, Eagle Eye providers 2026-05-24 02:54:49 +02:00
db fix: ONVIF single-kiosk ownership + rate limiting 2026-05-27 01:40:44 +02:00
ablesign.ts feat: AbleSign digital signage integration 2026-05-26 17:03:42 +02:00
api-schemas.ts fix: wrap nullable event fields with optional() for missing keys 2026-05-26 15:26:55 +02:00
artifact-cleanup.ts refactor(db): move service-store from BSB plugin to shared/db library 2026-05-24 02:48:32 +02:00
audit.ts refactor: migrate all auto-increment PKs to UUIDv7 text IDs 2026-05-26 07:11:45 +02:00
auth.ts refactor: migrate all auto-increment PKs to UUIDv7 text IDs 2026-05-26 07:11:45 +02:00
backup.ts feat(server): backup + restore (AES-256-GCM, PBKDF2, admin UI) 2026-05-14 07:44:01 +02:00
bundle.ts fix: ONVIF single-kiosk ownership + rate limiting 2026-05-27 01:40:44 +02:00
camera-health.ts refactor(db): move service-store from BSB plugin to shared/db library 2026-05-24 02:48:32 +02:00
cec-relay.ts refactor: collapse 6 non-service plugins into shared modules 2026-05-10 02:29:25 +02:00
coordinator-registry.ts refactor: migrate all auto-increment PKs to UUIDv7 text IDs 2026-05-26 07:11:45 +02:00
firmware.ts refactor: remove all process.env and envStr() from server code 2026-05-23 13:22:44 +02:00
kiosk-lan.ts feat(preview): pull entity snapshot from active kiosk first 2026-05-21 10:35:27 +02:00
mqtt-bridge.ts refactor: migrate all auto-increment PKs to UUIDv7 text IDs 2026-05-26 07:11:45 +02:00
nodered-bridge.ts feat(os-ota-ui): admin pages for OS releases + rollouts + per-kiosk panel 2026-05-21 11:30:33 +02:00
onvif.ts feat(onvif): event routing config + GetEventProperties + subscription status 2026-05-23 00:38:54 +02:00
os-updates.ts feat(os-ota): resumable chunked download with Range header support 2026-05-23 01:44:34 +02:00
pairing.ts refactor: migrate all auto-increment PKs to UUIDv7 text IDs 2026-05-26 07:11:45 +02:00
rate-limit.ts feat(server): rate limit (login + pair) + CSP/security headers 2026-05-14 07:40:22 +02:00
secrets.ts refactor: remove all process.env and envStr() from server code 2026-05-23 13:22:44 +02:00
snapshot.ts feat: multi-display + snapshot + health + GPIO + nodered embed 2026-05-13 01:18:22 +02:00
strip-secrets.ts feat: restructure Node-RED nodes + server event emission 2026-05-13 02:26:08 +02:00
tenant.ts refactor: decommission SQLite + add UUIDv7 PK migration for existing PG 2026-05-26 13:22:29 +02:00
types.ts feat: managed entities (read-only) + AbleSign auto-creates entity 2026-05-26 17:08:19 +02:00
version.ts fix: resolve merge conflict + align BSB workdir /home/bsb 2026-05-23 23:58:36 +02:00