Skip to content

merge: upstream auth + keep invite modes, selfupdate, Anthropic default - #3

Merged
ChinaToyHunter merged 10 commits into
mainfrom
merge/upstream-auth-keep-invite-selfupdate
Jul 20, 2026
Merged

ChinaToyHunter merged 10 commits into
mainfrom
merge/upstream-auth-keep-invite-selfupdate

Conversation

@ChinaToyHunter

Copy link
Copy Markdown
Owner

Summary

将上游 QuantumNous/main 合入 fork,并保留我们自改能力:

  • 注册邀请码三模式 optional / required / hidden(密码注册 / OAuth AuthFlow / 微信)
  • 一键拉取更新 selfupdate(/api/system/update* + Docker helper)
  • default 主题默认外观 Anthropic preset
  • 模型监控 model-status 顶栏入口(扁平 web/src 布局下保留)

同时接受上游 default-only:移除 classic 前端源码(与 QuantumNous#6329 一致)。

Upstream included

相对当前 main,本 PR 额外包含上游:

  1. refactor(auth): replace dashboard sessions with stateless tokens and session control QuantumNous/new-api#6329 面板无状态登录(Access JWT + HttpOnly Refresh Cookie + user_sessions / auth_flows)并移除 classic
  2. fix: 中转 gpt-realtime 系列 GA 模型时不再发送 realtime beta 标识 QuantumNous/new-api#6032 realtime GA 模型 beta 头
  3. fix(playground): prevent model group option stretching QuantumNous/new-api#6120 / fix(playground): resolve auto group model listing QuantumNous/new-api#6163 playground 修复
  4. perf(data-table): optimize action column width allocation QuantumNous/new-api#6135 data-table 操作列宽度
  5. fix(web): show used quota for unlimited API keys QuantumNous/new-api#6224 无限额度 key 显示已用额度
  6. fix(channel): improve proxy client compatibility and cache lifecycle QuantumNous/new-api#6157 渠道代理客户端兼容
  7. fix: prevent duplicate suno task refunds via cas status update QuantumNous/new-api#6074 Suno 失败退款 CAS 防重复
  8. frontend language stats

Resolution notes

区域 处理
classic 源码/i18n 采用上游删除
controller/oauth.go 上游 AuthFlow 为主;hidden 不写 aff;创建用户走 resolveConfiguredRegistrationInviter
注册页 WeChat 保留邀请码参数 + 上游 isAuthBundle 登录成功处理
i18n 并集合并,并重申邀请码中文等翻译
routeTree.gen.ts 上游为底,注入 /model-status
selfupdate 路由 / main helper 保留

Ops prerequisites (ali-server already prepared)

线上 compose 已预埋(当前仍跑 th.8,待本 PR 发版后生效):

  • SESSION_COOKIE_SECURE=true
  • SESSION_COOKIE_TRUSTED_URL=https://newapi.toyhunter.site
  • TRUSTED_PROXIES=127.0.0.1,::1,172.18.0.0/16,10.77.0.0/24(含 WireGuard wgm0)

Local verification

  • go build controller/model/common/i18n/selfupdate/middleware/router ✅
  • go test ./controller(含邀请码三模式) ✅
  • go test ./service/selfupdate/... ✅
  • 未在本 PR 流程中跑完整前端 typecheck/build(建议 CI 或合并前补跑)

Deploy plan (after merge, manual)

  1. 合并本 PR 到 main
  2. VERSION 递增 v1.0.0-rc.21-th.10(或当前最新 th+1)并 tag → 触发 Release 二进制
  3. 服务器手动拉取更新(th.8 可网页自更到含 selfupdate 修复的版本后;若从 th.8 直上新包,按既有 Docker 二进制 commit 流程)
  4. 升级后:全员重新登录;确认邀请码模式与系统维护「检查更新」

Risk checklist

  • 确认可接受 classic 主题下线
  • 确认可接受 旧 Session 全失效、需重新登录
  • 确认线上 Cookie/Trusted URL/TRUSTED_PROXIES 已配置(已做)
  • 合并后补跑前端 build / 关键 auth 与注册页手测
  • OAuth 注册 required/hidden 模式手测(AuthFlow aff 路径)

Test plan

  • CI PR checks green
  • 密码登录 / 刷新 / 登出
  • 注册 optional / required / hidden
  • OAuth 登录/注册带 aff
  • 系统维护检查更新接口(Root)
  • /model-status 顶栏与 iframe
  • 外观默认 Anthropic(无 cookie 用户)

Calcium-Ion and others added 10 commits July 20, 2026 16:48
…session control (QuantumNous#6329)

* refactor(auth): replace dashboard sessions with stateless tokens

* feat(auth): harden session issuance and distributed enforcement

* fix(proxy): preserve trusted proxy compatibility defaults

* refactor: address dashboard auth review feedback

* refactor: remove classic frontend and flatten web app
)

* fix(playground): prevent model group option stretching

- keep group options at a fixed 2rem height and align them to the top.
- organize layout code in a dedicated module and cover layout and scrolling behavior.

* docs(web): strengthen frontend testing requirements

- require regression coverage for behavior changes, bug fixes, and UI states.
- define module-scoped test organization, stable assertions, mocks, and verification rules.
…s#6135)

- apply a minimum width hint to content-sized columns to prevent wasted space.
- preserve remaining table width allocation across regular data columns.
…uantumNous#6157)

* fix(channel): improve proxy client compatibility and cache lifecycle

* test(controller): use non-fatal assertions for channel tests
* fix(playground): resolve auto group model listing

- merge and deduplicate available models in configured auto group order.
- reuse special usable group rules and add model filtering regression coverage.

* refactor: extract GetGroupsEnabledModels to dedupe group model expansion
…umNous#6074)

* fix: prevent duplicate suno task refunds via cas status update

* fix: reconcile failed task refunds

---------

Co-authored-by: CaIon <i@caion.me>
…opic default

- Accept upstream default-only frontend (drop classic theme)
- Keep registration invite modes (optional/required/hidden) on password,
  OAuth AuthFlow, and WeChat paths
- Keep selfupdate system update routes and docker helper
- Keep Anthropic as default theme preset
- Restore model-status route under flattened web/src layout
- Reassert invite i18n keys after locale merge

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ChinaToyHunter
ChinaToyHunter merged commit d33664e into main Jul 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants