shaw
|
48c09b1286
|
feat: 优化SSL证书获取推荐和token刷新机制
- 将README中的certbot推荐改为acme.sh,更轻量且功能更强
- 中英文文档同步更新SSL证书获取方式
- 调整token刷新提前时间从10秒改为60秒,提供更充足的缓冲时间
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
|
2025-07-16 16:15:17 +08:00 |
|
shaw
|
59bc309ae4
|
fix: 修复 User-Agent 暴露问题并实现安全的 header 转发
- 移除硬编码的 'claude-relay-service/1.0.0' User-Agent,防止代理身份暴露
- 添加 _filterClientHeaders 方法过滤敏感请求头
- 实现完整的客户端 header 转发功能
- 默认 User-Agent 设置为 'claude-cli/1.0.53 (external, cli)'
- 过滤 x-api-key, authorization, host 等敏感 headers
- 更新所有 _makeClaudeRequest 方法支持 clientHeaders 参数
- 修改 API 路由传递 req.headers 到服务层
安全改进:
- 防止代理服务身份暴露
- 提升请求透明性和安全性
- 保持客户端原始请求特征
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
|
2025-07-16 16:01:11 +08:00 |
|
shaw
|
567e3b25aa
|
feat: 优化并发控制和移除冗余限制功能
主要改进:
1. 改进并发控制机制
- 使用 once 代替 on 避免重复监听
- 监听多个事件确保可靠性(close、finish)
- 支持客户端断开时立即释放并发槽位
2. 支持非流式请求的客户端断开处理
- 客户端断开时立即中断上游请求
- 避免资源浪费和不必要的 API 调用
3. 移除 requestLimit(请求数限制)功能
- 移除配置和验证逻辑
- 保留请求统计用于监控分析
4. 移除速率限制(Rate Limit)功能
- 移除 RATE_LIMIT_* 配置
- 简化中间件逻辑
- 避免与并发控制重复
现在系统仅保留:
- Token 使用量限制
- 并发数限制(更精确的资源控制)
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
|
2025-07-16 14:40:37 +08:00 |
|
shaw
|
f9bc2ddb23
|
fix: 优化 API Key 并发控制机制
- 调整并发计数器过期时间为3分钟,支持长时间流式请求
- 为流式响应添加客户端断开检测,确保计数正确减少
- 添加响应关闭和错误事件监听器,防止并发计数泄漏
- 提高系统稳定性和资源管理准确性
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
|
2025-07-16 11:10:44 +08:00 |
|
shaw
|
de0a2f685a
|
feat: 添加手动输入 Access Token 时的获取说明
- 在添加 Claude 账户时,选择手动输入方式会显示详细提示
- 说明 Access Token 应从 ~/.claude/.credentials.json 文件获取
- 明确提醒不要使用 Claude 官网 API Keys 页面的密钥
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
|
2025-07-16 11:08:26 +08:00 |
|
shaw
|
08f93e9872
|
fix: 修复并发计数器在请求异常时不能正确减少的问题
- 增强事件监听机制
- 监听 req 的 close 和 aborted 事件
- 监听 res 的 finish 和 error 事件
- 使用标志位确保只减少一次计数
- 改进日志记录
- 增加并发计数增减的详细日志
- 记录请求关闭和中断事件
- 确保计数器安全性
- 使用 Lua 脚本原子操作防止负数
- 优化 Redis 操作逻辑
- 增强管理界面
- API Keys 列表显示当前并发数
- 并发数超过 0 时用橙色标记
- 显示当前并发数/限制数格式
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
|
2025-07-16 10:21:17 +08:00 |
|
shaw
|
e2c9f26135
|
chore: 移除测试脚本和文档文件
- 删除 test-concurrency.js 测试脚本
- 删除 CONCURRENCY_CONTROL.md 文档
- 删除 API_KEY_EDIT_FEATURE.md 文档
保留核心功能代码,移除仅用于开发测试的文件
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
|
2025-07-16 09:48:39 +08:00 |
|
shaw
|
12b41ceb25
|
feat: 添加API Key并发控制和编辑功能
- 新增API Key并发控制功能
- 创建API Key时可设置并发限制(0为不限制)
- 在认证中间件中实现并发检查
- 使用Redis原子操作确保计数准确
- 添加自动清理机制处理异常情况
- 新增API Key编辑功能
- 支持修改Token限制和并发限制
- 前端添加编辑按钮和模态框
- 后端限制只能修改指定字段
- 其他改进
- 添加test-concurrency.js测试脚本
- 添加详细的功能说明文档
- 所有代码通过ESLint检查
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
|
2025-07-16 09:48:07 +08:00 |
|
Wesley Liddick
|
efa7048018
|
Merge pull request #8 from hst-Sunday/main
feat: 添加 Redis TLS 支持
|
2025-07-16 08:59:58 +08:00 |
|
sunday
|
36bf69adbb
|
feat: 添加 Redis TLS 支持
- 在 .env.example 中新增 REDIS_ENABLE_TLS 配置项
- 更新 config.example.js 以支持 TLS 连接
- 修改 RedisClient 类以根据配置启用或禁用 TLS
|
2025-07-16 02:52:21 +08:00 |
|
shaw
|
ec9847fa05
|
update readme
|
2025-07-15 22:57:41 +08:00 |
|
shaw
|
45a1832f6b
|
update readme
|
2025-07-15 22:25:09 +08:00 |
|
shaw
|
fbf942a5fd
|
feat: 支持手动添加 Claude 账户 Access Token
- 添加 OAuth 和手动输入两种账户添加方式
- 支持直接输入 Access Token 和 Refresh Token
- 新增账户编辑功能,可更新 Token 和代理设置
- 优化 Token 刷新失败时的回退机制
- 改进用户体验,支持手动维护长期有效的 Token
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
|
2025-07-15 19:28:14 +08:00 |
|
shaw
|
8f7d3fcadf
|
fix: 修复管理员会话键名冲突问题
- 恢复管理员会话管理的原始键名格式 session:${sessionId}
- 更改sticky会话映射使用独立前缀 sticky_session:${sessionHash}
- 避免sticky会话功能与管理后台会话冲突
- 添加sticky_session:*到cleanup清理模式
- 确保向后兼容性,管理后台功能正常
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
|
2025-07-15 18:43:32 +08:00 |
|
shaw
|
db8964d0f7
|
Merge remote-tracking branch 'origin/main' into dev
|
2025-07-15 18:18:11 +08:00 |
|
shaw
|
b2b8d8c719
|
feat: 添加智能sticky会话保持功能
- 新增 sessionHelper.js 实现会话哈希生成,基于Anthropic的prompt caching机制
- 扩展 claudeAccountService.selectAvailableAccount 支持会话绑定
- 更新 claudeRelayService 集成会话保持功能
- 添加 Redis 会话映射存储,支持1小时过期
- 支持故障转移:绑定账户不可用时自动重新选择
- 三级fallback策略:cacheable内容 → system内容 → 第一条消息
- 完全向后兼容,自动启用无需配置
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
|
2025-07-15 18:15:53 +08:00 |
|
Wesley Liddick
|
1b2f6454c5
|
Merge pull request #4 from Alfonsxh/bugfix/oauth-serialization
fix: 改进 OAuth 会话管理对象序列化
|
2025-07-15 18:14:50 +08:00 |
|
shaw
|
2257b42527
|
Modify the default timeout period
|
2025-07-15 18:00:52 +08:00 |
|
Alfonsxh
|
4946968577
|
fix: 改进 OAuth 会话管理对象序列化
- 在 setOAuthSession 中添加复杂对象序列化逻辑
- 在 getOAuthSession 中添加 proxy 字段反序列化
- 增强对 proxy 配置等复杂对象的存储支持
- 添加错误处理,解析失败时将 proxy 设为 null
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
|
2025-07-15 17:52:51 +08:00 |
|
shaw
|
f2af099e7d
|
update readme
|
2025-07-15 11:09:43 +08:00 |
|
shaw
|
1bbad561bb
|
update readme
|
2025-07-15 11:06:54 +08:00 |
|
shaw
|
beb0734fae
|
update readme
|
2025-07-15 11:04:14 +08:00 |
|
shaw
|
34a7a020a3
|
update readme
|
2025-07-15 11:03:09 +08:00 |
|
shaw
|
4c28f41878
|
add preview
|
2025-07-15 09:57:37 +08:00 |
|
shaw
|
fb06d71a3b
|
update README
|
2025-07-14 18:58:26 +08:00 |
|
shaw
|
d3f50607a3
|
update README
|
2025-07-14 18:46:58 +08:00 |
|
shaw
|
e89d89e3ef
|
update README
|
2025-07-14 18:45:30 +08:00 |
|
shaw
|
f224c63ed4
|
update README
|
2025-07-14 18:38:54 +08:00 |
|
shaw
|
2333cbb952
|
update README
|
2025-07-14 18:35:33 +08:00 |
|
shaw
|
baa0a58844
|
update README
|
2025-07-14 18:34:32 +08:00 |
|
shaw
|
69d4f8455c
|
add: LICENSE
|
2025-07-14 18:32:47 +08:00 |
|
shaw
|
4168a4182f
|
update README
|
2025-07-14 18:30:37 +08:00 |
|
shaw
|
2c4847f3f0
|
update README
|
2025-07-14 18:17:06 +08:00 |
|
shaw
|
b1ca3f307e
|
first commit
|
2025-07-14 18:14:13 +08:00 |
|
Wesley Liddick
|
a96a372011
|
Initial commit
|
2025-07-14 18:11:32 +08:00 |
|