Repository navigation
Sub2API 1.4.8
AI API Gateway Platform - 将 AI 订阅配额分发和管理
修复
- Security Scan 红灯:Go 升级到 1.26.6,清掉 6 条标准库漏洞
(GO-2026-6218 / 6090 / 6089 / 6088 / 5972 / 5026)。govulncheck 归零。 - gpt-5.6-sol 等模型请求被上游 404:客户端版本号从 0.125.0 升到 0.149.1,
越过上游 0.144.0 的 version 门槛;originator 与最终 User-Agent 首段强制配套,
修掉旧「非 Codex UA 兜底」把 codex-tui 改写成 codex_cli_rs 却保留原 originator
所制造的稳定错配。 - "stream disconnected before completion: stream closed before response.completed":
上游按 originator 分桶降载,codex-tui 落在降载桶,请求 HTTP 200 后立刻以
server_is_overloaded 收尾。出站身份统一归一化后避开该桶。 - codex_cli_only 访问门绕过:「codex 」家族前缀被 TrimSpace 退化成裸 "codex"
且走子串匹配,evil-codex_thing 之类伪造标识可通过。改为 originator 精确集合
+ 保留空格的家族前缀,访问门使用严格前缀版。 - 账号生图测试恒失败:originator=opencode 与 Codex UA 错配,必被上游 404。
新增
- Codex 客户端版本号自动同步:每 6 小时跟随 openai/codex 官方发布,
主路径 /releases/latest,异家族时回退扫描 release 列表;只向前推进,
抓取失败保持既有值,启动防抖避免滚动重启放大成连续请求。
同步值不进 admin settings API,settings 契约不受影响。
行为变化(默认开启,均可回退)
- OAuth 出站身份归一化:账号级自定义 User-Agent 不再抵达上游 Codex 路径。
回退:gateway.disable_codex_originator_normalization: true - 服务端默认每 6 小时出网访问 GitHub。离线/防火墙部署请设置
gateway.disable_codex_version_auto_sync: true(已同步到的版本仍继续生效)。 - codex_cli_only 访问门收紧(安全修复),透传路径保持宽松版不变。
验证
后端 unit / integration / build、golangci-lint 0 issues、govulncheck 0 漏洞、
前端 typecheck + 78 vitest、pnpm audit 门禁、docker 运行时资源检查全部通过。
📥 Installation
Docker:
# GitHub Container Registry
docker pull ghcr.io/atoz03/sub2api:1.4.8One-line install (Linux):
curl -sSL https://raw.githubusercontent.com/atoz03/dev_s2i/main/deploy/install.sh | sudo bashManual download:
Download the appropriate archive for your platform from the assets below.