gcx/backend/services/auth-service/.env.example

96 lines
3.8 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.

# ── Database ──
DB_HOST=localhost
DB_PORT=5432
DB_USERNAME=genex
DB_PASSWORD=genex_dev_password
DB_NAME=genex
# ── Redis ──
REDIS_HOST=localhost
REDIS_PORT=6379
# ── JWT ──
JWT_ACCESS_SECRET=dev-access-secret-change-in-production
JWT_ACCESS_EXPIRY=15m
JWT_REFRESH_SECRET=dev-refresh-secret-change-in-production
JWT_REFRESH_EXPIRY=7d
# ── SMS ──
SMS_ENABLED=false
SMS_CODE_EXPIRE_SECONDS=300
SMS_DAILY_LIMIT=10
SMS_MAX_VERIFY_ATTEMPTS=5
# ── Aliyun SMS (only when SMS_ENABLED=true) ──
# ALIYUN_ACCESS_KEY_ID=
# ALIYUN_ACCESS_KEY_SECRET=
# ALIYUN_SMS_SIGN_NAME=券金融
# ALIYUN_SMS_TEMPLATE_CODE=SMS_501745796
# ALIYUN_SMS_TPL_REGISTER=SMS_501745796
# ALIYUN_SMS_TPL_LOGIN=SMS_501720822
# ALIYUN_SMS_TPL_RESET_PASSWORD=SMS_501735781
# ALIYUN_SMS_TPL_CHANGE_PHONE=SMS_501925825
# ALIYUN_SMS_TPL_IDENTITY_VERIFY=SMS_501925825
# ALIYUN_SMS_TPL_TRANSACTION=SMS_501820752
# ALIYUN_SMS_TPL_PAYMENT=SMS_501855782
# ── Email (Gmail SMTP) ──
# EMAIL_ENABLED=true 时使用 Gmail 真实发送; false 时验证码打印到控制台
EMAIL_ENABLED=false
EMAIL_CODE_EXPIRE_SECONDS=300
EMAIL_DAILY_LIMIT=10
EMAIL_MAX_VERIFY_ATTEMPTS=5
# Gmail SMTP (only when EMAIL_ENABLED=true)
# 步骤Google 账号 → 安全性 → 开启两步验证 → 应用专用密码 → 选「邮件」→ 复制16位密码
# GMAIL_USER=noreply@gmail.com
# GMAIL_APP_PASSWORD=xxxxxxxxxxxxxx (16位填写时不含空格)
# EMAIL_FROM_NAME=Genex
# ── WeChat OAuth (微信开放平台移动应用) ──────────────────────────────────────
#
# 申请步骤(需企业资质,个人无法申请移动应用 OAuth
#
# 1. 注册/登录微信开放平台
# https://open.weixin.qq.com
# → 账号中心 → 开发者资质认证(年费 300 元,需营业执照/组织机构代码证)
#
# 2. 创建移动应用
# 管理中心 → 移动应用 → 创建移动应用
# 填写基本信息应用名称、简介、图标512×512 PNG无圆角
# 填写平台信息:
# Android — 应用包名: cn.gogenex.consumer
# 应用签名: release keystore 的 MD532位小写无冒号分隔
# 获取签名: keytool -exportcert -keystore release.jks \
# -alias release -storepass <密码> | md5sum
# iOS — Bundle ID: cn.gogenex.consumer
# 提交审核,等待 1-7 个工作日
#
# 3. 审核通过后在「应用详情」页面获取:
# AppID (16位wx 开头) — 填入 WECHAT_APP_ID客户端和服务端均需要
# AppSecret (32位) — 填入 WECHAT_APP_SECRET仅服务端使用严格保密
#
# 4. 启用 unionid强烈建议
# 开放平台 → 账号中心 → 公众号/小程序/移动应用 绑定到同一开放平台账号
# 绑定后,同一微信用户在所有绑定应用中 unionid 相同,可跨 App 识别用户
# 若不绑定,不同 App 下同一用户的 openid 不同,会注册出多个账号
#
# 5. Flutter 构建时传入 AppID在 Android Studio / Xcode / CI 脚本中配置):
# flutter build apk --dart-define=WECHAT_APP_ID=wx0000000000000000
# flutter build ipa --dart-define=WECHAT_APP_ID=wx0000000000000000
#
# 注意事项:
# - AppSecret 严禁写入客户端代码或提交到 Git只在服务端 .env 中配置
# - Android 发布正式版本时,签名 MD5 必须与申请时一致,否则微信授权失败
# - iOS Universal Links 需要在开放平台填写 https://www.gogenex.com/wechat/
# 并确保该 URL 可访问 apple-app-site-association 文件
#
# WECHAT_APP_ID=wx0000000000000000
# WECHAT_APP_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# ── Kafka (optional, events silently skipped if unavailable) ──
KAFKA_BROKERS=localhost:9092
# ── Service ──
PORT=3010