shaw
1854050df3
feat(tls-fingerprint): 新增 TLS 指纹 Profile 数据库管理及代码质量优化
...
新增功能:
- 新增 TLS 指纹 Profile CRUD 管理(Ent schema + 迁移 + Admin API + 前端管理界面)
- 支持账号绑定数据库中的自定义 TLS Profile,或随机选择(profile_id=-1)
- HTTPUpstream.DoWithTLS 接口从 bool 改为 *tlsfingerprint.Profile,支持按账号指定 Profile
- AccountUsageService 注入 TLSFingerprintProfileService,统一 usage 场景与网关的 Profile 解析逻辑
代码优化:
- 删除已被 TLSFingerprintProfileService 完全取代的 registry.go 死代码(418 行)
- 提取 3 个 dialer 的重复 TLS 握手逻辑为 performTLSHandshake() 共用函数
- 修复 GetTLSFingerprintProfileID 缺少 json.Number 处理的 bug
- gateway_service.Forward 中 ResolveTLSProfile 从重试循环内重复调用改为预解析局部变量
- 删除冗余的 buildClientHelloSpec() 单行 wrapper 和 int64(e.ID) 无效转换
- tls_fingerprint_profile_cache.go 日志从 log.Printf 改为 slog 结构化日志
- dialer_capture_test.go 添加 //go:build integration 标签,防止 CI 失败
- 去重 TestProfileExpectation 类型至共享 test_types_test.go
- 修复 9 个测试文件缺少 tlsfingerprint import 的编译错误
- 修复 error_policy_integration_test.go 中 handleError 回调签名被错误替换的问题
2026-03-27 14:33:05 +08:00
QTom
961c30e7c0
feat(admin): 分组管理列表新增用量列与账号数分类
...
分组管理列表增强:
1. 今日/累计用量列:
- 新增独立端点 GET /admin/groups/usage-summary
- 一次查询返回所有分组的今日费用和累计费用(actual_cost)
- 前端异步加载后合并显示在分组列表中
2. 账号数区分可用/限流/总量:
- 将账号数列从单一总量改为 badge 内多行展示
- 可用: active + schedulable 的账号数(绿色)
- 限流: rate_limit/overload/temp_unschedulable 的账号数(橙色,无限流时隐藏)
- 总量: 全部关联账号数
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-03-18 10:06:35 +08:00
ius
611fd884bd
feat: decouple billing correctness from usage log batching
2026-03-12 16:53:18 +08:00
erio
a88698f3fc
feat: cleanup stale concurrency slots on startup
...
When the service restarts, concurrency slots from the old process
remain in Redis, causing phantom occupancy. On startup, scan all
concurrency sorted sets and remove members with non-current process
prefix, then clear orphaned wait queue counters.
Uses Go-side SCAN to discover keys (compatible with Redis client
prefix hooks in tests), then passes them to a Lua script for
atomic member-level cleanup.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-03-09 19:55:18 +08:00
shaw
a3791104f9
feat: 支持后台设置是否启用整流开关
2026-03-07 21:55:38 +08:00
shaw
b8b5cec35c
fix: resolve CI lint errors and test compilation failures for rate limit feature
...
- Fix errcheck: properly handle rows.Close() error via named return + defer closure
- Fix gofmt: auto-format billing_cache.go, api_key_service.go, billing_cache_service.go
- Add missing rate limit interface methods to 4 test stubs (GetRateLimitData, IncrementRateLimitUsage, ResetRateLimitWindows)
- Fix NewBillingCacheService calls missing the new apiKeyRepo parameter
2026-03-03 15:43:08 +08:00
QTom
e135435ce2
fix: sync test constructor calls with new rpmCache parameter
...
Add missing nil argument for rpmCache to NewAccountHandler (5 sites)
and NewGatewayService (2 sites) after RPM feature expanded their
signatures.
2026-02-28 20:38:35 +08:00
yangjianbo
bb664d9bbf
feat(sync): full code sync from release
2026-02-28 15:01:20 +08:00
erio
86bc76e352
test: add warmup request interception unit tests
...
Add comprehensive tests for warmup request interception behavior
covering Antigravity accounts with various credential configurations.
2026-02-24 18:55:11 +08:00