Files
wish-pool/env.template
2025-08-01 13:17:32 +08:00

82 lines
2.9 KiB
Plaintext
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.

# 心願星河 - 環境變數配置模板
# 複製此文件為 .env.local 並填入實際值
# ================================
# Supabase 配置 (必需)
# ================================
# 從 Supabase Dashboard → Settings → API 獲取
NEXT_PUBLIC_SUPABASE_URL=https://your-project-id.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key-here
# ================================
# 應用程式 URL
# ================================
# 開發環境
NEXT_PUBLIC_APP_URL=http://localhost:3000
# 生產環境(部署到 Vercel 後修改)
# NEXT_PUBLIC_APP_URL=https://your-app-name.vercel.app
# ================================
# 管理功能 (可選)
# ================================
# 用於服務器端操作和管理功能
# 從 Supabase Dashboard → Settings → API → Service Role 獲取
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key-here
# ================================
# 分析和監控 (可選)
# ================================
# Google Analytics
# NEXT_PUBLIC_GOOGLE_ANALYTICS=GA_MEASUREMENT_ID
# Vercel Analytics
# NEXT_PUBLIC_VERCEL_ANALYTICS=true
# ================================
# IP 白名單控制 (可選)
# ================================
# 允許訪問的IP地址或IP範圍用逗號分隔
# 支援格式:
# - 單一IP: 192.168.1.100
# - IP範圍: 192.168.1.0/24
# - 多個IP: 192.168.1.100,10.0.0.50,172.16.0.0/16
# 留空表示允許所有IP訪問
# 範例:使用 allowed_ips.txt 中的IP地址
# ALLOWED_IPS=114.33.18.13,125.229.65.83,60.248.164.91,220.132.236.89,211.72.69.222,219.87.170.253,125.228.50.228
# 範例:本地開發(允許本地網路)
# ALLOWED_IPS=127.0.0.1,192.168.1.0/24,10.0.0.0/8
# 範例生產環境只允許特定IP
ALLOWED_IPS=114.33.18.13,125.229.65.83,60.248.164.91,220.132.236.89,211.72.69.222,219.87.170.253,125.228.50.228
# 是否啟用IP白名單檢查
# true: 啟用IP檢查不在白名單內的IP將被拒絕
# false: 禁用IP檢查允許所有IP訪問
ENABLE_IP_WHITELIST=true
# ================================
# 開發工具 (僅開發環境)
# ================================
# 啟用詳細日誌
# NEXT_PUBLIC_DEBUG=true
# ================================
# IP 白名單說明
# ================================
# 1. 本地開發時,建議設置 ENABLE_IP_WHITELIST=false 或包含 127.0.0.1
# 2. 生產環境部署後設置實際的IP地址並啟用白名單
# 3. 可以使用 /test/ip-debug 頁面測試IP檢測功能
# 4. IP檢測會自動處理代理伺服器轉發的真實IP
# 5. 支援 IPv4 和 CIDR 格式的IP範圍
# ================================
# 注意事項
# ================================
# 1. 只有以 NEXT_PUBLIC_ 開頭的變數可以在瀏覽器中訪問
# 2. 不要將 Service Role Key 暴露在客戶端代碼中
# 3. 部署到生產環境時,請更新 NEXT_PUBLIC_APP_URL
# 4. .env.local 文件已被 .gitignore 忽略,不會被提交到 Git
# 5. IP白名單功能僅在服務器端生效客戶端無法繞過此限制