homeos/config
HomeOS Bootstrap 71b3028a8e fix: harden MQTT sharing + input roles + dedup (adversarial review)
Multi-agent review (5 confirmed) + Codex found real issues in the rework:

- [P1 security] Shared `shelly` ACL had readwrite +/rpc, so a compromised
  device could inject Switch.Set into ANY other device's <prefix>/rpc. Now
  read-only on +/rpc (receive own commands) + write only homeos/rpc (reply).
  Broker-verified: a shelly publish to victim/rpc is denied; laravel's is not.
- [P2 security] `+` wildcard reaches reserved homeos/ring namespaces → bogus
  device. Ingest now rejects RESERVED_PREFIXES (homeos/ring/$SYS).
- [P2 security] Unbounded auto-onboarding = DB-exhaustion DoS. Added a device
  cap (homeos.mqtt.max_devices, default 250).
- [P2 correctness] Every Shelly `input` became a phantom window contact (wall
  switches shown as windows, possibly inverted). `input` is now a generic
  sensor; the user PROMOTES specific inputs to window/door contacts on the
  device page (invert-aware), stored in config->input_roles and applied in the
  ingest — this is the "assign contacts" flow the user asked for.
- [P3 ux] Motion pill read `active`; producer writes `on`. Now reads both.
- [P1 migrations] Dedup computed survivor keys once; 3+ duplicates could
  collide on unique(device_id,key). Re-query per duplicate (ring + mqtt_prefix).

+9 tests (reserved prefix, cap, input generic/promoted/inverted, demo echo).
Live-verified: input published → onboarded as input → assigned window contact
via UI → appears on Fenster page, persists across messages. Suite 57 green,
12/12 tabs clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-18 08:59:12 +02:00
..
app.php Phase 1: bootstrap — Docker stack, Laravel 13, design system, auth 2026-07-17 21:06:20 +02:00
auth.php Phase 1: bootstrap — Docker stack, Laravel 13, design system, auth 2026-07-17 21:06:20 +02:00
broadcasting.php Phase 1: bootstrap — Docker stack, Laravel 13, design system, auth 2026-07-17 21:06:20 +02:00
cache.php Phase 1: bootstrap — Docker stack, Laravel 13, design system, auth 2026-07-17 21:06:20 +02:00
database.php Phase 1: bootstrap — Docker stack, Laravel 13, design system, auth 2026-07-17 21:06:20 +02:00
filesystems.php Phase 1: bootstrap — Docker stack, Laravel 13, design system, auth 2026-07-17 21:06:20 +02:00
homeos.php fix: harden MQTT sharing + input roles + dedup (adversarial review) 2026-07-18 08:59:12 +02:00
horizon.php Phase 1: bootstrap — Docker stack, Laravel 13, design system, auth 2026-07-17 21:06:20 +02:00
logging.php Phase 1: bootstrap — Docker stack, Laravel 13, design system, auth 2026-07-17 21:06:20 +02:00
mail.php Phase 1: bootstrap — Docker stack, Laravel 13, design system, auth 2026-07-17 21:06:20 +02:00
mqtt-client.php Phase 3: MQTT ingest — Mosquitto bus, Shelly driver, live device state 2026-07-17 22:51:14 +02:00
queue.php Phase 1: bootstrap — Docker stack, Laravel 13, design system, auth 2026-07-17 21:06:20 +02:00
reverb.php Phase 1: bootstrap — Docker stack, Laravel 13, design system, auth 2026-07-17 21:06:20 +02:00
services.php Phase 5: UniFi presence — poll, person↔client mapping 2026-07-18 00:31:32 +02:00
session.php Phase 1: bootstrap — Docker stack, Laravel 13, design system, auth 2026-07-17 21:06:20 +02:00