chatai/supabase/gotrue/wrapper.sh

23 lines
735 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
set -euo pipefail
echo "[gotrue] Waiting for PostgREST on localhost:3000..."
# 等待 postgrest 启动就绪
until curl -s http://localhost:3000/ >/dev/null 2>&1; do
echo "[gotrue] Waiting..."
sleep 1
done
echo "[gotrue] PostgREST is ready. Starting GoTrue..."
# 必要环境变量(监听默认 127.0.0.1:9999 即可)
export GOTRUE_SITE_URL="http://localhost:3000"
export GOTRUE_JWT_SECRET="super-secret-jwt-token-with-at-least-32-characters-long"
export GOTRUE_DB_DRIVER="postgres"
export DATABASE_URL="postgres://supabase_admin:postgres@localhost:5432/postgres"
export API_EXTERNAL_URL="http://localhost:8000/auth/v1"
# 启动 GoTrue路径视你 build 的二进制实际位置)
exec /usr/local/bin/auth