erio
c69929bbb7
Merge feature/payment into release/custom-0.1.108
...
集成支付系统(EasyPay、Alipay、WxPay、Stripe),包含完整的订单管理、
Webhook 回调、管理后台仪表盘和用户充值/订阅流程。
2026-04-06 00:53:57 +08:00
erio
64c4495ae5
feat: integrate payment system (EasyPay, Alipay, WxPay, Stripe)
...
Replace iframe-based external payment with native implementation:
Backend (Go):
- 5 new Ent schemas: PaymentOrder, PaymentAuditLog, PaymentChannel,
SubscriptionPlan, PaymentProviderInstance
- 5 SQL migrations (090-094)
- Payment provider interface + registry + load balancer
- 4 provider implementations (EasyPay, Alipay, WxPay, Stripe)
- PaymentService (order lifecycle, fulfillment, refund 3-phase)
- PaymentConfigService (settings, instance/channel/plan CRUD)
- 31 API endpoints (9 user + 4 webhook + 18 admin)
- Wire DI integration
Frontend (Vue3):
- Payment types, API modules, store, router changes
- Sidebar: payment_enabled controls visibility, new menu items
- User pages: PaymentView (replace iframe), QR payment, Stripe,
result page, order list
- Admin pages: Order management (4 tabs), provider instance mgmt
- Settings: new payment tab, removed old purchase iframe config
- i18n: full payment namespace (en + zh)
Docs:
- PAYMENT_FRONTEND_MIGRATION_PLAN.md
- PAYMENT_BACKEND_MIGRATION_PLAN.md
- PAYMENT_IMPLEMENTATION_ROADMAP.md
2026-04-05 15:06:05 +08:00
erio
0393981397
merge: integrate upstream v0.1.105 into release/custom-0.1.105
...
Merge upstream v0.1.105 (94 commits) with our customizations from
release/custom-0.1.104. Key upstream additions:
- TLS fingerprint profile management
- OpenAI→Anthropic endpoint compatibility routing
- Privacy mode for OpenAI/Antigravity accounts
- Requested model tracking in usage logs
- Error observability enhancements
- Various bug fixes
Conflict resolutions (all "keep both sides"):
- handler.go/wire.go: added both TLSFingerprintProfile and GDriveOAuth
- wire_gen.go: combined internal500CounterCache with TLS fingerprint objects
- accounts.ts: kept setPrivacy + affinity functions
- BulkEditAccountModal.vue: kept OpenAI WS mode + Allow Overages sections
Additional fixes:
- gateway_handler_chat_completions.go, gateway_handler_responses.go:
added missing sub2apiUserID parameter to SelectAccountWithLoadAwareness
- antigravity_internal500_penalty.go: gofmt fix
2026-03-27 18:23:39 +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
Ylarod
11f7b83522
sub2api: add bedrock support
2026-03-13 17:00:16 +08:00
erio
dfe22d9a6a
fix(ci): restore go.mod/go.sum to last CI-passing state
...
Reverts dependency upgrades that broke CI due to quic-go
incompatibility with the CI Go toolchain.
2026-03-08 18:28:48 +08:00
erio
8abaea43a8
fix(ci): remove local replace directive and revert sora.NewWebClient
...
The local go.mod replace directive for go-sora2api pointed to a Windows
path which breaks CI on Linux. Revert sora.NewWebClient back to sora.New
since the remote module doesn't have this method yet.
2026-03-08 18:25:45 +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
erio and Claude Opus 4.6
1864f41f33
merge: sync upstream/main into release/custom-0.1.92
...
Merge upstream main branch changes including:
- OpenAI Codex support and websearch adaptation
- API key rate limit auto-reset fix
- golangci-lint v2.11 upgrade for Go 1.26 compatibility
- Go 1.26.1 stdlib security fixes
- Empty stream failover fix
- CCSwitch import improvements
- API key credentials preserve existing fields
- Usage query rate limit optimization
- Setup Token real utilization fix
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-03-07 12:53:12 +08:00
shaw
0c9ba9e86c
fix(security): upgrade Go 1.25.7 to 1.26.1 to resolve 4 stdlib vulnerabilities
...
GO-2026-4602 (os), GO-2026-4601 (net/url), GO-2026-4600 and
GO-2026-4599 (crypto/x509). The crypto/x509 fixes are only
available in go1.26.1+, not backported to go1.25.x.
2026-03-07 08:45:55 +08:00
erio and Claude Opus 4.6
fe832a4436
fix: upgrade golang.org/x/net to v0.51.0 (GO-2026-4559)
...
Fix govulncheck security vulnerability in net/http2 package.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-03-07 05:40:01 +08:00
erio and Claude Opus 4.6
ad54040c07
feat(sora): add Google Drive storage backend with unified storage abstraction
...
- Define SoraObjectStorage interface abstracting S3 and GDrive backends
- Implement SoraGDriveStorage with OAuth2 and Service Account auth
- Add SoraStorageRouter to route requests based on active profile provider
- Add GDrive OAuth handler for authorization flow (start + callback)
- Extend profile model with provider, auth_type, and GDrive-specific fields
- Update frontend UI with provider selection, dynamic form fields, and i18n
- Migrate API paths from /sora-s3 to /sora-storage (old paths preserved)
- All existing S3 functionality remains backward compatible
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-03-06 20:45:51 +08:00
erio
a6026e7ac4
Merge tag 'v0.1.90' into merge/upstream-v0.1.90
...
注册邮箱域名白名单策略上线,后台大数据场景性能大幅优化。
- 注册邮箱域名白名单:支持管理员配置允许注册的邮箱域名策略
- Keys 页面表单筛选:用户 /keys 页面支持按条件筛选 API Key
- Settings 页面分 Tab 拆分:管理后台设置页面按功能模块分 Tab 展示
- 后台大数据场景加载性能优化:仪表盘/用户/账号/Ops 页面大数据集加载显著提速
- Usage 大表分页优化:默认避免全量 COUNT(*),大幅降低分页查询耗时
- 消除重复的 normalizeAccountIDList,补充新增组件的单元测试
- 清理无用文件和过时文档,精简项目结构
- EmailVerifyView 硬编码英文字符串替换为 i18n 调用
- 修复 Anthropic 平台无限流重置时间的 429 误标记账号限流问题
- 修复自定义菜单页面管理员视角菜单不生效问题
- 修复 Ops 错误详情弹窗未展示真实上游 payload 的问题
- 修复充值/订阅菜单 icon 显示问题
# Conflicts:
# .gitignore
# backend/cmd/server/VERSION
# backend/ent/group.go
# backend/ent/runtime/runtime.go
# backend/ent/schema/group.go
# backend/go.sum
# backend/internal/handler/admin/account_handler.go
# backend/internal/handler/admin/dashboard_handler.go
# backend/internal/pkg/usagestats/usage_log_types.go
# backend/internal/repository/group_repo.go
# backend/internal/repository/usage_log_repo.go
# backend/internal/server/middleware/security_headers.go
# backend/internal/server/router.go
# backend/internal/service/account_usage_service.go
# backend/internal/service/admin_service_bulk_update_test.go
# backend/internal/service/dashboard_service.go
# backend/internal/service/gateway_service.go
# frontend/src/api/admin/dashboard.ts
# frontend/src/components/account/BulkEditAccountModal.vue
# frontend/src/components/charts/GroupDistributionChart.vue
# frontend/src/components/layout/AppSidebar.vue
# frontend/src/i18n/locales/en.ts
# frontend/src/i18n/locales/zh.ts
# frontend/src/views/admin/GroupsView.vue
# frontend/src/views/admin/SettingsView.vue
# frontend/src/views/admin/UsageView.vue
# frontend/src/views/user/PurchaseSubscriptionView.vue
2026-03-04 19:58:38 +08:00
shaw
a80ec5d8bb
feat: apikey支持5h/1d/7d速率控制
2026-03-03 15:01:10 +08:00
PMExtra
7e02082209
feat(settings): add default subscriptions for new users
...
- add default subscriptions to admin settings
- auto-assign subscriptions on register and admin user creation
- add validation/tests and align settings UI with subscription selector patterns
2026-03-02 03:59:31 +08:00
QTom
000e621eb6
feat(admin): 添加管理员直接修改用户 API Key 分组的功能
...
- 新增 PUT /api/v1/admin/api-keys/:id 端点,允许管理员修改任意用户 API Key 的分组绑定
- 跳过用户级权限校验但保留分组有效性验证,修改后触发认证缓存失效
- Service 层支持三态语义:nil=不修改,0=解绑,>0=绑定,<0=拒绝
- 指针值拷贝保证安全隔离,负数 groupID 返回 400 INVALID_GROUP_ID
- 前端 UserApiKeysModal 新增可点击的分组选择下拉框,支持多 Key 并发更新
- 下拉支持视口翻转和滚动关闭,按钮有 disabled 和加载状态
- 覆盖:后端 20 个单元测试 (Service 11 + Handler 9) + 前端 16 个 E2E 测试
- golangci-lint 0 issues, make test-unit 全部通过
2026-02-28 20:18:14 +08:00
yangjianbo
bb664d9bbf
feat(sync): full code sync from release
2026-02-28 15:01:20 +08:00
erio
0e69895603
Merge branch 'main' into release/custom-0.1.87
...
# Conflicts:
# frontend/src/components/keys/UseKeyModal.vue
2026-02-27 21:20:22 +08:00
erio
6da2f54e50
refactor: decouple claude max cache policy and add tokenizer
2026-02-27 12:18:22 +08:00
huangenjun and Claude Opus 4.6
3c619a8da5
refactor: 使用 go-sora2api SDK 替代自建 Sora 客户端
...
使用 go-sora2api v1.1.0 SDK 替代原有 ~2000 行自建 HTTP/PoW/TLS 指纹代码,
SDK 提供高并发性能优化(实例级 rand、PoW 缓冲区复用、context.Context 支持)。
- 新增 SoraSDKClient 适配器实现 SoraClient 接口
- 精简 sora_client.go 为仅保留接口和类型定义
- 更新 Wire 绑定使用 SoraSDKClient
- 删除 SoraDirectClient、sora_curl_cffi_sidecar、sora_request_guard 等旧代码
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-02-25 10:15:38 +08:00
shaw
ded9b6c14e
fix: upgrade utls to v1.8.2 to resolve GO-2026-4512 vulnerability
2026-02-25 08:57:43 +08:00
yangjianbo and Claude Opus 4.6
33db7a0fb6
feat(gateway): 引入使用量记录有界 worker 池与自动扩缩容
...
- 新增 UsageRecordWorkerPool,支持有界队列、溢出降级策略与自动扩缩容
- 将 Gateway/OpenAI/Sora/Gemini 使用量记录改为提交到统一任务池执行
- 增加 usage_record 配置默认值与校验规则,并补充配置与任务提交相关测试
- 注入并托管 worker 池生命周期,服务退出时统一 StopAndWait
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-02-22 12:56:57 +08:00
yangjianbo
fff1d54858
feat(log): 落地统一日志底座与系统日志运维能力
2026-02-12 16:27:29 +08:00
yangjianbo
d367d1cde6
Merge branch 'main' into test-sora
2026-02-09 20:40:09 +08:00
erio
b889d5017b
refactor: replace Trie-based digest session store with flat cache
2026-02-09 07:02:12 +08:00
yangjianbo
98f793155f
build(工具链): 升级 Go 到 1.25.7
2026-02-06 07:41:23 +08:00
Lemon
97a5c1ac1d
feat: add support for HTTP/2 Cleartext (h2c) connections
2026-02-04 21:40:25 +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
IanShaw027
3dfb62e996
merge: 合并main分支最新改动
...
解决冲突:
- backend/internal/config/config.go: 合并Ops和Dashboard配置
- backend/internal/server/api_contract_test.go: 合并handler初始化
- backend/internal/service/openai_gateway_service.go: 保留Ops错误追踪逻辑
- backend/internal/service/wire.go: 合并Ops和APIKeyAuth provider
主要合并内容:
- Dashboard缓存和预聚合功能
- API Key认证缓存优化
- Codex转换支持
- 使用日志分区表
2026-01-11 23:15:01 +08:00
yangjianbo
9d0a4f3d68
perf(认证): 引入 API Key 认证缓存与轻量删除查询
...
增加 L1/L2 缓存、负缓存与单飞回源
使用 key+owner 轻量查询替代全量加载并清理旧接口
补充缓存失效与余额更新测试,修复随机抖动 lint
测试: make test
2026-01-10 22:23:51 +08:00
IanShaw027
4b9e47cec9
feat(基础设施): 添加运维监控功能的基础配置和依赖
...
- 更新 .gitignore 排除临时文件
- 添加 ops 监控相关配置项到 config.yaml
- 更新 Go 依赖包(go.mod/go.sum)
- 扩展 config.go 支持 ops 监控配置
- 新增上下文键定义(ClientRequestID)
2026-01-09 20:51:41 +08:00
yangjianbo
3f0017d1f1
fix(安全): 修复依赖漏洞并强化安全扫描
...
主要改动:
- 固定 Go 1.25.5 与 CI 校验并更新扫描流程
- 升级 quic-go、x/crypto、req 等依赖并通过 govulncheck
- 强化 JWT 校验、TLS 配置与 xlsx 动态加载
- 新增审计豁免清单与校验脚本
2026-01-06 11:36:38 +08:00
yangjianbo
7e758b24c4
chore(依赖): 同步 Go 模块依赖
...
更新 go.mod/go.sum 的间接依赖记录
包含 gorm/mysql 相关依赖项
2025-12-30 16:43:18 +08:00
yangjianbo
3d617de577
refactor(数据库): 迁移持久层到 Ent 并清理 GORM
...
将仓储层/基础设施改为 Ent + 原生 SQL 执行路径,并移除 AutoMigrate 与 GORM 依赖。
重构内容包括:
- 仓储层改用 Ent/SQL(含 usage_log/account 等复杂查询),统一错误映射
- 基础设施与 setup 初始化切换为 Ent + SQL migrations
- 集成测试与 fixtures 迁移到 Ent 事务模型
- 清理遗留 GORM 模型/依赖,补充迁移与文档说明
- 增加根目录 Makefile 便于前后端编译
测试:
- go test -tags unit ./...
- go test -tags integration ./...
2025-12-29 10:03:27 +08:00
noreply
cbfce49aa1
feat: Schedule batch update for account last_used_at
...
Implement deferred batch update mechanism to reduce database load:
- Add DeferredService for batching account last_used_at updates
- Add TimingWheelService for efficient recurring task scheduling
- Integrate with GatewayService and OpenAIGatewayService
- Implement BatchUpdateLastUsed repository method using CASE...WHEN SQL
- Fix golangci-lint error: Replace interface{} with any
Benefits:
- Reduces database writes by batching updates (10-second intervals)
- Improves request throughput by deferring non-critical updates
- Maintains accurate account usage tracking for scheduling
2025-12-28 09:49:54 +08:00
Forest
e5a77853b0
refactor: 调整项目结构为单向依赖
2025-12-26 16:45:40 +08:00
Forest
25a304c231
test: 增加 repository 测试
2025-12-25 16:01:17 +08:00
刀刀
9d30ceae8d
CC 400 返回具体错误信息 && 非 CC 请求时增加 system prompt ( #26 )
...
* feat: http 400 返回具体错误
* 更新 workflows
* 优化打包/docker 构建流程
* 400 是返回 原始错误 - json 格式
* feat: 非 cc请求时补充 system
* go mod tidy
2025-12-25 14:47:19 +08:00
Forest
836c4dda2b
refactor: 重命名 go module
2025-12-24 21:07:21 +08:00
Forest
e5aa676853
refactor(backend): 引入 Wire 重构服务启动与依赖组装
2025-12-18 22:07:17 +08:00
shaw
642842c29e
First commit
2025-12-18 13:50:39 +08:00