Skip to content

feat: allow custom base url - #254

Merged
VallierDev merged 5 commits into
VallierDev:mainfrom
Moraxyc:allow-base-url
Nov 20, 2026
Merged

VallierDev merged 5 commits into
VallierDev:mainfrom
Moraxyc:allow-base-url

Conversation

@Moraxyc

@Moraxyc Moraxyc commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

支持自定义信令服务器和调度云的地址,这意味着我们有机会在完全自部署的环境下,摆脱对网易云服务的依赖,同时保留 UU 远程的完整功能。

目前,我正在尝试开发这样一套服务端:Remora。

幸运的是,UU 远程在很大程度上建立于开源组件和标准化技术之上。这为我们提供了一条相对直接的实现路径,不用大量的逆向工程或破解通信协议,也无需承担由此可能带来的法律风险,就有望实现完整功能的自部署方案。

test result: ok. 401 passed; 0 failed; 14 ignored; 0 measured; 0 filtered out; finished in 12.23s

@VallierDev

Copy link
Copy Markdown
Owner

感谢 PR!把云端 API 基础地址做成 UU_BASE_URL / 配置 base_url,默认值不变,配置文件读取复用已缓存的 config::file(),改动面清楚;信令地址来自房间接口返回,所以只改 API 基础地址就能覆盖。

一点建议:base_url 填了但格式无效(如缺少 http(s)://)时目前会静默回退到网易默认地址,凭据和签名请求会发往用户本想避开的服务。建议无效值时启动报错(或至少明确告警并拒绝回退),并补一条测试。

已批准 CI,并请 Codex 审查。

@codex review

🤖 Generated with Claude Code

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-20T01:10:30.835257Z c68409e Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1cd4d3c9f6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/config.rs Resolved
@VallierDev

Copy link
Copy Markdown
Owner

98e6eb8 看过:显式设置但无效的 UU_BASE_URL / base_url(缺协议、非 http(s)、无主机、带查询/片段、非字符串)现在都报错且不回退默认地址,错误信息不回显原值;WOL 上报也遵循同一覆盖,测试覆盖了优先级与 fail-closed。已批准 CI,请 Codex 复审。

@codex review

🤖 Generated with Claude Code

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 98e6eb8279

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/viewer/ui.rs Resolved
Comment thread src/config.rs Resolved
A login with UU_BASE_URL wrote only the token, so the host service the
viewer restarts (started without the variable) sent the self-hosted token
to the default NetEase API. Persist the address used as config base_url.
The base URL validation errors reached the login window in English only.
Make them a typed error: Display keeps the English log text, localized()
gives the window text. The login checks the setting before any request.
UU_BASE_URL in the systemd unit overrides the base_url saved at login,
so a login against another server would send its token to the wrong one.
@VallierDev

Copy link
Copy Markdown
Owner

3baa29f/aedba39/d88e90f 看过:扫码登录成功后把所用地址写入配置 base_url,被重启的被控端服务沿用同一服务器;地址校验错误改为类型化错误,日志保持英文、登录窗口按界面语言显示;README 说明长期部署只用配置文件、不在 unit 里设 UU_BASE_URL。分别对应上两条 P1。已批准 CI,请 Codex 复审。

@codex review

🤖 Generated with Claude Code

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d88e90f31a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/config.rs Resolved
@VallierDev

Copy link
Copy Markdown
Owner

d88e90f CI 全绿。Codex 新这条 P1 核实成立:wait_for_credentials() 用 config::read_fresh() 读到新凭据,但 auth::base_url() → config::custom_base_url() 仍读 OnceLock 缓存的 config::file(),无图形会话的 host 在等待登录期间若由 uuremote-server login 写入新 base_url,随后 create_room() 会带着新 token 发往旧地址(初次登录即网易默认)。建议接收新凭据时一并从同一份新读取的配置解析并绑定地址(例如让 UUAuthClient 持有构造时确定的 base_url,或让缓存可刷新),并补一条测试。改好后我再批准 CI、请 Codex 复审。

🤖 Generated with Claude Code

A host waiting for credentials re-read the token but kept the base URL from
the startup config snapshot, so a token issued by a self-hosted server was
sent to the old address. Credentials now carry base_url from the same config
read, and login always records the address it used.
@VallierDev

Copy link
Copy Markdown
Owner

c68409e 看过:base_url 改为随 Credentials 一起从同一份配置解析(custom_base_url_in),所有请求用 creds.api_base(),wait_for_credentials() 拿到新凭据即带新地址;登录时也写入 null 防止合并带回旧服务器地址,测试覆盖等待期间换地址。处理了上条 P1。已批准 CI,请 Codex 复审。

@codex review

🤖 Generated with Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: c68409e968

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@VallierDev
VallierDev merged commit f192574 into VallierDev:main Nov 20, 2026
6 checks passed
@VallierDev

Copy link
Copy Markdown
Owner

Codex 复审 c68409e 无问题、CI 全绿,已 squash 合并,会随下个版本发布。感谢 @Moraxyc 多轮细致修改!

🤖 Generated with Claude Code

@Moraxyc
Moraxyc deleted the allow-base-url branch November 20, 2026 02:26
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.

2 participants