#!/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"