feat: 登录/注册接入 tianai-captcha 人机行为验证
- 后端: auth/captcha.ts 二次核验(secondary-verify 一次性核销), login/register 前置校验, TAC_ENABLED 开关 - 前端: useCaptcha hook(React 版), AuthModal 验证按钮(通过变绿), verifyToken 随提交携带, 失败/切换自动重置 - nginx: /tac/api/ 同源反代 prod1:18200; public/tac/ 静态资源(load.min.js + sdk) - 复用 HomeCentral 站点凭证(平台不校验域名, 已从源码确认) - 本地开发 .env.development 关闭验证; 测试环境 compose 注入 TAC_* 全开 - prod1 DOCKER_USER 链已加 .86 白名单(运行时+持久化)
This commit is contained in:
1 parent
ef9b95f85c
commit
7c3d2cfdef
19 files changed
+350
-22
No files matched your search
@@ -16,6 +16,11 @@ upstream backend {
|
||||
server server:8788;
|
||||
}
|
||||
|
||||
upstream captcha-platform {
|
||||
# tianai-captcha 自托管平台(prod1),安全组仅放行本服务器 IP
|
||||
server 38.76.218.110:18200;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80 default_server;
|
||||
server_name _;
|
||||
@@ -85,6 +90,17 @@ server {
|
||||
proxy_buffering off;
|
||||
}
|
||||
|
||||
# ── TAC 人机验证:同源反代 → tianai-captcha 平台(generate/verify 用 X-Site-Key 头) ──
|
||||
location /tac/api/ {
|
||||
proxy_pass http://captcha-platform;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_read_timeout 15s;
|
||||
proxy_send_timeout 15s;
|
||||
}
|
||||
|
||||
# ── 健康检查端点 ──
|
||||
location = /healthz {
|
||||
access_log off;
|
||||
|
||||
Reference in new issue
Block a user