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).
15 lines
974 B
Bash
Executable File
15 lines
974 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Vite dev server reachable from the private network, wired to the local
|
|
# Supabase stack by the DEV origin (scripts/dev-env.sh). Vite listens on every
|
|
# interface (apps/app/vite.config.ts server.host); HMR follows the page host.
|
|
# pnpm dev # http://<FAUNOSTEO_DEV_HOST>:5173
|
|
# pnpm dev:offline # no backend: the local tool alone
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")/.."
|
|
. scripts/dev-env.sh
|
|
anon="$(node_modules/.bin/supabase status -o env 2>/dev/null | sed -n 's/^ANON_KEY="\(.*\)"$/\1/p')"
|
|
[ -n "$anon" ] || { echo "dev: the local stack is not running (pnpm db:start), or use pnpm dev:offline" >&2; exit 1; }
|
|
echo "== app $FAUNOSTEO_DEV_SITE_URL api $FAUNOSTEO_DEV_API_URL studio $FAUNOSTEO_DEV_STUDIO_URL mailpit $FAUNOSTEO_DEV_MAILPIT_URL"
|
|
VITE_SUPABASE_URL="$FAUNOSTEO_DEV_API_URL" VITE_SUPABASE_ANON_KEY="$anon" \
|
|
exec node_modules/.bin/pnpm --filter @faunosteo/app exec vite --port 5173 --strictPort
|