chore(supabase): LAN development — private-network redirect URLs for auth links, pnpm dev:lan (Vite on 0.0.0.0, Supabase by the host address)
This commit is contained in:
1 parent
0b9b9f0530
commit
edf1145c81
3 files changed
+19
No files matched your search
@@ -11,6 +11,7 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "pnpm --filter @faunosteo/app dev",
|
"dev": "pnpm --filter @faunosteo/app dev",
|
||||||
|
"dev:lan": "bash scripts/dev-lan.sh",
|
||||||
"preview": "pnpm --filter @faunosteo/app preview",
|
"preview": "pnpm --filter @faunosteo/app preview",
|
||||||
"build": "pnpm -r build",
|
"build": "pnpm -r build",
|
||||||
"typecheck": "pnpm -r typecheck",
|
"typecheck": "pnpm -r typecheck",
|
||||||
|
|||||||
Executable
+13
@@ -0,0 +1,13 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Vite dev server reachable from the LAN, wired to the local Supabase stack by the
|
||||||
|
# host's LAN address (the stack publishes 54321 / 54323 / 54324 on every interface).
|
||||||
|
# Usage: pnpm dev:lan [host-ip] (default: the first non-loopback IPv4 of this host)
|
||||||
|
set -euo pipefail
|
||||||
|
cd "$(dirname "$0")/.."
|
||||||
|
ip="${1:-$(hostname -I 2>/dev/null | awk '{print $1}')}"
|
||||||
|
[ -n "$ip" ] || { echo "dev-lan: pass the host IP as the first argument" >&2; exit 1; }
|
||||||
|
anon="$(node_modules/.bin/supabase status -o env 2>/dev/null | sed -n 's/^ANON_KEY="\(.*\)"$/\1/p')"
|
||||||
|
[ -n "$anon" ] || { echo "dev-lan: local stack not running (pnpm db:start)" >&2; exit 1; }
|
||||||
|
echo "== app http://$ip:5173 supabase http://$ip:54321 studio http://$ip:54323 mailpit http://$ip:54324"
|
||||||
|
VITE_SUPABASE_URL="http://$ip:54321" VITE_SUPABASE_ANON_KEY="$anon" \
|
||||||
|
exec node_modules/.bin/pnpm --filter @faunosteo/app exec vite --host 0.0.0.0 --port 5173
|
||||||
@@ -69,11 +69,16 @@ enabled = false
|
|||||||
enabled = true
|
enabled = true
|
||||||
# Vite dev server of apps/app
|
# Vite dev server of apps/app
|
||||||
site_url = "http://127.0.0.1:5173"
|
site_url = "http://127.0.0.1:5173"
|
||||||
|
# LAN access (pnpm dev:lan): confirmation and recovery links must land on the
|
||||||
|
# address the browser used, so every private-network host on :5173 is allowed.
|
||||||
additional_redirect_urls = [
|
additional_redirect_urls = [
|
||||||
"http://127.0.0.1:5173",
|
"http://127.0.0.1:5173",
|
||||||
"http://localhost:5173",
|
"http://localhost:5173",
|
||||||
"http://127.0.0.1:5173/**",
|
"http://127.0.0.1:5173/**",
|
||||||
"http://localhost:5173/**",
|
"http://localhost:5173/**",
|
||||||
|
"http://192.168.*.*:5173/**",
|
||||||
|
"http://10.*.*.*:5173/**",
|
||||||
|
"http://172.16.*.*:5173/**",
|
||||||
]
|
]
|
||||||
jwt_expiry = 3600
|
jwt_expiry = 3600
|
||||||
enable_refresh_token_rotation = true
|
enable_refresh_token_rotation = true
|
||||||
|
|||||||
Reference in new issue
Block a user