Files
eSIM-Tools/env.example
Abner 188d4af85a feat: 实现多提供商验证码系统,支持 Cloudflare Turnstile 和 Google reCAPTCHA
- 新增 CaptchaManager 类,统一管理 Turnstile 和 reCAPTCHA 验证码的初始化和 token 管理
- 扩展 BFF 代理支持多验证码提供商,根据配置自动切换验证逻辑
- 新增公共配置端点,动态下发验证码提供商配置到前端
- 重构 API 管理器,统一处理验证码 token 的头部和载荷注入
- 更新 CSP 策略,支持两种验证码服务的域名和资源
- 保留原有 Turnstile 功能的同时,支持 reCAPTCHA 作为备选方案
- 提供灵活的配置选项,可通过环境变量控制提供商开关和强制验证
2025-11-24 19:03:43 +08:00

41 lines
1.1 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.
# eSIM工具环境配置
# 服务器配置
NODE_ENV=development
PORT=3000
# API配置
GIFFGAFF_API_BASE=https://id.giffgaff.com
GIFFGAFF_PUBLIC_API_BASE=https://publicapi.giffgaff.com
SIMYO_API_BASE=https://appapi.simyo.nl
# 日志配置
LOG_LEVEL=info
# CORS配置
# 通用允许来源(本地 server.js 使用Netlify Functions 使用 ALLOWED_ORIGIN 环境变量
CORS_ORIGIN=*
ALLOWED_ORIGIN=https://esim.cosr.eu.org
# 验证码配置turnstile | recaptcha | off
CAPTCHA_PROVIDER=turnstile
# Cloudflare Turnstile 配置
TURNSTILE_SITE_KEY=
TURNSTILE_SECRET_KEY=
# 设为 false 可在紧急情况下跳过 BFF Turnstile 校验(默认 true
TURNSTILE_ENFORCE=true
# Google reCAPTCHA v2 配置CAPTCHA_PROVIDER=recaptcha 时必填)
RECAPTCHA_SITE_KEY=
RECAPTCHA_SECRET_KEY=
# 受保护函数访问密钥(要求调用方在 Header x-esim-key 或 body.authKey / ?authKey 携带匹配值)
# ⚠️ 必填Server 与 Functions/BFF 共享的访问密钥
# 🔐 生成强随机密钥: openssl rand -hex 32
# ❌ 禁止使用默认值或简单密码
ACCESS_KEY=
# 可选自定义API超时时间毫秒
API_TIMEOUT=30000