Commit Graph

384 Commits

Author SHA1 Message Date
f8af2f0ccc Merge pull request 'fix: git clone 前清理残留的 /tmp/camtalk-deploy 目录' (#167) from develop into v2
Some checks failed
Deploy / deploy (push) Failing after 3m57s
Reviewed-on: http://8.161.227.145:3000/XEngineers/CamTalk/pulls/167
2026-06-20 21:39:17 +08:00
d6059ae397 Merge pull request 'fix: git clone 前清理残留的 /tmp/camtalk-deploy 目录' (#166) from fix/actions into develop
Reviewed-on: http://8.161.227.145:3000/XEngineers/CamTalk/pulls/166
2026-06-20 21:39:02 +08:00
hhs
d4398e55fe fix: git clone 前清理残留的 /tmp/camtalk-deploy 目录 2026-06-20 21:38:30 +08:00
f5440c9e2d Merge pull request 'fix: 添加 rsync 安装,避免首次部署时 command not found' (#165) from develop into v2
Some checks failed
Deploy / deploy (push) Failing after 4m2s
Reviewed-on: http://8.161.227.145:3000/XEngineers/CamTalk/pulls/165
2026-06-20 21:33:39 +08:00
190f40908f Merge pull request 'fix: 添加 rsync 安装,避免首次部署时 command not found' (#164) from fix/actions into develop
Reviewed-on: http://8.161.227.145:3000/XEngineers/CamTalk/pulls/164
2026-06-20 21:33:23 +08:00
hhs
ddb90c58ef fix: 添加 rsync 安装,避免首次部署时 command not found 2026-06-20 21:32:57 +08:00
340c26b7a6 Merge pull request 'fix: 统一使用 /opt/camtalk/.env 路径,act_runner 挂载宿主机目录后直接读取' (#163) from develop into v2
Some checks failed
Deploy / deploy (push) Failing after 1s
Reviewed-on: http://8.161.227.145:3000/XEngineers/CamTalk/pulls/163
2026-06-20 21:32:05 +08:00
ca07188eda Merge pull request 'fix: 统一使用 /opt/camtalk/.env 路径,act_runner 挂载宿主机目录后直接读取' (#162) from fix/actions into develop
Reviewed-on: http://8.161.227.145:3000/XEngineers/CamTalk/pulls/162
2026-06-20 21:31:49 +08:00
hhs
15a50f855b fix: 统一使用 /opt/camtalk/.env 路径,act_runner 挂载宿主机目录后直接读取 2026-06-20 21:30:21 +08:00
f86c2560cd Merge pull request 'fix: env_file 使用绝对路径 /root/camtalk/.env,确保 CI 容器内 docker compose 正确解析' (#161) from develop into v2
All checks were successful
Deploy / deploy (push) Successful in 12s
Reviewed-on: http://8.161.227.145:3000/XEngineers/CamTalk/pulls/161
2026-06-20 20:58:51 +08:00
90c5ad7724 Merge pull request 'fix: env_file 使用绝对路径 /root/camtalk/.env,确保 CI 容器内 docker compose 正确解析' (#160) from fix/actions into develop
Reviewed-on: http://8.161.227.145:3000/XEngineers/CamTalk/pulls/160
2026-06-20 20:58:34 +08:00
hhs
45e2c4f37b fix: env_file 使用绝对路径 /root/camtalk/.env,确保 CI 容器内 docker compose 正确解析 2026-06-20 20:57:34 +08:00
b7d0edb6da Merge pull request 'docs: 更新架构设计和令牌桶限流相关文档' (#159) from develop into v2
All checks were successful
Deploy / deploy (push) Successful in 13s
Reviewed-on: http://8.161.227.145:3000/XEngineers/CamTalk/pulls/159
2026-06-20 20:54:51 +08:00
159bf278e6 Merge pull request 'docs: 添加令牌桶限流模块设计文档' (#158) from feature/ratelimite into develop
Reviewed-on: http://8.161.227.145:3000/XEngineers/CamTalk/pulls/158
2026-06-20 20:36:21 +08:00
542126df90 Merge pull request 'docs:更新文档' (#157) from feat/historychat into develop
Reviewed-on: http://8.161.227.145:3000/XEngineers/CamTalk/pulls/157
2026-06-20 20:20:59 +08:00
e56600e408 docs:更新文档 2026-06-20 20:17:16 +08:00
04215e7a53 Merge pull request 'feat: 优化对话历史功能、增加首页登录页面' (#156) from develop into v2
All checks were successful
Deploy / deploy (push) Successful in 32s
Reviewed-on: http://8.161.227.145:3000/XEngineers/CamTalk/pulls/156
2026-06-20 20:11:34 +08:00
9ba4eb4825 Merge pull request 'feat: 优化对话历史功能、增加首页登录页面' (#155) from feat/historychat into develop
Reviewed-on: http://8.161.227.145:3000/XEngineers/CamTalk/pulls/155
2026-06-20 20:06:39 +08:00
bc7eb7409c Merge pull request 'fix: 通过 docker run -v 桥接同步 /opt/camtalk/.env,每次部署自动获取最新配置' (#154) from develop into v2
All checks were successful
Deploy / deploy (push) Successful in 2m52s
Reviewed-on: http://8.161.227.145:3000/XEngineers/CamTalk/pulls/154
2026-06-20 20:05:28 +08:00
0a8a20f3f8 Merge pull request 'fix: 通过 docker run -v 桥接同步 /opt/camtalk/.env,每次部署自动获取最新配置' (#153) from fix/actions into develop
Reviewed-on: http://8.161.227.145:3000/XEngineers/CamTalk/pulls/153
2026-06-20 20:05:11 +08:00
hhs
e20f58b4ae fix: 通过 docker run -v 桥接同步 /opt/camtalk/.env,每次部署自动获取最新配置 2026-06-20 20:04:46 +08:00
ab07e01adf feat: 优化对话历史功能 2026-06-20 19:57:36 +08:00
0447fdacac Merge pull request 'fix: git fetch 改用公网 URL 而非 origin,避免 Docker 内网地址不可达导致卡死' (#152) from develop into v2
All checks were successful
Deploy / deploy (push) Successful in 15s
Reviewed-on: http://8.161.227.145:3000/XEngineers/CamTalk/pulls/152
2026-06-20 19:48:04 +08:00
12cf59f1e8 Merge pull request 'fix: git fetch 改用公网 URL 而非 origin,避免 Docker 内网地址不可达导致卡死' (#150) from fix/actions into develop
Reviewed-on: http://8.161.227.145:3000/XEngineers/CamTalk/pulls/150
2026-06-20 19:47:28 +08:00
hhs
4f735e6d29 fix: git fetch 改用公网 URL 而非 origin,避免 Docker 内网地址不可达导致卡死 2026-06-20 19:45:56 +08:00
32aea44f3b Merge pull request 'fix: env_file 改为相对路径,解决 CI 容器无法读取 /opt/camtalk/.env 的问题' (#149) from develop into v2
Some checks failed
Deploy / deploy (push) Has been cancelled
Reviewed-on: http://8.161.227.145:3000/XEngineers/CamTalk/pulls/149
2026-06-20 19:31:24 +08:00
4d51bcefb0 Merge pull request 'fix: env_file 改为相对路径,解决 CI 容器无法读取 /opt/camtalk/.env 的问题' (#148) from fix/actions into develop
Reviewed-on: http://8.161.227.145:3000/XEngineers/CamTalk/pulls/148
2026-06-20 19:31:10 +08:00
hhs
fe5ac20a1f fix: env_file 改为相对路径,解决 CI 容器无法读取 /opt/camtalk/.env 的问题 2026-06-20 19:29:12 +08:00
2a13ee9c89 Merge pull request 'fix: 精简 deploy.yml,checkout + ref + verify 三步确保拉取正确分支' (#147) from develop into v2
All checks were successful
Deploy / deploy (push) Successful in 2m12s
Reviewed-on: http://8.161.227.145:3000/XEngineers/CamTalk/pulls/147
2026-06-20 17:50:25 +08:00
df35ff73b5 Merge pull request 'fix: 精简 deploy.yml,checkout + ref + verify 三步确保拉取正确分支' (#146) from fix/actions into develop
Reviewed-on: http://8.161.227.145:3000/XEngineers/CamTalk/pulls/146
2026-06-20 17:50:08 +08:00
hhs
92e6636d05 fix: 精简 deploy.yml,checkout + ref + verify 三步确保拉取正确分支 2026-06-20 17:49:36 +08:00
hhs
12e2d24f37 fix: checkout 后显式 git fetch 切换触发分支,避免始终部署 main 代码;Dockerfile 添加 BuildKit cache mount 加速构建 2026-06-20 17:43:32 +08:00
ae100c4a75 Merge pull request 'fix: 恢复 checkout action 拉取代码,仅添加 ref 参数指定触发分支' (#145) from develop into v2
All checks were successful
Deploy / deploy (push) Successful in 2m10s
Reviewed-on: http://8.161.227.145:3000/XEngineers/CamTalk/pulls/145
2026-06-20 17:35:46 +08:00
4a5905307c Merge pull request 'fix: 恢复 checkout action 拉取代码,仅添加 ref 参数指定触发分支' (#144) from fix/actions into develop
Reviewed-on: http://8.161.227.145:3000/XEngineers/CamTalk/pulls/144
2026-06-20 17:35:30 +08:00
2a7d4c74d4 feat:增加首页登录页面 2026-06-20 17:35:14 +08:00
hhs
6bb4773e07 fix: 恢复 checkout action 拉取代码,仅添加 ref 参数指定触发分支 2026-06-20 17:33:59 +08:00
97e125234b Merge pull request 'fix: 完善鉴权模块,修复 CI/CD 中 dubious ownership 错误' (#143) from develop into v2
Some checks failed
Deploy / deploy (push) Has been cancelled
Reviewed-on: http://8.161.227.145:3000/XEngineers/CamTalk/pulls/143
2026-06-20 17:24:06 +08:00
hhs
39073b7673 fix: 添加 git safe.directory 配置,修复 CI/CD 中 dubious ownership 错误 2026-06-20 17:21:40 +08:00
hhs
85d47c1fc4 docs: 添加令牌桶限流模块设计文档
- 新建 docs/13-令牌桶限流设计.md,覆盖算法原理、内存/Redis 双实现、配置设计、接入点、测试用例等
- 更新 docs/01-架构设计.md Rate Limiter 模块行链接至新文档
- 更新 docs/README.md 文档索引和推荐阅读顺序
2026-06-20 17:08:23 +08:00
hhs
4ff8cec312 docs: 添加鉴权体系设计文档,更新认证相关文档
- 新增 12-鉴权体系设计.md,详细描述 JWT 双 token 轮转认证机制
- 更新架构设计文档,补充认证设计章节的安全机制和配置说明
- 更新接口文档,补充 Refresh Token Rotation 安全机制和前端集成示例
- 更新文档索引,添加新文档的推荐阅读顺序
2026-06-20 16:51:03 +08:00
3572b867c0 Merge pull request 'feat: 完善鉴权模块' (#142) from fix/auth into develop
Reviewed-on: http://8.161.227.145:3000/XEngineers/CamTalk/pulls/142
2026-06-20 16:34:47 +08:00
dfed964f76 Merge pull request 'fix: CI/CD 改用 git clone 直接拉取代码,避免 rsync 同步失败' (#141) from develop into v2
Some checks failed
Deploy / deploy (push) Has been cancelled
Reviewed-on: http://8.161.227.145:3000/XEngineers/CamTalk/pulls/141
2026-06-20 16:25:23 +08:00
hhs
4651ae185b fix: CI/CD 改用 git clone 直接拉取代码,避免 rsync 同步失败 2026-06-20 16:23:59 +08:00
1c65433d40 Merge pull request 'fix: checkout 指定触发分支,避免始终拉取 main 代码' (#140) from develop into v2
All checks were successful
Deploy / deploy (push) Successful in 16s
Reviewed-on: http://8.161.227.145:3000/XEngineers/CamTalk/pulls/140
2026-06-20 15:51:41 +08:00
hhs
590c4592ea fix: checkout 指定触发分支,避免始终拉取 main 代码 2026-06-20 15:51:14 +08:00
15cd157f45 Merge pull request 'feat: 对话场景优化' (#139) from develop into v2
All checks were successful
Deploy / deploy (push) Successful in 24s
Reviewed-on: http://8.161.227.145:3000/XEngineers/CamTalk/pulls/139
2026-06-20 15:18:38 +08:00
hhs
970f10a274 fix: 修复前端 lint 错误 — 移除 ref 模式,用 useEffect 依赖注入回调
- api.ts: 移除 catch 中未使用的 err 变量
- auth.tsx: 去掉 useRef 模式,直接在 useEffect 中注册回调并声明依赖
2026-06-20 15:07:09 +08:00
hhs
d78cdb509d feat: 前端 401 拦截器 — access token 过期时自动刷新并重试原请求
api.ts:
- 增加 setAuthCallbacks 回调注入机制(避免 api/auth 循环依赖)
- request() 对非公开路径自动附加 Authorization header
- 收到 401 时自动触发 refresh token 刷新,成功后重试原请求
- 并发保护:多个 401 只触发一次 refresh,其余等待同一 Promise
- refreshTokenDirect 内部方法绕过 401 拦截避免递归

auth.tsx:
- 用 ref 保存 persistAuth/scheduleRefresh 最新引用(避免闭包陈旧)
- 初始化时调用 setAuthCallbacks 注入认证回调
2026-06-20 14:57:27 +08:00
hhs
ea70d2efc6 feat: main.go 注入 Redis 到 CachedUserRepository,启用 refresh token 二级缓存
- 将 rdb 变量提升到外层作用域,供 session 和 auth 共用
- Redis 启用时用 CachedUserRepository 包装 userRepo
- backfillTTL 使用 cfg.Auth.RefreshTTL 与 token 实际过期时间一致
2026-06-20 14:54:08 +08:00
hhs
a2a28a9f56 feat: CachedUserRepository — refresh token 的 Redis 缓存装饰器
- 装饰 UserRepository,仅缓存 refresh token 相关操作
- SaveRefreshToken: Write-Through,先写 DB 再写 Redis(SET + SADD)
- FindRefreshToken: Read-Through,Redis miss 时查 DB 并回填
- DeleteRefreshToken: 双删 DB + Redis
- DeleteUserRefreshTokens: 通过 Redis Set 批量清理缓存后删 DB
- Redis 操作失败时降级到纯 DB,不阻断主流程
2026-06-20 14:53:10 +08:00