# General Config
# NOTE: The service_role key is required as an authorization header for /admin endpoints

GOTRUE_JWT_SECRET="CHANGE-THIS! VERY IMPORTANT!"
GOTRUE_JWT_EXP="3600"
GOTRUE_JWT_AUD="authenticated"
GOTRUE_JWT_DEFAULT_GROUP_NAME="authenticated"
GOTRUE_JWT_ADMIN_ROLES="supabase_admin,service_role"

# Database & API connection details
GOTRUE_DB_DRIVER="postgres"
DB_NAMESPACE="auth"
DATABASE_URL="postgres://supabase_auth_admin:root@localhost:5432/postgres"
API_EXTERNAL_URL="http://localhost:9999"
GOTRUE_API_HOST="localhost"
PORT="9999"

# SMTP config (generate credentials for signup to work)
GOTRUE_SMTP_HOST=""
GOTRUE_SMTP_PORT="587"
GOTRUE_SMTP_USER=""
GOTRUE_SMTP_MAX_FREQUENCY="5s"
GOTRUE_SMTP_PASS=""
GOTRUE_SMTP_ADMIN_EMAIL=""
GOTRUE_SMTP_SENDER_NAME=""

# Mailer config
GOTRUE_MAILER_AUTOCONFIRM="true"
GOTRUE_MAILER_URLPATHS_CONFIRMATION="/verify"
GOTRUE_MAILER_URLPATHS_INVITE="/verify"
GOTRUE_MAILER_URLPATHS_RECOVERY="/verify"
GOTRUE_MAILER_URLPATHS_EMAIL_CHANGE="/verify"
GOTRUE_MAILER_SUBJECTS_CONFIRMATION="Confirm Your Email"
GOTRUE_MAILER_SUBJECTS_RECOVERY="Reset Your Password"
GOTRUE_MAILER_SUBJECTS_MAGIC_LINK="Your Magic Link"
GOTRUE_MAILER_SUBJECTS_EMAIL_CHANGE="Confirm Email Change"
GOTRUE_MAILER_SUBJECTS_INVITE="You have been invited"
GOTRUE_MAILER_SECURE_EMAIL_CHANGE_ENABLED="true"

# Custom mailer template config
GOTRUE_MAILER_TEMPLATES_INVITE=""
GOTRUE_MAILER_TEMPLATES_CONFIRMATION=""
GOTRUE_MAILER_TEMPLATES_RECOVERY=""
GOTRUE_MAILER_TEMPLATES_MAGIC_LINK=""
GOTRUE_MAILER_TEMPLATES_EMAIL_CHANGE=""

# Signup config
GOTRUE_DISABLE_SIGNUP="false"
GOTRUE_SITE_URL="http://localhost:3000"
GOTRUE_EXTERNAL_EMAIL_ENABLED="true"
GOTRUE_EXTERNAL_PHONE_ENABLED="true"
GOTRUE_EXTERNAL_IOS_BUNDLE_ID="com.supabase.auth"

# Whitelist redirect to URLs here, a comma separated list of URIs (e.g. "https://foo.example.com,https://*.foo.example.com,https://bar.example.com")
GOTRUE_URI_ALLOW_LIST="http://localhost:3000"

# Apple OAuth config
GOTRUE_EXTERNAL_APPLE_ENABLED="false"
GOTRUE_EXTERNAL_APPLE_CLIENT_ID=""
GOTRUE_EXTERNAL_APPLE_SECRET=""
GOTRUE_EXTERNAL_APPLE_REDIRECT_URI="http://localhost:9999/callback"

# Azure OAuth config
GOTRUE_EXTERNAL_AZURE_ENABLED="false"
GOTRUE_EXTERNAL_AZURE_CLIENT_ID=""
GOTRUE_EXTERNAL_AZURE_SECRET=""
GOTRUE_EXTERNAL_AZURE_REDIRECT_URI="https://localhost:9999/callback"

# Bitbucket OAuth config
GOTRUE_EXTERNAL_BITBUCKET_ENABLED="false"
GOTRUE_EXTERNAL_BITBUCKET_CLIENT_ID=""
GOTRUE_EXTERNAL_BITBUCKET_SECRET=""
GOTRUE_EXTERNAL_BITBUCKET_REDIRECT_URI="http://localhost:9999/callback"

# Discord OAuth config
GOTRUE_EXTERNAL_DISCORD_ENABLED="false"
GOTRUE_EXTERNAL_DISCORD_CLIENT_ID=""
GOTRUE_EXTERNAL_DISCORD_SECRET=""
GOTRUE_EXTERNAL_DISCORD_REDIRECT_URI="https://localhost:9999/callback"

# Facebook OAuth config
GOTRUE_EXTERNAL_FACEBOOK_ENABLED="false"
GOTRUE_EXTERNAL_FACEBOOK_CLIENT_ID=""
GOTRUE_EXTERNAL_FACEBOOK_SECRET=""
GOTRUE_EXTERNAL_FACEBOOK_REDIRECT_URI="https://localhost:9999/callback"

# Figma OAuth config
GOTRUE_EXTERNAL_FIGMA_ENABLED="false"
GOTRUE_EXTERNAL_FIGMA_CLIENT_ID=""
GOTRUE_EXTERNAL_FIGMA_SECRET=""
GOTRUE_EXTERNAL_FIGMA_REDIRECT_URI="https://localhost:9999/callback"

# Gitlab OAuth config
GOTRUE_EXTERNAL_GITLAB_ENABLED="false"
GOTRUE_EXTERNAL_GITLAB_CLIENT_ID=""
GOTRUE_EXTERNAL_GITLAB_SECRET=""
GOTRUE_EXTERNAL_GITLAB_REDIRECT_URI="http://localhost:9999/callback"

# Google OAuth config
GOTRUE_EXTERNAL_GOOGLE_ENABLED="false"
GOTRUE_EXTERNAL_GOOGLE_CLIENT_ID=""
GOTRUE_EXTERNAL_GOOGLE_SECRET=""
GOTRUE_EXTERNAL_GOOGLE_REDIRECT_URI="http://localhost:9999/callback"

# Github OAuth config
GOTRUE_EXTERNAL_GITHUB_ENABLED="false"
GOTRUE_EXTERNAL_GITHUB_CLIENT_ID=""
GOTRUE_EXTERNAL_GITHUB_SECRET=""
GOTRUE_EXTERNAL_GITHUB_REDIRECT_URI="http://localhost:9999/callback"

# Kakao OAuth config
GOTRUE_EXTERNAL_KAKAO_ENABLED="false"
GOTRUE_EXTERNAL_KAKAO_CLIENT_ID=""
GOTRUE_EXTERNAL_KAKAO_SECRET=""
GOTRUE_EXTERNAL_KAKAO_REDIRECT_URI="http://localhost:9999/callback"

# Notion OAuth config
GOTRUE_EXTERNAL_NOTION_ENABLED="false"
GOTRUE_EXTERNAL_NOTION_CLIENT_ID=""
GOTRUE_EXTERNAL_NOTION_SECRET=""
GOTRUE_EXTERNAL_NOTION_REDIRECT_URI="https://localhost:9999/callback"

# Twitter OAuth1 config
GOTRUE_EXTERNAL_TWITTER_ENABLED="false"
GOTRUE_EXTERNAL_TWITTER_CLIENT_ID=""
GOTRUE_EXTERNAL_TWITTER_SECRET=""
GOTRUE_EXTERNAL_TWITTER_REDIRECT_URI="http://localhost:9999/callback"

# Twitch OAuth config
GOTRUE_EXTERNAL_TWITCH_ENABLED="false"
GOTRUE_EXTERNAL_TWITCH_CLIENT_ID=""
GOTRUE_EXTERNAL_TWITCH_SECRET=""
GOTRUE_EXTERNAL_TWITCH_REDIRECT_URI="http://localhost:9999/callback"

# Spotify OAuth config
GOTRUE_EXTERNAL_SPOTIFY_ENABLED="false"
GOTRUE_EXTERNAL_SPOTIFY_CLIENT_ID=""
GOTRUE_EXTERNAL_SPOTIFY_SECRET=""
GOTRUE_EXTERNAL_SPOTIFY_REDIRECT_URI="http://localhost:9999/callback"

# Keycloak OAuth config
GOTRUE_EXTERNAL_KEYCLOAK_ENABLED="false"
GOTRUE_EXTERNAL_KEYCLOAK_CLIENT_ID=""
GOTRUE_EXTERNAL_KEYCLOAK_SECRET=""
GOTRUE_EXTERNAL_KEYCLOAK_REDIRECT_URI="http://localhost:9999/callback"
GOTRUE_EXTERNAL_KEYCLOAK_URL="https://keycloak.example.com/auth/realms/myrealm"

# Linkedin OAuth config
GOTRUE_EXTERNAL_LINKEDIN_ENABLED="true"
GOTRUE_EXTERNAL_LINKEDIN_CLIENT_ID=""
GOTRUE_EXTERNAL_LINKEDIN_SECRET=""

# Slack OAuth config
GOTRUE_EXTERNAL_SLACK_ENABLED="false"
GOTRUE_EXTERNAL_SLACK_CLIENT_ID=""
GOTRUE_EXTERNAL_SLACK_SECRET=""
GOTRUE_EXTERNAL_SLACK_REDIRECT_URI="http://localhost:9999/callback"

# WorkOS OAuth config
GOTRUE_EXTERNAL_WORKOS_ENABLED="true"
GOTRUE_EXTERNAL_WORKOS_CLIENT_ID=""
GOTRUE_EXTERNAL_WORKOS_SECRET=""
GOTRUE_EXTERNAL_WORKOS_REDIRECT_URI="http://localhost:9999/callback"

# Zoom OAuth config
GOTRUE_EXTERNAL_ZOOM_ENABLED="false"
GOTRUE_EXTERNAL_ZOOM_CLIENT_ID=""
GOTRUE_EXTERNAL_ZOOM_SECRET=""
GOTRUE_EXTERNAL_ZOOM_REDIRECT_URI="http://localhost:9999/callback"

# Anonymous auth config
GOTRUE_EXTERNAL_ANONYMOUS_USERS_ENABLED="false"

# PKCE Config
GOTRUE_EXTERNAL_FLOW_STATE_EXPIRY_DURATION="300s"

# Phone provider config
GOTRUE_SMS_AUTOCONFIRM="false"
GOTRUE_SMS_MAX_FREQUENCY="5s"
GOTRUE_SMS_OTP_EXP="6000"
GOTRUE_SMS_OTP_LENGTH="6"
GOTRUE_SMS_PROVIDER="twilio"
GOTRUE_SMS_TWILIO_ACCOUNT_SID=""
GOTRUE_SMS_TWILIO_AUTH_TOKEN=""
GOTRUE_SMS_TWILIO_MESSAGE_SERVICE_SID=""
GOTRUE_SMS_TEMPLATE="This is from supabase. Your code is {{ .Code }} ."
GOTRUE_SMS_MESSAGEBIRD_ACCESS_KEY=""
GOTRUE_SMS_MESSAGEBIRD_ORIGINATOR=""
GOTRUE_SMS_TEXTLOCAL_API_KEY=""
GOTRUE_SMS_TEXTLOCAL_SENDER=""
GOTRUE_SMS_VONAGE_API_KEY=""
GOTRUE_SMS_VONAGE_API_SECRET=""
GOTRUE_SMS_VONAGE_FROM=""

# Captcha config
GOTRUE_SECURITY_CAPTCHA_ENABLED="false"
GOTRUE_SECURITY_CAPTCHA_PROVIDER="hcaptcha"
GOTRUE_SECURITY_CAPTCHA_SECRET="0x0000000000000000000000000000000000000000"
GOTRUE_SECURITY_CAPTCHA_TIMEOUT="10s"
GOTRUE_SESSION_KEY=""

# SAML config
GOTRUE_EXTERNAL_SAML_ENABLED="true"
GOTRUE_EXTERNAL_SAML_METADATA_URL=""
GOTRUE_EXTERNAL_SAML_API_BASE="http://localhost:9999"
GOTRUE_EXTERNAL_SAML_NAME="auth0"
GOTRUE_EXTERNAL_SAML_SIGNING_CERT=""
GOTRUE_EXTERNAL_SAML_SIGNING_KEY=""

# Additional Security config
GOTRUE_LOG_LEVEL="debug"
GOTRUE_SECURITY_REFRESH_TOKEN_ROTATION_ENABLED="false"
GOTRUE_SECURITY_REFRESH_TOKEN_REUSE_INTERVAL="0"
GOTRUE_SECURITY_UPDATE_PASSWORD_REQUIRE_REAUTHENTICATION="false"
GOTRUE_OPERATOR_TOKEN="unused-operator-token"
GOTRUE_RATE_LIMIT_HEADER="X-Forwarded-For"
GOTRUE_RATE_LIMIT_EMAIL_SENT="100"

GOTRUE_MAX_VERIFIED_FACTORS=10

# Auth Hook Configuration
GOTRUE_HOOK_CUSTOM_ACCESS_TOKEN_ENABLED=false
GOTRUE_HOOK_CUSTOM_ACCESS_TOKEN_URI=""
# Only for HTTPS Hooks
GOTRUE_HOOK_CUSTOM_ACCESS_TOKEN_SECRET=""

GOTRUE_HOOK_CUSTOM_SMS_PROVIDER_ENABLED=false
GOTRUE_HOOK_CUSTOM_SMS_PROVIDER_URI=""
# Only for HTTPS Hooks
GOTRUE_HOOK_CUSTOM_SMS_PROVIDER_SECRET=""


# Test OTP Config
GOTRUE_SMS_TEST_OTP="<phone-1>:<otp-1>, <phone-2>:<otp-2>..."
GOTRUE_SMS_TEST_OTP_VALID_UNTIL="2050-01-01T01:00:00Z" # (e.g. 2023-09-29T08:14:06Z)
