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:
1 parent
f5865f073f
commit
dd4c35c061
14 files changed
+228
-41
No files matched your search
@@ -55,6 +55,14 @@ like every other tool. Never install it globally.
|
||||
|
||||
## 3. Start, stop, reset
|
||||
|
||||
Every CLI call goes through `scripts/supabase.sh` (`pnpm db:*`, `pnpm supabase
|
||||
<args>`): it exports the DEV origin that `config.toml` reads with `env()`
|
||||
(`api.external_url`, `auth.site_url`, `studio.api_url`). A direct
|
||||
`node_modules/.bin/supabase start` would leave the literal `env(...)` text in
|
||||
GoTrue's mail links. Published ports (all interfaces): API 54321, PostgreSQL
|
||||
54322, Studio 54323, Mailpit 54324 (`ENVIRONMENTS.md` §3 for what each one
|
||||
exposes).
|
||||
|
||||
```bash
|
||||
pnpm db:start # supabase start: pulls images, applies migrations + seed, prints URLs and keys
|
||||
pnpm db:stop # supabase stop (keeps the volume)
|
||||
@@ -246,14 +254,19 @@ audit rows (bootstrap with null actor, grant by the owner).
|
||||
|
||||
## 9. Wiring the app
|
||||
|
||||
`.env` (Docker) or `apps/app/.env.local` (Vite dev):
|
||||
Development: `pnpm dev` (`scripts/dev.sh`) sets `VITE_SUPABASE_URL` to the DEV
|
||||
origin (`http://<FAUNOSTEO_DEV_HOST>:54321`, the LAN address of the machine:
|
||||
`ENVIRONMENTS.md` §2) and the anon key from `supabase status`; the app is
|
||||
served on `http://<host>:5173` for every device of the private network.
|
||||
`pnpm dev:offline` runs the local tool without backend. Docker deployments use
|
||||
`.env`:
|
||||
|
||||
```bash
|
||||
APP_SUPABASE_URL=http://127.0.0.1:54321 # VITE_SUPABASE_URL in dev
|
||||
APP_SUPABASE_ANON_KEY=<anon key> # VITE_SUPABASE_ANON_KEY in dev
|
||||
APP_SUPABASE_URL=<Supabase origin reachable by the browser>
|
||||
APP_SUPABASE_ANON_KEY=<anon key> # public by design
|
||||
```
|
||||
|
||||
Both empty (the default) keeps the app in its local-only mode:
|
||||
Both empty keeps the app in its local-only mode:
|
||||
`getSupabaseClient()` returns null, the auth screens show an "unavailable"
|
||||
notice and `/app` redirects to `/login`. `APP_AUTH_PROVIDERS` /
|
||||
`VITE_AUTH_PROVIDERS` (`google,apple`) lists the OAuth buttons to show.
|
||||
|
||||
Reference in new issue
Block a user