yangjianbo
d367d1cde6
Merge branch 'main' into test-sora
2026-02-09 20:40:09 +08:00
erio
fc095bf054
refactor: replace scope-level rate limiting with model-level rate limiting
...
Merge functional changes from develop branch:
- Remove AntigravityQuotaScope system (claude/gemini_text/gemini_image)
- Replace with per-model rate limiting using resolveAntigravityModelKey
- Remove model load statistics (IncrModelCallCount/GetModelLoadBatch)
- Simplify account selection to unified priority→load→LRU algorithm
- Remove SetAntigravityQuotaScopeLimit from AccountRepository
- Clean up scope-related UI indicators and API fields
2026-02-09 08:19:01 +08:00
Wesley Liddick
5fa93ebdc7
Merge pull request #519 from bayma888/feature/group-sort-order
...
feat(admin): 新增-分组管理自由拖拽排序功能
2026-02-08 18:00:22 +08:00
bayma888
bac9e2bfd5
feat(admin): add drag-and-drop group sort order
...
- 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
2026-02-08 16:53:45 +08:00
shaw
e4d74ae11d
feat(ui): 用户列表页显示当前并发数
...
优化 /admin/users 页面的并发数列,显示「当前/最大」格式,
参考 AccountCapacityCell 的设计风格。
- 后端 UserHandler 注入 ConcurrencyService,批量查询用户当前并发数
- 新增 UserConcurrencyCell 组件,支持颜色状态(空闲灰/使用中黄/满载红)
- 前端 AdminUser 类型添加 current_concurrency 字段
2026-02-08 16:44:51 +08:00
yangjianbo
fd43be8d0b
merge: 合并 main 分支到 test,解决 config 和 modelWhitelist 冲突
...
- config.go: 保留 Sora 配置,合入 SubscriptionCache 配置
- useModelWhitelist.ts: 同时保留 soraModels 和 antigravityModels
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-02-07 20:18:07 +08:00
erio
5e98445b22
feat(antigravity): comprehensive enhancements - model mapping, rate limiting, scheduling & ops
...
Key changes:
- Upgrade model mapping: Opus 4.5 → Opus 4.6-thinking with precise matching
- Unified rate limiting: scope-level → model-level with Redis snapshot sync
- Load-balanced scheduling by call count with smart retry mechanism
- Force cache billing support
- Model identity injection in prompts with leak prevention
- Thinking mode auto-handling (max_tokens/budget_tokens fix)
- Frontend: whitelist mode toggle, model mapping validation, status indicators
- Gemini session fallback with Redis Trie O(L) matching
- Ops: enhanced concurrency monitoring, account availability, retry logic
- Migration scripts: 049-051 for model mapping unification
2026-02-07 12:31:10 +08:00
LLLLLLiulei
7319122e92
merge upstream/main
2026-02-06 11:33:45 +08:00
yangjianbo
d8e405511e
Merge branch 'main' of https://github.com/mt21625457/aicodex2api
2026-02-06 06:56:23 +08:00
LLLLLLiulei
37047919ab
fix: harden import/export flow
2026-02-05 18:59:30 +08:00
LLLLLLiulei
b4bd46d067
feat: add data import/export bundle
2026-02-05 17:46:08 +08:00
shaw
2b192f7dca
feat: 支持用户专属分组倍率配置
2026-02-05 16:05:42 +08:00
shaw
49a3c43741
feat(auth): 实现 Refresh Token 机制
...
- 新增 Access Token + Refresh Token 双令牌认证
- 支持 Token 自动刷新和轮转
- 添加登出和撤销所有会话接口
- 前端实现无感刷新和主动刷新定时器
2026-02-05 12:42:54 +08:00
yangjianbo
de7ff902de
Merge branch 'main' into test
2026-02-04 20:35:09 +08:00
yangjianbo
377bffe281
Merge branch 'main' into test
2026-02-03 22:48:04 +08:00
Wesley Liddick
4cce21b125
Merge branch 'main' into main
2026-02-03 21:43:41 +08:00
bayma888
6146be1474
feat(api-key): add independent quota and expiration support
...
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
2026-02-03 19:49:31 +08:00
song
2220fd18ca
merge upstream main
2026-02-03 15:36:17 +08:00
Wesley Liddick
6e54eda41f
Merge pull request #464 from touwaeriol/pr/antigravity-scope-ratelimit
...
feat(antigravity): 支持按配额域(scope)级别限流
2026-02-03 15:02:15 +08:00
Wesley Liddick
df4c0adf0b
Merge pull request #463 from DuckyProject/feat/usage-records-codex-reasoning-effort
...
feat(usage): add reasoning effort column
2026-02-03 14:57:45 +08:00
ducky
53ee6383db
feat(usage): add reasoning effort column
2026-02-03 14:36:29 +08:00
liuxiongfeng
8824400c3e
feat(accounts): 账号列表显示 Antigravity scope 级别限流状态
...
- 后端 DTO 新增 scope_rate_limits 字段,从 extra 提取限流信息
- 前端状态列显示 scope 级限流徽章(Claude/Gemini/Image)
- 清除速率限制时同时清除账号级和 scope 级限流(已有实现)
Cherry-picked from slovx2/sub2api: 66f49b67
2026-02-03 14:25:30 +08:00
shuike
6c86501d11
feat: 增加邀请码注册功能
2026-02-03 13:38:44 +08:00
song
3ecadf4aad
chore: apply stashed changes
2026-02-02 22:20:08 +08:00
song
0170d19fa7
merge upstream main
2026-02-02 22:13:50 +08:00
liuxiongfeng
e1a4a7b8c0
feat(groups): 添加从其他分组复制账号功能
...
- 创建分组时可选择从已有分组复制账号
- 编辑分组时支持同步账号(全量替换操作)
- 仅允许选择相同平台的源分组
- 添加完整的数据校验:去重、自引用检查、平台一致性检查
- 前端支持多选源分组,带提示说明操作行为
2026-02-02 21:47:47 +08:00
yangjianbo
618a614cbf
feat(Sora): 完成Sora网关接入与媒体能力
...
新增 Sora 网关路由、账号调度与同步服务\n补充媒体代理与签名 URL、模型列表动态拉取\n完善计费配置、前端支持与相关测试
2026-01-31 20:22:22 +08:00
ducky
b7f69844e1
feat(announcements): add admin/user announcement system
...
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.
2026-01-30 16:45:04 +08:00
ducky
04a509d45e
feat(purchase): 增加购买订阅 iframe 页面与配置
...
- 新增 /purchase 页面(iframe + 新窗口兜底)
- 管理员系统设置可配置开关与URL
- 非 simple mode 才在侧边栏展示入口
2026-01-28 13:54:32 +08:00
song
877c17251d
feat(group): 添加 MCP XML 注入开关
...
- Group 新增 mcp_xml_inject 字段,控制 Antigravity 平台的 MCP XML 协议注入
- 默认启用,可在分组设置中关闭
- 修复 GetByKeyForAuth 遗漏查询 mcp_xml_inject 字段导致认证缓存值始终为 false 的问题
2026-01-27 13:09:56 +08:00
song
66f49b67d6
feat(accounts): 账号列表显示 Antigravity scope 级别限流状态
...
- 后端 DTO 新增 scope_rate_limits 字段,从 extra 提取限流信息
- 前端状态列显示 scope 级限流徽章(Claude/Gemini/Image)
- 清除速率限制时同时清除账号级和 scope 级限流(已有实现)
2026-01-27 11:04:41 +08:00
shaw
1245f07a2d
feat(auth): 实现 TOTP 双因素认证功能
...
新增功能:
- 支持 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
2026-01-26 09:19:53 +08:00
shaw
9cc8352593
feat(auth): 密码重置邮件队列化与限流优化
...
- 邮件发送改为异步队列处理,避免并发导致发送失败
- 新增 Email 维度限流(30秒冷却期),防止邮件轰炸
- Token 验证使用常量时间比较,防止时序攻击
- 重构代码消除冗余,提取公共验证逻辑
2026-01-24 22:55:28 +08:00
song
fd0370c07a
Add invalid-request fallback routing
2026-01-23 22:24:46 +08:00
shaw
192efb84a0
feat(promo-code): complete promo code feature implementation
...
- Add promo_code_enabled field to SystemSettings and PublicSettings DTOs
- Add promo code validation in registration flow
- Add admin settings UI for promo code configuration
- Add i18n translations for promo code feature
2026-01-20 15:56:26 +08:00
Wesley Liddick
e7bc62500b
Merge pull request #333 from whoismonay/main
...
fix: 普通用户接口移除管理员敏感字段透传
2026-01-19 21:35:51 +08:00
shaw
b1a980f344
feat: 添加隐藏CCS导入按钮的设置选项
...
在管理后台设置页面新增开关,允许管理员隐藏API Keys页面的"导入CCS"按钮
2026-01-19 19:25:16 +08:00
墨颜
00d9fbd220
fix(user): 普通用户接口不返回备注
...
- 用户侧 dto.User 移除 notes 字段,避免泄露管理员备注\n- 新增 dto.AdminUser 并调整 /admin/users 系列接口使用\n- 前端拆分 User/AdminUser,管理端用户页面使用 AdminUser\n- 更新契约测试:/api/v1/auth/me 响应不包含 notes
2026-01-19 19:23:51 +08:00
墨颜
4f4c9679bf
fix(groups): 用户分组不下发内部路由信息
...
- 普通用户 Group DTO 移除 model_routing/account_count/account_groups,避免泄露内部路由与账号信息\n- 新增 AdminGroup DTO,并仅在管理员分组接口返回完整字段\n- 前端拆分 Group/AdminGroup,管理端页面与 API 使用 AdminGroup\n- 增加 /api/v1/groups/available 契约测试,防止回归
2026-01-19 18:58:42 +08:00
墨颜
2f6f758670
fix(usage): 用户使用记录不下发账号计费倍率
...
- 将 usage log DTO 拆分为用户/管理员两类
- 用户接口不返回 account_rate_multiplier/ip_address/account
- 管理员接口保留管理员字段
- 补充契约测试防止回归
2026-01-19 17:05:42 +08:00
shaw
ccfeaeb22d
feat: 新增会话ID伪装功能,优化日志系统
...
- 新增 session_id_masking_enabled 配置,启用后将在15分钟内固定
metadata.user_id 中的 session ID
- TLS fingerprint 模块日志从自定义 debugLog 迁移到 slog
- main.go 添加 slog 初始化,根据 gin mode 设置日志级别
- 前端创建/编辑账号模态框添加会话ID伪装开关
- 多语言支持(中英文)
2026-01-19 10:22:13 +08:00
Wesley Liddick
0f8d42c577
Merge pull request #327 from mt21625457/main
...
feat(usage): 添加清理任务与统计过滤
2026-01-19 09:18:00 +08:00
shaw
9abda1bc59
feat(tls): 新增 TLS 指纹模拟功能
2026-01-18 20:08:40 +08:00
yangjianbo
bdc426a774
Merge branch 'main' into dev
2026-01-18 15:55:58 +08:00
yangjianbo
ef5a41057f
feat(usage): 添加清理任务与统计过滤
2026-01-18 10:52:18 +08:00
shaw
7379423325
feat: 添加5h窗口费用控制和会话数量限制
...
- 支持Anthropic OAuth/SetupToken账号的5h窗口费用阈值控制
- 支持账号级别的并发会话数量限制
- 使用Redis缓存窗口费用(30秒TTL)减少数据库压力
- 费用计算基于标准费用(不含账号倍率)
2026-01-16 23:36:52 +08:00
longgexx
19865b865f
feat(group): 添加分组级别模型路由配置功能
...
支持为分组配置模型路由规则,可以指定特定模型模式优先使用的账号列表。
- 新增 model_routing 字段存储路由配置(JSONB格式,支持通配符匹配)
- 新增 model_routing_enabled 字段控制是否启用路由
- 更新后端 handler/service/repository 支持路由配置的增删改查
- 更新前端 GroupsView 添加路由配置界面
- 添加数据库迁移脚本 040/041
2026-01-16 17:26:05 +08:00
LLLLLLiulei
aab44f9fc8
feat: add proxy geo location
2026-01-15 15:15:20 +08:00
LLLLLLiulei
87b4662993
Revert "feat: add proxy geo location"
...
This reverts commit 09c4f82927ddce1c9528c146a26457f53d02b034.
2026-01-15 15:01:50 +08:00
LLLLLLiulei
3a100339b9
feat: add proxy geo location
2026-01-15 15:01:50 +08:00