chore(main): 回流 —— opencode Zen 免费层可用 + noVNC path 相对名修复

内容与 release/v2.0.x 完全一致(git checkout release/v2.0.x -- .):
- feat(opencode): Zen 免费层门禁四要素 + 两个 id 公式(详见 release 提交)
- fix(vnc): noVNC 的 path 必须用相对名,否则 WebSocket 路径重复拼接
This commit is contained in:
JianFeeeee
2026-10-15 20:31:45 +08:00
parent 482a65958b
commit ddbafe822c
5 changed files with 891 additions and 2 deletions

View File

@ -4277,8 +4277,14 @@ local function spawnBrowser(start_url)
-- 客户端可能来自另一台机器(127.0.0.1 指向客户端自己)且 websockify 只绑回环,
-- 所以只能由网关同端口转发;插件只提供回环目标与绝对路径,不处理传输。
local base = "/api/plugins/http/channels/browser/proxy/" .. sess
-- noVNC 用 `new URL(path, location.href)` 解析 path(ui.js 的 connect()),
-- 即**相对 vnc.html 所在目录**解析,默认值就是相对名 'websockify'。
-- 曾传站点根路径(/api/.../websockify)→ 被当相对路径 ⇒ 路径重复拼接:
-- .../proxy/<id>/api/plugins/http/channels/browser/proxy/<id>/websockify
-- 于是 WebSocket 永远连不上(noVNC 显示连接失败,页面看似白屏)。
-- 只用相对名,与 noVNC 默认值一致。
local proxyPath = base .. "/vnc.html?autoconnect=1&resize=scale&password=" .. pass
.. "&path=" .. urlencode(base:sub(2) .. "/websockify")
.. "&path=websockify"
return {
view_url = proxyPath,
proxy_path = proxyPath,