1. 05 Apr, 2026 1 commit
  2. 04 Apr, 2026 1 commit
  3. 31 Mar, 2026 1 commit
  4. 27 Mar, 2026 1 commit
    • shaw's avatar
      feat(tls-fingerprint): 新增 TLS 指纹 Profile 数据库管理及代码质量优化 · 1854050d
      shaw authored
      新增功能:
      - 新增 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 回调签名被错误替换的问题
      1854050d
  5. 20 Mar, 2026 1 commit
  6. 17 Mar, 2026 1 commit
    • Ethan0x0000's avatar
      feat(db): add upstream_model column to usage_logs · 51547fa2
      Ethan0x0000 authored
      Add nullable VARCHAR(100) column to record the actual model sent to upstream providers when model mapping is applied. NULL means no mapping — the requested model was used as-is.
      
      Includes migration, concurrent index for aggregation queries, Ent schema regeneration, and migration README correction (forward-only runner, not goose).
      51547fa2
  7. 07 Mar, 2026 2 commits
  8. 05 Mar, 2026 1 commit
  9. 03 Mar, 2026 1 commit
  10. 28 Feb, 2026 1 commit
  11. 22 Feb, 2026 1 commit
  12. 17 Feb, 2026 1 commit
  13. 12 Feb, 2026 1 commit
  14. 10 Feb, 2026 1 commit
  15. 08 Feb, 2026 1 commit
    • bayma888's avatar
      feat(admin): add drag-and-drop group sort order · bac9e2bf
      bayma888 authored
      - Add `sort_order` field to groups table with migration
      - Add `PUT /api/v1/admin/groups/sort-order` API for batch update
      - Implement drag-and-drop UI using vue-draggable-plus
      - All queries now order groups by sort_order
      - Add i18n support (en/zh) for sort-related UI text
      - Update test stubs to satisfy new interface methods
      bac9e2bf
  16. 05 Feb, 2026 1 commit
    • shaw's avatar
      feat: 新增全局错误透传规则功能 · 39e05a2d
      shaw authored
      支持管理员配置上游错误如何返回给客户端:
      - 新增 ErrorPassthroughRule 数据模型和 Ent Schema
      - 实现规则的 CRUD API(/admin/error-passthrough-rules)
      - 支持按错误码、关键词匹配,支持 any/all 匹配模式
      - 支持按平台过滤(anthropic/openai/gemini/antigravity)
      - 支持透传或自定义响应状态码和错误消息
      - 实现两级缓存(Redis + 本地内存)和多实例同步
      - 集成到 gateway_handler 的错误处理流程
      - 新增前端管理界面组件
      - 新增单元测试覆盖核心匹配逻辑
      
      优化:
      - 移除 refreshLocalCache 中的冗余排序(数据库已排序)
      - 后端 Validate() 增加匹配条件非空校验
      39e05a2d
  17. 03 Feb, 2026 1 commit
    • bayma888's avatar
      feat(api-key): add independent quota and expiration support · 6146be14
      bayma888 authored
      This feature allows API Keys to have their own quota limits and expiration
      times, independent of the user's balance.
      
      Backend:
      - Add quota, quota_used, expires_at fields to api_key schema
      - Implement IsExpired() and IsQuotaExhausted() checks in middleware
      - Add ResetQuota and ClearExpiration API endpoints
      - Integrate quota billing in gateway handlers (OpenAI, Anthropic, Gemini)
      - Include quota/expiration fields in auth cache for performance
      - Expiration check returns 403, quota exhausted returns 429
      
      Frontend:
      - Add quota and expiration inputs to key create/edit dialog
      - Add quick-select buttons for expiration (+7, +30, +90 days)
      - Add reset quota confirmation dialog
      - Add expires_at column to keys list
      - Add i18n translations for new features (en/zh)
      
      Migration:
      - Add 045_add_api_key_quota.sql for new columns
      6146be14
  18. 02 Feb, 2026 2 commits
  19. 31 Jan, 2026 1 commit
  20. 30 Jan, 2026 1 commit
    • ducky's avatar
      feat(announcements): add admin/user announcement system · b7f69844
      ducky authored
      Implements announcements end-to-end (admin CRUD + read status, user list + mark read) with OR-of-AND targeting. Also breaks the ent<->service import cycle by moving schema-facing constants/targeting into a new domain package.
      b7f69844
  21. 29 Jan, 2026 1 commit
    • yangjianbo's avatar
      feat(sora): 新增 Sora 平台支持并修复高危安全和性能问题 · 13262a56
      yangjianbo authored
      
      
      新增功能:
      - 新增 Sora 账号管理和 OAuth 认证
      - 新增 Sora 视频/图片生成 API 网关
      - 新增 Sora 任务调度和缓存机制
      - 新增 Sora 使用统计和计费支持
      - 前端增加 Sora 平台配置界面
      
      安全修复(代码审核):
      - [SEC-001] 限制媒体下载响应体大小(图片 20MB、视频 200MB),防止 DoS 攻击
      - [SEC-002] 限制 SDK API 响应大小(1MB),防止内存耗尽
      - [SEC-003] 修复 SSRF 风险,添加 URL 验证并强制使用代理配置
      
      BUG 修复(代码审核):
      - [BUG-001] 修复 for 循环内 defer 累积导致的资源泄漏
      - [BUG-002] 修复图片并发槽位获取失败时已持有锁未释放的永久泄漏
      
      性能优化(代码审核):
      - [PERF-001] 添加 Sentinel Token 缓存(3 分钟有效期),减少 PoW 计算开销
      
      技术细节:
      - 使用 io.LimitReader 限制所有外部输入的大小
      - 添加 urlvalidator 验证防止 SSRF 攻击
      - 使用 sync.Map 实现线程安全的包级缓存
      - 优化并发槽位管理,添加 releaseAll 模式防止泄漏
      
      影响范围:
      - 后端:新增 Sora 相关数据模型、服务、网关和管理接口
      - 前端:新增 Sora 平台配置、账号管理和监控界面
      - 配置:新增 Sora 相关配置项和环境变量
      Co-Authored-By: default avatarClaude Sonnet 4.5 <noreply@anthropic.com>
      13262a56
  22. 27 Jan, 2026 1 commit
    • song's avatar
      feat(group): 添加 MCP XML 注入开关 · 877c1725
      song authored
      - Group 新增 mcp_xml_inject 字段,控制 Antigravity 平台的 MCP XML 协议注入
      - 默认启用,可在分组设置中关闭
      - 修复 GetByKeyForAuth 遗漏查询 mcp_xml_inject 字段导致认证缓存值始终为 false 的问题
      877c1725
  23. 26 Jan, 2026 1 commit
    • shaw's avatar
      feat(auth): 实现 TOTP 双因素认证功能 · 1245f07a
      shaw authored
      新增功能:
      - 支持 Google Authenticator 等应用进行 TOTP 二次验证
      - 用户可在个人设置中启用/禁用 2FA
      - 登录时支持 TOTP 验证流程
      - 管理后台可全局开关 TOTP 功能
      
      安全增强:
      - TOTP 密钥使用 AES-256-GCM 加密存储
      - 添加 TOTP_ENCRYPTION_KEY 配置项,必须手动配置才能启用功能
      - 防止服务重启导致加密密钥变更使用户无法登录
      - 验证失败次数限制,防止暴力破解
      
      配置说明:
      - Docker 部署:在 .env 中设置 TOTP_ENCRYPTION_KEY
      - 非 Docker 部署:在 config.yaml 中设置 totp.encryption_key
      - 生成密钥命令:openssl rand -hex 32
      1245f07a
  24. 23 Jan, 2026 1 commit
  25. 18 Jan, 2026 1 commit
  26. 16 Jan, 2026 1 commit
    • longgexx's avatar
      feat(group): 添加分组级别模型路由配置功能 · 19865b86
      longgexx authored
        支持为分组配置模型路由规则,可以指定特定模型模式优先使用的账号列表。
      
        - 新增 model_routing 字段存储路由配置(JSONB格式,支持通配符匹配)
      
        - 新增 model_routing_enabled 字段控制是否启用路由
      
        - 更新后端 handler/service/repository 支持路由配置的增删改查
      
        - 更新前端 GroupsView 添加路由配置界面
      
        - 添加数据库迁移脚本 040/041
      19865b86
  27. 15 Jan, 2026 1 commit
  28. 14 Jan, 2026 1 commit
    • 墨颜's avatar
      feat(计费): 支持账号计费倍率快照与统计展示 · fb99ceac
      墨颜 authored
      - 新增 accounts.rate_multiplier(默认 1.0,允许 0)
      - 使用 usage_logs.account_rate_multiplier 记录倍率快照,避免历史回算
      - 统计/导出/管理端展示账号口径费用(total_cost * account_rate_multiplier)
      fb99ceac
  29. 10 Jan, 2026 1 commit
    • long's avatar
      feat: 实现注册优惠码功能 · d2fc14fb
      long authored
        - 支持创建/编辑/删除优惠码,设置赠送金额和使用限制
        - 注册页面实时验证优惠码并显示赠送金额
        - 支持 URL 参数自动填充 (?promo=CODE)
        - 添加优惠码验证接口速率限制
        - 使用数据库行锁防止并发超限
        - 新增后台优惠码管理页面,支持复制注册链接
      d2fc14fb
  30. 09 Jan, 2026 2 commits
    • Edric.Li's avatar
      feat(api-key): 添加 IP 白名单/黑名单限制功能 (#221) · 0a4641c2
      Edric.Li authored
      * feat(api-key): add IP whitelist/blacklist restriction and usage log IP tracking
      
      - Add IP restriction feature for API keys (whitelist/blacklist with CIDR support)
      - Add IP address logging to usage logs (admin-only visibility)
      - Remove billing_type column from usage logs UI (redundant)
      - Use generic "Access denied" error message for security
      
      Backend:
      - New ip package with IP/CIDR validation and matching utilities
      - Database migrations for ip_whitelist, ip_blacklist (api_keys) and ip_address (usage_logs)
      - Middleware IP restriction check after API key validation
      - Input validation for IP/CIDR patterns on create/update
      
      Frontend:
      - API key form with enable toggle for IP restriction
      - Shield icon indicator in table for keys with IP restriction
      - Removed billing_type filter and column from usage views
      
      * fix: update API contract tests for ip_whitelist/ip_blacklist fields
      
      Add ip_whitelist and ip_blacklist fields to expected JSON responses
      in API contract tests to match the new API key schema.
      0a4641c2
    • Edric Li's avatar
      feat(api-key): add IP whitelist/blacklist restriction and usage log IP tracking · 90798f14
      Edric Li authored
      - Add IP restriction feature for API keys (whitelist/blacklist with CIDR support)
      - Add IP address logging to usage logs (admin-only visibility)
      - Remove billing_type column from usage logs UI (redundant)
      - Use generic "Access denied" error message for security
      
      Backend:
      - New ip package with IP/CIDR validation and matching utilities
      - Database migrations for ip_whitelist, ip_blacklist (api_keys) and ip_address (usage_logs)
      - Middleware IP restriction check after API key validation
      - Input validation for IP/CIDR patterns on create/update
      
      Frontend:
      - API key form with enable toggle for IP restriction
      - Shield icon indicator in table for keys with IP restriction
      - Removed billing_type filter and column from usage views
      90798f14
  31. 08 Jan, 2026 1 commit
    • Edric Li's avatar
      feat(groups): add Claude Code client restriction and session isolation · a4210588
      Edric Li authored
      - Add claude_code_only field to restrict groups to Claude Code clients only
      - Add fallback_group_id for non-Claude Code requests to use alternate group
      - Implement ClaudeCodeValidator for User-Agent detection
      - Add group-level session binding isolation (groupID in Redis key)
      - Prevent cross-group sticky session pollution
      - Update frontend with Claude Code restriction controls
      a4210588
  32. 07 Jan, 2026 2 commits
  33. 05 Jan, 2026 2 commits
    • song's avatar
      feat: 图片生成计费功能 · d4c2b723
      song authored
      - 新增 Group 图片价格配置(image_price_1k/2k/4k)
      - BillingService 新增 CalculateImageCost 方法
      - AntigravityGatewayService 支持识别图片生成模型并按次计费
      - UsageLog 新增 image_count 和 image_size 字段
      - 前端分组管理支持配置图片价格(antigravity 和 gemini 平台)
      - 图片计费复用通用计费能力(余额检查、扣费、倍率、订阅限额)
      d4c2b723
    • LLLLLLiulei's avatar
      feat: add account notes field · 94750fb6
      LLLLLLiulei authored
      94750fb6
  34. 04 Jan, 2026 1 commit
    • IanShaw027's avatar
      fix(lint): 修复所有 Go 命名规范问题 · a4953785
      IanShaw027 authored
      - 全局替换 ApiKey → APIKey(类型、字段、方法、变量)
      - 修复所有 initialism 命名(API, SMTP, HTML, URL 等)
      - 添加所有缺失的包注释
      - 修复导出符号的注释格式
      
      主要修改:
      - ApiKey → APIKey(所有出现的地方)
      - ApiKeyID → APIKeyID
      - ApiKeyIDs → APIKeyIDs
      - TestSmtpConnection → TestSMTPConnection
      - HtmlURL → HTMLURL
      - 添加 20+ 个包注释
      - 修复 10+ 个导出符号注释格式
      
      验证结果:
      - ✓ golangci-lint: 0 issues
      - ✓ 单元测试: 通过
      - ✓ 集成测试: 通过
      a4953785
  35. 03 Jan, 2026 1 commit
    • ianshaw's avatar
      chore: 更新依赖、配置和代码生成 · 112a2d08
      ianshaw authored
      主要更新:
      - 更新 go.mod/go.sum 依赖
      - 重新生成 Ent ORM 代码
      - 更新 Wire 依赖注入配置
      - 添加 docker-compose.override.yml 到 .gitignore
      - 更新 README 文档(Simple Mode 说明和已知问题)
      - 清理调试日志
      - 其他代码优化和格式修复
      112a2d08