Files
faunosteo/scripts/dev-env.sh
T
bchanot cdd43ac431 test(supabase): avatar e2e on the sandbox only, per-session seed secret
pnpm e2e:avatar is now an alias of pnpm db:sandbox avatar-e2e and the DEV
script scripts/avatar-e2e.sh is removed; the suite fails on any target but
the sandbox gateway and database; an occupied port 57800 stops the run before
anything starts. The sandbox replaces the seed accounts' DEV password by a
per-session secret.
2026-11-01 22:55:23 +01:00

28 lines
1.5 KiB
Bash

#!/usr/bin/env bash
# shellcheck shell=bash
# The one place the DEV origin is decided (docs/development/ENVIRONMENTS.md §2).
# Sourced by the wrappers (scripts/supabase.sh, scripts/dev.sh, scripts/db-sandbox.sh):
# every service the browser of another device must reach is addressed by the
# host's LAN address, never by 127.0.0.1 or localhost.
#
# FAUNOSTEO_DEV_HOST the address or name of this machine on the private network;
# unset = the first non-loopback IPv4 of the host; 127.0.0.1 for
# a host-only session. Never a production host.
#
# Exports FAUNOSTEO_DEV_HOST and the derived URLs read by supabase/config.toml
# (env() substitution) and by the Vite dev server.
if [ -z "${FAUNOSTEO_DEV_HOST:-}" ]; then
FAUNOSTEO_DEV_HOST="$(hostname -I 2>/dev/null | awk '{print $1}')"
[ -n "$FAUNOSTEO_DEV_HOST" ] || FAUNOSTEO_DEV_HOST=127.0.0.1
fi
case "$FAUNOSTEO_DEV_HOST" in
*faunosteo.com*) echo "dev-env: FAUNOSTEO_DEV_HOST must never be a production host ($FAUNOSTEO_DEV_HOST)" >&2; return 1 ;;
esac
export FAUNOSTEO_DEV_HOST
export FAUNOSTEO_DEV_API_ORIGIN="http://$FAUNOSTEO_DEV_HOST"
export FAUNOSTEO_DEV_API_URL="http://$FAUNOSTEO_DEV_HOST:54321"
export FAUNOSTEO_DEV_SITE_URL="http://$FAUNOSTEO_DEV_HOST:5173"
export FAUNOSTEO_DEV_STUDIO_URL="http://$FAUNOSTEO_DEV_HOST:54323"
# Mailpit for other devices goes through the DEV gateway (basic auth), never the raw 54324.
export FAUNOSTEO_DEV_MAILPIT_URL="http://$FAUNOSTEO_DEV_HOST:54325"