chore(memory): LRN-052 rootless port restriction and permission trap, journal

This commit is contained in:
bchanot committed 2026-10-13 22:38:54 +02:00
1 parent 3e48b0d848
commit a8edd59059
2 files changed
+10

No files matched your search

+9
View File
@@ -394,3 +394,12 @@ Apply: R1 (worker loop keeps the same child), R2 (browser loader: fresh-instance
- Harness: writing any `.env*` file and `gitflow finish` (merge + push to develop) are refused by the auto-mode classifier; forks (full-context subagents) parallelise Rust vs TS tracks well when a contract-level doc (STORAGE.md) is written first.
- Real browser proof without a project dep: playwright-core in the scratchpad + cached `~/.cache/ms-playwright/chromium-*` via `executablePath`, Vite on a spare port with `VITE_SUPABASE_*`; `setInputFiles` exercises createImageBitmap + canvas for real (happy-dom cannot).
Apply: every Storage call in later steps (documents, logos), every `returns table` RPC, future pgTAP on service-role paths, R2+ gates.
## LRN-052 | 2026-10-13 | Restrict Supabase CLI ports under Docker rootless without sudo: daemon default ip + gateway; rootless file-permission trap
- Supabase CLI 2.120 publishes 54321-54324 with no host address and has no bind option in config.toml → Docker uses the daemon's default (`0.0.0.0` + `[::]`). Docker rootless reads `~/.config/docker/daemon.json`: `{"ip":"127.0.0.1"}` makes every address-less published port loopback-only, no sudo, no firewall (needs daemon restart + containers recreated: `pnpm db:stop && pnpm db:start`).
- Rootless publishing = rootlesskit listening sockets in the host netns → host INPUT/UFW rules DO apply (rootful Docker's DNAT bypasses UFW). Still prefer removing the listener over filtering it.
- Re-expose only what browsers need with a tiny nginx on the stack's network, published on the LAN address explicitly (`<ip>:54321`, `<ip>:54324`); `resolver 127.0.0.11` + variables in `proxy_pass` so a restarted stack is followed.
- Rootless bind mounts: a 600 file owned by the user is unreadable by the container's non-root user (subordinate uid) → nginx 500 "open() htpasswd failed (13)". Make hash-only files 644, keep clear secrets 600 outside the mount.
- Probing "closed" vs "open" with curl: exit 7 (refused) / 28 (timeout) = closed; a non-HTTP TCP service (PostgreSQL) gives exit 52/56 = OPEN. HTTP 000 alone proves nothing.
Apply: any DEV service exposure on this machine; future staging compose.