# Harbor Desk / 巡樓 — 本機／dev 部署環境
# 用法：cp deploy/.env.example deploy/.env.dev  再改密鑰
# 腳本讀：deploy/.env.dev（優先）或 deploy/.env

# ---------- 公開網域（瀏覽器、PublicBaseURL、信件連結）----------
PUBLIC_HOST=threads-tool.30cm.net
PUBLIC_WEB_BASE=https://threads-tool.30cm.net
# 頭像等公開前綴 = 同源 /haixun-assets（Vite proxy 或 nginx → MinIO）
HAIXUN_STORAGE_S3_PUBLIC_BASE_URL=https://threads-tool.30cm.net/haixun-assets

# ---------- Infra 埠（只綁 127.0.0.1）----------
MONGO_PORT=27017
REDIS_PORT=6379
MINIO_API_PORT=9000
MINIO_CONSOLE_PORT=9001
MAILPIT_SMTP_PORT=1025
MAILPIT_UI_PORT=8025

# ---------- Mongo ----------
MONGO_ROOT_USER=haixun
MONGO_ROOT_PASSWORD=CHANGE_ME_MONGO
MONGO_DATABASE=haixun
# gateway / migrate 用（密碼若含特殊字元請 URL-encode）
MONGO_URI=mongodb://haixun:CHANGE_ME_MONGO@127.0.0.1:27017/?authSource=admin
# golang-migrate 需要 URI 帶 database 名
MONGO_URL=mongodb://haixun:CHANGE_ME_MONGO@127.0.0.1:27017/haixun?authSource=admin
HAIXUN_MONGO_URI=mongodb://haixun:CHANGE_ME_MONGO@127.0.0.1:27017/?authSource=admin
HAIXUN_MONGO_DB=haixun

# ---------- Redis（monc 快取；必填 Pass）----------
REDIS_PASSWORD=CHANGE_ME_REDIS
HAIXUN_REDIS_ADDR=127.0.0.1:6379
HAIXUN_REDIS_PASSWORD=CHANGE_ME_REDIS
REDIS_NAMESPACE=haixun:dev:v1
# openssl rand -hex 32；不可與 JWT／BYOK encryption key 共用
AI_MODEL_CACHE_FINGERPRINT_SECRET=CHANGE_ME_AI_MODEL_CACHE_FINGERPRINT_SECRET

# ---------- Member BYOK AES-256-GCM（openssl rand -base64 32）----------
# 上線後需永久保留；gateway／worker 必須使用相同 key ID 與 key
MEMBER_SETTINGS_ENCRYPTION_KEY_ID=v1
MEMBER_SETTINGS_ENCRYPTION_KEY=CHANGE_ME_MEMBER_SETTINGS_ENCRYPTION_KEY

# ---------- MinIO（AccessKey 建議與 ROOT 相同）----------
MINIO_ROOT_USER=haixun
MINIO_ROOT_PASSWORD=CHANGE_ME_MINIO
HAIXUN_STORAGE_S3_ENDPOINT=http://127.0.0.1:9000
HAIXUN_STORAGE_S3_REGION=us-east-1
HAIXUN_STORAGE_S3_BUCKET=haixun-assets
HAIXUN_STORAGE_S3_ACCESS_KEY=haixun
HAIXUN_STORAGE_S3_SECRET_KEY=CHANGE_ME_MINIO
HAIXUN_STORAGE_S3_USE_PATH_STYLE=true

# ---------- JWT（gateway Auth.*）----------
# openssl rand -base64 48
AUTH_ACCESS_SECRET=CHANGE_ME_JWT_ACCESS
AUTH_REFRESH_SECRET=CHANGE_ME_JWT_REFRESH
HAIXUN_JWT_ACCESS_SECRET=CHANGE_ME_JWT_ACCESS
HAIXUN_JWT_REFRESH_SECRET=CHANGE_ME_JWT_REFRESH

# ---------- Stripe subscriptions ----------
# Disabled is startup-safe; billing endpoints return 503 until fully configured.
STRIPE_ENABLED=false
STRIPE_SECRET_KEY=
STRIPE_WEBHOOK_SECRET=
STRIPE_STARTER_PRICE_ID=
STRIPE_PRO_PRICE_ID=
STRIPE_SUCCESS_URL=https://threads-tool.30cm.net/app/usage/checkout?result=success&checkout_id={CHECKOUT_ID}&plan={PLAN_ID}
STRIPE_CANCEL_URL=https://threads-tool.30cm.net/app/usage/checkout?result=cancel&plan={PLAN_ID}
STRIPE_PORTAL_RETURN_URL=https://threads-tool.30cm.net/app/usage/plans

# ---------- Mail（dev → Mailpit）----------
HAIXUN_SMTP_HOST=127.0.0.1
HAIXUN_SMTP_PORT=1025
HAIXUN_SMTP_USERNAME=
HAIXUN_SMTP_PASSWORD=
HAIXUN_SMTP_FROM="Harbor Desk <noreply@haixun.local>"
MAIL_SENDER="Harbor Desk <noreply@haixun.local>"
PUBLIC_WEB_BASE=https://threads-tool.30cm.net

# ---------- App 埠 ----------
GATEWAY_PORT=8888
WEB_PORT=5173

# ---------- 相容別名（舊腳本）----------
HAIXUN_BACKEND_URL=http://127.0.0.1:8888
