Repository navigation
[PR] feat: dsh settings panel guides remote users to security.adminRelay (#3816) - #3834
Conversation
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.4549-pr.3834.cdd3d58This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3834.tgz
npm install -g packageInstall instructions are refreshed on each push. |
…hen the loopback origin is unreachable (#3816)
… hint (#3834 review) A resolved stale verdict proves THIS browser reached the loopback origin (same-machine access through a LAN IP): the adminRelay guidance must not shadow the #3100 restart notice nor hide the still-working backup button. remoteBlocked now keys on liveEmbed === undefined (no verdict yet) instead of liveEmbed !== 'ok'. Pinned by the new negative-5 gate row in tests/dsh-settings-ui.test.ts.
efc109f to
0e357b8
Compare
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复。adminRelay 相关条目只有本 PR、源 issue #3816,以及已随 v0.1.198 发布的机制本体 #3373/#3486(那边交付「远程浏览器经宿主入口开面板」的开关本身;本 PR 是它落地后失败路径上的可发现性缺口)。无其他在途 PR/issue 实现同一提示。 标签: 审核结论: 方向正确,发现并修掉一处优先级缺陷(已推分支,commit
八问:
判定: 可合——待 CI test 分片 lane 转绿即可合并(静态门禁已全绿)。PR 描述已同步修正为「任何已决判定优先于 mismatch」。 |
…nRelay enable warning Owner ruling on #3816: keep adminRelay opt-in (no default remote access); prompt with the reason, let the user self-serve from the web UI, and warn while they set it. - dsh settings hint (remote page + loopback origin): add an 'Open config page' button jumping to <origin>/__bili/#/config in a fresh tab; the hint text mentions it; shares ACTION_BTN_STYLE with the open-in-browser entry so the two buttons cannot drift. - bili panel Config page: a warning banner shows while the editor draft enables security.adminRelay (strict === true, JSONC-tolerant via parseConfigDraft) — driven by refreshDirtyFlag so it follows every editor change and the initial load, before the save lands. Tests: extended the #3816 UI rows (button label/target/click, exactly one button in the state); new tests/web-relay-warn.test.ts (gate truth table incl. truthy-typo negatives + JSONC draft, wiring, shell slot, i18n pins).
(ai: vllm-qwen/qwen3.8-27b) CI 收口: 最终头 过程说明(透明起见):我按规范给镜像 issue 打标签时,标签同步到 GitHub 触发了一个 最终判定: 可合。审核发现的 stale 遮蔽缺陷已修并钉测试,描述已同步,CI 权威绿灯齐备——合并动作留给你(#3834)。 |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.613-master.0ee76a9 # this exact build
npm install -g billion-context@master # always the newest merged build
|
Closes #3816 — option B (the remote-access prompt). Option A (default-on in DSH mode) remains an open product/security decision in the issue thread and is NOT implemented here.
What & why
When DSH web is reached remotely (VPS, reverse proxy, LAN IP) and
security.adminRelayis off (the default),/bili/originreturns the server's loopback address (http://127.0.0.1:18787). The browser resolves that to ITS OWN machine, so the settings panel spins on "Connecting…" forever and the backup button opens a dead link (ERR_CONNECTION_REFUSED) — with zero discoverability of the #3373 relay knob. Per the triage discussion in-thread, this PR ships the no-decision-dependent half (the prompt); the security-default flip awaits the owner.How
Client-side only (
src/agent/dsh-native-client.ts): newremoteMismatch(origin)— true when the bound origin is a loopback host while the page itself was loaded through a non-loopback host (the browser's 127.0.0.1 is not the server's ⇒ unreachable by construction). In that state the face renders an actionable zh/en notice naming the config file plus the exact"security": { "adminRelay": true }field instead of the endless connecting state, and hides the backup button whose target is precisely the dead loopback link. Client-side detection on purpose: server socket inspection breaks under reverse proxies.Deliberate fail-soft edges:
no such management endpointafter profile auto-update #3100 stale notice of a reachable-but-frozen proxy);Enabling stays opt-in, and after saving the config the live origin poll picks up
{relay:true}within one slow tick (~10s) — no dsh restart needed (loadConfigFile()re-reads per request; the/__biliroute is registered unconditionally and gated per request).Behavior change (flagged per policy)
Failure path only: remote page + loopback origin previously rendered "Connecting…" forever plus a dead footer button; it now renders the adminRelay guidance block with the button hidden. Every other state (local access, relay on, directly-exposed non-loopback origins, degraded/stale/ok) is unchanged — pinned by the gate test's negative rows.
Tests
tests/dsh-settings-ui.test.ts: new #3816 test — positive row (remote page + loopback origin + refused probe ⇒ guidance text, no frame, no button, no connecting text) plus five negative rows (ok-verdict outranks mismatch; stale-verdict keeps the #3100 notice + backup button; local page keeps connecting; non-loopback origin keeps connecting; relay mode under a remote page shows no hint). Local: typecheck clean, build clean,dsh-settings-ui+dsh-admin-relaysuites green (22/22); the full-suite verdict comes from CI.No config surface change. No kernel change. No version bump.