Commit Graph
360 Commits
Author SHA1 Message Date
erio 7a5b9cffe5 chore: bump version to 0.1.99.2 2026-03-14 22:51:41 +08:00
erio 085c0d7e17 chore: bump version to 0.1.99.1 2026-03-14 21:03:20 +08:00
erio 25a0030450 Merge branch 'main' into release/custom-0.1.99
# Conflicts:
#	backend/cmd/server/wire_gen.go
#	backend/cmd/server/wire_gen_test.go
#	backend/internal/handler/dto/mappers.go
#	backend/internal/service/ratelimit_service.go
#	backend/internal/service/ratelimit_service_401_db_fallback_test.go
#	backend/internal/service/ratelimit_service_401_test.go
#	frontend/src/components/account/AccountCapacityCell.vue
#	frontend/src/components/account/CreateAccountModal.vue
#	frontend/src/components/account/EditAccountModal.vue
#	frontend/src/views/admin/DataManagementView.vue
2026-03-14 21:03:09 +08:00
Wesley Liddick aa4e37d085 Merge pull request #966 from GuangYiDing/feat/db-backup-restore
feat: 数据库定时备份与恢复(S3 兼容存储,支持 Cloudflare R2)
2026-03-14 18:58:56 +08:00
Rose DingandClaude Opus 4.6 1047f973d5 fix: 按 review 意见重构数据库备份服务(安全性 + 架构 + 健壮性)
1. S3 凭证加密存储:使用 SecretEncryptor (AES-256-GCM) 加密 SecretAccessKey,
   防止备份文件中泄露 S3 凭证,兼容旧的未加密数据
2. 修复 saveRecord 竞态条件:添加 recordsMu 互斥锁保护 records 的 load/save
3. 恢复操作增加服务端验证:handler 层要求重新输入管理员密码,通过 bcrypt
   校验,前端弹出密码输入框
4. pg_dump/psql/S3 操作抽象为接口:定义 DBDumper 和 BackupObjectStore 接口,
   实现放入 repository 层,遵循项目依赖注入架构规范
5. 改为流式处理避免大数据库 OOM:备份时 pg_dump stdout -> gzip -> io.Pipe ->
   S3 upload;恢复时 S3 download -> gzip reader -> psql stdin,不再全量加载
6. loadRecords 区分"无数据"和"数据损坏"场景:JSON 解析失败返回明确错误
7. 添加 18 个核心逻辑单元测试:覆盖加密、并发、流式备份/恢复、错误处理等

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 17:48:21 +08:00
erio 11cb34e56e chore: bump version to 0.1.98.1 2026-03-14 14:10:40 +08:00
erio 4e149109de chore: bump version to 0.1.97.1 2026-03-14 14:07:42 +08:00
erio 5e0a508eca Merge branch 'main' into release/custom-0.1.97
# Conflicts:
#	README.md
#	README_CN.md
#	backend/internal/handler/gateway_handler.go
#	backend/internal/repository/user_group_rate_repo.go
#	backend/internal/service/admin_service_group_rate_test.go
#	backend/internal/service/gateway_service.go
#	frontend/src/components/account/CreateAccountModal.vue
#	frontend/src/views/admin/AccountsView.vue
2026-03-14 14:07:05 +08:00
Wesley Liddick 07bb2a5f3f Merge pull request #952 from xvhuan/feat/billing-ledger-decouple-usage-log-20260312
feat: 解耦计费正确性与 usage_logs 批量写压
2026-03-13 22:46:09 +08:00
erio 7ab8181436 feat(redeem): support subscription type in create-and-redeem API
Add group_id and validity_days fields to CreateAndRedeemCodeRequest for
subscription redemption. Type defaults to "balance" for backward
compatibility with existing callers that don't send the type field.
2026-03-13 21:16:00 +08:00
erio 9618518680 chore: bump version to 0.1.96.10 2026-03-13 19:37:14 +08:00
Rose DingandClaude Opus 4.6 875b417fde fix: 补充 wire_gen_test.go 中 provideCleanup 缺少的 backupSvc 参数
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 11:53:46 +08:00
Rose DingandClaude Opus 4.6 53ad1645cf feat: 数据库定时备份与恢复(S3 兼容存储,支持 Cloudflare R2)
新增管理员专属的数据库备份与恢复功能:
- 全量 PostgreSQL 备份(pg_dump),gzip 压缩后上传到 S3 兼容存储
- 支持手动备份和 cron 定时备份
- 支持从备份恢复(psql --single-transaction)
- 备份文件自动过期清理(默认 14 天)
- 前端完整管理页面(S3 配置、定时配置、备份列表、恢复/下载/删除)
- 内置 Cloudflare R2 配置教程弹窗
- Dockerfile 从 postgres 镜像多阶段复制 pg_dump/psql,确保版本一致

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 10:38:19 +08:00
erio bf91dfe2fe chore: remove clear-all confirm dialog, bump to 0.1.96.9 2026-03-12 23:00:16 +08:00
erio 0c5ddb127b feat(groups): improve rate modal bottom bar with revert and close buttons
- Always show close button at bottom
- Add "revert changes" link when dirty
- Save now closes dialog on success
- Button styles match group edit dialog

chore: bump version to 0.1.96.8
2026-03-12 22:36:43 +08:00
erio 045e1eb50d chore: bump version to 0.1.96.7 2026-03-12 22:26:51 +08:00
erio c226438a04 merge: integrate release/custom-0.1.94 customizations into 0.1.96
Recovers features lost during 0.1.91->0.1.95 merge (0.1.92-0.1.94
customizations were skipped because main branch was not updated).

Recovered features:
- Antigravity 403 forbidden/validation/ban status detection and display
- Subscription tier badge in account list
- Client affinity scheduling for Anthropic accounts
- Sora async task API and GDrive storage backend
- Swipe-to-select for admin tables
- OpenAI passthrough account selection fix
- Various quota and usage enhancements
2026-03-12 22:23:31 +08:00
QTom a63de12182 feat: GPT 隐私模式 + no-train 前端展示优化 2026-03-12 21:24:01 +08:00
erio 034deebb2f feat(groups): add platform brand colors to rate multipliers modal icon
chore: bump version to 0.1.96.6
2026-03-12 20:51:56 +08:00
erio fe4468516f feat(groups): local edit mode with cancel/save for rate multipliers
- Rate column is now editable input (local state, not auto-saved)
- Add/delete/clear-all are local operations until Save is clicked
- Batch adjust shows "最终倍率" preview column before applying
- Bottom cancel/save bar appears when there are unsaved changes
- Save sends all entries at once via batch API
2026-03-12 20:24:37 +08:00
erio 979e1c1bf5 feat(groups): batch adjust rate multipliers with global factor
- Add PUT /admin/groups/:id/rate-multipliers batch endpoint
- Add batch adjust UI: multiply all rates by a factor (e.g., ×0.5 to halve, ×2 to restore)
- Remove inline rate editing (blur-save), rates now display as read-only
- Backend: SyncGroupRateMultipliers repo method (delete + batch upsert)
2026-03-12 19:57:12 +08:00
erio 5e98771cf7 feat(groups): move clear-all button, always show pagination
- Move clear-all button next to add button
- Always show pagination bar (not hidden when entries <= pageSize)
- Change page size options to 10/20/50, default 10
2026-03-12 19:25:28 +08:00
erio b148e11d6c feat(groups): improve rate multipliers modal UI
- Move email column to first position
- Add sticky table header with scrollable body
- Add page size selector (20/50/100)
- Use ConfirmDialog for clear all confirmation
- Disable browser autocomplete on inputs
- Enlarge clear all button styling
2026-03-12 19:16:03 +08:00
erio cdddbec629 chore: bump version to 0.1.96.1 2026-03-12 18:13:28 +08:00
ius 611fd884bd feat: decouple billing correctness from usage log batching 2026-03-12 16:53:18 +08:00
erio 5f6e929d61 chore: bump version to 0.1.95.1 2026-03-11 03:24:05 +08:00
erio 4caa3c2701 merge: integrate upstream v0.1.95 with our customizations
Merge main (custom features) into release/custom-0.1.95 (upstream v0.1.95).
New upstream features: group subscription binding, multi-dimension quota (daily/weekly/total),
allow_messages_dispatch, default_mapped_model, recover state API.
Our customizations: simulate_claude_max_enabled, usage status detection, 403 validation handling.
2026-03-11 03:23:44 +08:00
erio d67b560c57 chore: bump version to 0.1.94.6 2026-03-10 18:23:40 +08:00
erio 7b3df5b807 chore: bump version to 0.1.94.5 2026-03-10 18:09:11 +08:00
erio e2b9c40093 feat(antigravity): add usage status detection and 403 validation block
- Add needs_verify, is_banned, needs_reauth, error_code fields to UsageInfo
  for Antigravity accounts (omitempty ensures zero impact on other platforms)
- Add singleflight dedup for Antigravity usage requests with independent
  context to prevent caller cancel cascade
- Return degraded UsageInfo with error_code instead of HTTP 500 on errors
- Differentiate cache TTL: success/403 → 3min, recoverable errors → 1min
- Add 403 validation_block: Antigravity validation-type 403 triggers
  temp_unschedulable (10min auto-recovery) instead of permanent SetError
- Frontend: display needs_reauth and degraded error states in usage cell
- Bump version to 0.1.94.4
2026-03-10 14:01:03 +08:00
Wesley Liddick 3cc407bc0e Merge pull request #900 from ischanx/feat/admin-bind-subscription-group
feat: 允许管理员为持有有效订阅的用户绑定订阅类型分组
2026-03-10 11:20:47 +08:00
Wesley Liddick ac6bde7a98 Merge pull request #872 from StarryKira/fix/oauth-linuxdo-invitation-required
fix: Linux.do OAuth 注册支持邀请码两步流程 (fix #836)
2026-03-10 09:10:35 +08:00
ischanxandClaude Opus 4.6 767a41e263 feat: 允许管理员为持有有效订阅的用户绑定订阅类型分组
之前管理员无法通过 API 密钥管理将用户绑定到订阅类型分组(直接返回错误)。
现在改为检查用户是否持有该分组的有效订阅,有则允许绑定,无则拒绝。

- admin_service: 新增 userSubRepo 依赖,替换硬拒绝为订阅校验
- admin_service: 区分 ErrSubscriptionNotFound 和内部错误,避免 DB 故障被误报
- wire_gen/api_contract_test: 同步新增参数
- UserApiKeysModal: 管理员分组下拉不再过滤订阅类型分组

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 00:51:43 +08:00
erioandClaude Opus 4.6 cb67d5508b chore: bump version to 0.1.94.3
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 22:53:31 +08:00
erioandClaude Opus 4.6 091999639e chore: bump version to 0.1.94.2
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 22:35:45 +08:00
erioandClaude Opus 4.6 20e9882cb1 chore: bump version to 0.1.94.1
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 18:35:22 +08:00
erioandClaude Opus 4.6 028442d00b merge: integrate upstream v0.1.94 into release/custom-0.1.94
Merge upstream v0.1.94 onto our custom branch (based on release/custom-0.1.93).

Key additions beyond upstream:
- Startup stale concurrency slot cleanup on process restart
- iframe language passthrough for embedded payment/custom pages
- embedded-url.spec.ts frontend tests
- Admin payment integration API docs update

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 18:35:16 +08:00
erio 4677ea367b fix: also update viper default max_line_size from 40MB to 500MB
The viper config default (config.go) was overriding the constant
in gateway_service.go. Both must be updated to take effect.
2026-03-09 08:05:02 +08:00
erio b2bc47abd7 fix: increase SSE scanner max line size from 40MB to 500MB
4K image base64 data can exceed 40MB limit, causing "bufio.Scanner:
token too long" errors. Scanner is adaptive (starts at 64KB, grows
as needed), so increasing the cap has no impact on normal responses.
2026-03-09 07:52:32 +08:00
Elysia 106b20cdbf fix claudecode review bug 2026-03-09 01:18:49 +08:00
erio 99bd72c237 chore: bump Antigravity user agent version to 1.20.4 2026-03-08 22:05:56 +08:00
erio 00decae9bb feat(frontend): move API Key quota bars from capacity to usage window column
Move daily/weekly/total quota progress bars for API Key accounts from
the capacity column (QuotaBadge) to the usage window column
(UsageProgressBar), providing a consistent visual experience with
other usage displays.
2026-03-08 20:10:48 +08:00
erio 0bf7111e27 feat: add Antigravity 403 forbidden status detection and display
- Backend: detect and classify 403 responses (validation/violation/forbidden)
- Backend: extract verification/appeal URLs from 403 response body
- Frontend: display forbidden status badges with color coding
- Frontend: show clickable/copyable verification links
- Also includes: sora SDK client rename, table header style fix, tier badge in accounts list

chore: bump version to 0.1.93.23
2026-03-08 18:23:07 +08:00
kyx236 0c29468f90 feat(admin): 支持定时测试自动恢复并统一账号恢复入口
- 为定时测试计划增加 auto_recover 配置,补齐前后端类型、接口、仓储与数据库迁移
- 在定时测试成功后自动恢复账号 error、rate-limit 等可恢复运行时状态
- 新增 /admin/accounts/:id/recover-state 接口,合并原有重置状态与清限流操作
- 更新账号管理菜单与定时测试面板,补充自动恢复开关、说明提示和状态展示
- 补充账号恢复、限流清理与仓储同步相关测试
2026-03-08 06:59:53 +08:00
erio 6f4adb2ecd chore: bump version to 0.1.93.22 2026-03-08 04:44:45 +08:00
erio 75bdcd440f chore: bump version to 0.1.93.21 2026-03-08 04:36:49 +08:00
erio abe8162292 chore: bump version to 0.1.93.20 2026-03-08 04:01:34 +08:00
erio 0d179a794d chore: bump version to 0.1.93.19 2026-03-08 03:51:41 +08:00
erio 7f5e7372d3 chore: bump version to 0.1.93.18 2026-03-08 03:43:45 +08:00
erio 87631e753b chore: bump version to 0.1.93.17 2026-03-08 03:33:11 +08:00