chore(workspace): DEV origin on the private network — scripts/dev-env.sh (FAUNOSTEO_DEV_HOST detected or set), Supabase CLI wrapper, pnpm dev on the LAN address, config.toml URLs via env(); ENVIRONMENTS.md (identity Faunosteo / faunosteo.com, DEV / STAGING / PROD, exposure table, owner procedure)

The owner tests from other devices of the private network: every test
surface is addressed by the machine's LAN address, never 127.0.0.1 or
localhost, never hard-coded. scripts/dev-env.sh decides the host once
(hostname -I, FAUNOSTEO_DEV_HOST override, production hosts refused);
scripts/supabase.sh exports it for every CLI call (pnpm db:*, pnpm supabase)
because config.toml now reads api.external_url (mail links), auth.site_url
and studio.api_url with env(); scripts/dev.sh = pnpm dev on that origin,
pnpm dev:offline keeps the local tool alone; dev-lan.sh removed.
Verified: GoTrue API_EXTERNAL_URL and Studio SUPABASE_PUBLIC_URL on the LAN
address, a signup mail linking to http://<lan>:54321/auth/v1/verify, the
four published ports answering from a separate Docker network, and the
10-step procedure in headless Chromium at the LAN origin with every request
URL audited (no 127.0.0.1 / localhost).
This commit is contained in:
bchanot committed 2026-10-13 22:06:25 +02:00
1 parent f5865f073f
commit dd4c35c061
14 files changed
+228 -41

No files matched your search

+19 -4
View File
@@ -7,6 +7,8 @@
## Project overview
**Faunosteo** is the official, final product name (the SaaS, the application, the public site and its services); official domain **https://faunosteo.com** (production, separate VPS, the site present there is preserved until an explicit migration decision). Never propose another brand name; keep the logo, palette and validated mockups. Environments DEV / STAGING (`staging.faunosteo.com`, planned, not created) / PROD are isolated (`docs/development/ENVIRONMENTS.md`).
Single-praticien French web app for veterinary osteopathy bilans on animal anatomy SVGs.
Practitioner clicks anatomical zones, builds observations with pathologies/severity,
writes conclusion, and exports an A4 PDF. PDF carries the full JSON state as a native
@@ -71,8 +73,9 @@ access layer (see `docs/development/WORKSPACE.md`). Every command
below runs from the repository root and delegates to the packages.
```bash
# Development
pnpm dev
# Development (DEV origin = this machine's LAN address, scripts/dev-env.sh; tests run from other devices)
pnpm dev # Vite on http://<FAUNOSTEO_DEV_HOST>:5173 wired to the local stack (needs pnpm db:start)
pnpm dev:offline # the local tool without backend
# Production build (typecheck + vite build)
pnpm build
@@ -95,8 +98,9 @@ pnpm lint
# Format
pnpm format
# Supabase local stack (Docker) — docs/development/SUPABASE.md
pnpm db:start # start stack, apply migrations + seed
# Supabase local stack (Docker) — docs/development/SUPABASE.md; every CLI call goes through
# scripts/supabase.sh (exports the DEV origin that config.toml reads with env()); `pnpm supabase <args>`
pnpm db:start # start stack, apply migrations + seed; FAUNOSTEO_DEV_HOST=<ip> to pick another address
pnpm db:reset # replay from zero
pnpm db:test # pgTAP on the real stack
pnpm db:types # regenerate packages/supabase/src/database.types.ts
@@ -271,6 +275,7 @@ faunosteo/
│ ├─ wasm/ ← faunosteo-wasm: wasm-bindgen facade (core_version, call, R0 trap proofs)
│ └─ worker/ ← faunosteo-worker: plain main; `decode` sandboxed child (rlimits, seccomp allowlist, image → libwebp), parent Spawner + RIFF check; R1 `run` loop: config, log (JSON lines, allowlist), keys, backend trait + http (ureq, PostgREST rpc + Storage objects), job, sweep, watchdog; Dockerfile, scripts/derive-seccomp.sh
├─ scripts/{rust-env,rust-check,wasm-build,check-all,avatar-e2e}.sh ← native Rust gate, wasm build, the pre-merge gate (`pnpm check:all`), the real-stack avatar e2e
├─ scripts/{dev-env,supabase,dev}.sh ← the DEV origin (LAN address) in one place; CLI wrapper; `pnpm dev` on that origin
├─ docker-compose.yml ← `app` service; `worker` service under the `worker` profile (read-only, cap_drop ALL, external Supabase network, `.env.worker`)
├─ docker/rust-builder.Dockerfile, rust-run.sh, csp-proof/ ← reproducible Rust builder (alternative) + the CSP proof
├─ .gitea/workflows/ci.yml ← PREPARED, never executed (no runner): rust job (builder image, scripts/rust-check.sh, types drift, wasm), install, typecheck, test, lint, build, docker (app + worker test stage + runtime)
@@ -433,6 +438,16 @@ Database (Supabase)
operator scripts under `packages/*/scripts/` read it from the environment and are never bundled.
- pgTAP files run on PGlite and on the real image: scope counts to fixture ids, pin `collate "C"` on text ordering.
### Environments and LAN access (docs/development/ENVIRONMENTS.md)
- The owner tests from other devices of the private network, never on the Ubuntu machine: every test surface
(app, Supabase API, Mailpit, Studio) is addressed by the DEV origin (`scripts/dev-env.sh`, `FAUNOSTEO_DEV_HOST`),
never by `127.0.0.1` / `localhost`, never hard-coded in a source. The Supabase CLI runs only through
`scripts/supabase.sh` (`pnpm db:*`, `pnpm supabase`): config.toml reads the origin with `env()`.
- Exposure: 5173 and 54321 are what a remote browser needs; Studio 54323 and Mailpit 54324 are unauthenticated
admin tools for the private subnet only; PostgreSQL 54322 should not be reachable from the LAN (firewall =
owner decision); the worker publishes no port. Nothing is exposed to the Internet; no production infrastructure
is touched from this repository. Rust is built natively; Docker runs services, the worker, sandbox tests and images.
### Files and Storage (migration 20261013100000, docs/development/STORAGE.md)
- `public.assets` is the authority over every user file: status, owner, keys, lease. Every write is an RPC; the browser
reads its own rows through an explicit column list (`select=*` is refused: lease columns are not granted).