dsh-lan-guard 0.3.5 → 0.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,71 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.3.6] — 2026-09-26(远程也能添加工作区:修掉让远程管理台永远锁定的代理缺陷)
4
+
5
+ ### 新增 — 远程设备可以添加工作区(智能分流 + 页面内目录浏览器)
6
+
7
+ **症状**(2026-09-26 用户报告):在局域网另一台电脑(或手机)上点「添加工作区」,远程那侧没有任何反应,**对话框却开在运行 DSH 的电脑屏幕上**。
8
+
9
+ **根因**:DSH 的目录选择器在**进程启动时判定一次**(`dsh-host-directory-picker-auto`)。判定要求「仅回环绑定 + 非 SSH + 有显示器」,而 DSH 自身正是只绑回环,所以 macOS/Windows 上恒判为 `native`——对话框属于**宿主屏幕**,远程设备永远够不到。这个判定是进程级的,无法按客户端重算。
10
+
11
+ **改动**:不碰 DSH 的组合(钉死 `-browse` 会把本机操作者的系统对话框也一起拿走),而是在浏览器侧**遮蔽**官方目录流程占用者——`single` 槽位渲染最低优先级,且每个优先级只允许一个占用者,因此 `priority: -20` 能接管而不触发重复注册:
12
+
13
+ - **本机浏览器**(回环 hostname / Electron / 桌面 preload)仍走系统原生对话框;
14
+ - **远程设备**改用页面内目录浏览器:面包屑、快捷入口、目录列表、「使用此目录」,并可在弹层内**直接解锁管理台**,不必再去找设置页的锁定卡片。
15
+
16
+ 选中的路径仍交回 DSH 官方工作区流程登记(`onPicked` → `workspaces.create`),插件**只读目录、不创建不修改任何文件**。
17
+
18
+ ### 修复 — 代理双向丢弃插件自己的管理 cookie,`password_unlock` 对远程形同虚设
19
+
20
+ **症状**:在远程设备上把管理策略设为「密码解锁」并提示已保存,但远程设置页始终锁定、远程目录浏览恒返回 `403 admin_required`(用户描述为「添加工作区里仍然是空的」)。
21
+
22
+ **根因**:代理**双向**丢弃了本插件自己的管理会话 cookie —— 请求方向用注入的上游 cookie 整体替换 `Cookie` 头,响应方向丢弃全部 `set-cookie`。而校验 `isAdminUnlocked()` 的代码跑在 DSH 的 web server 上、只能经代理到达,于是解锁 POST 返回 200、下一个请求仍被判为锁定。
23
+
24
+ **改动**(`src/headers.ts`、`src/proxy.ts`):只放行本插件自己的 cookie 名(`dsh_lan_guard_admin`)。**DSH 自身的会话 cookie 依旧绝不外泄**,访客的门禁会话与设备身份 cookie 也依旧不到上游。这一处修复同时修好了整个远程管理面(设置写入、设备管理、解锁),不只是目录浏览。
25
+
26
+ ### 修复 — 设置页一直没有「远程设备管理权限」控件
27
+
28
+ **根因**:`POLICY_CHOICES`(密码解锁 / 仅本机 / 不锁定)从写下那天起就是**死代码**,从未被渲染;`adminPolicy` 只能手改 profile patch,而它正是远程目录浏览能否工作的开关。
29
+
30
+ **改动**:安全认证 tab 补上「远程设备管理权限」与「管理操作需要先解锁」两个控件。另外,目录浏览路由的鉴权改为与其它管理写入完全一致(`adminProtection=false` 同样放行),避免「设置能改、目录却被拒」的矛盾。
31
+
32
+ ### 修复 — 「已保存」横幅会把整页推下去
33
+
34
+ **症状**:任何一次保存都在页面顶部弹出一栏,长 tab 底部保存时页面像跳了一下,且看不出是否真的保存了。
35
+
36
+ **改动**:改为**右上角固定 toast** —— 不占布局、不引起位移;带图标、关闭按钮与倒计时条(条与定时器共用同一个 `TOAST_MS`,不会漂移)。同时修掉「2.6 秒内连续保存时,旧定时器把新提示提前掐掉」的问题。
37
+
38
+ ### 修复 — 状态表面配色在深色与浅色下都不达标
39
+
40
+ **根因**(按 DSH 0.1.7 真实调色板实测):
41
+
42
+ - `--dsw-alias-state-business-primary` 当**正文颜色**时对比度只有浅色 **3.60:1** / 深色 **4.39:1**,低于 AA 正文的 4.5:1;
43
+ - `--dsw-alias-interactive-bg-hover-danger` 解析成 8 位 hex、alpha 仅 **0x0d(5%)**——它是 hover 染色,**不能当背景**,拿它当表面等于背景近乎透明。
44
+
45
+ **改动**:语义色只用于**图标与边框**(门槛 3:1),文字一律 `label-primary`(浅 16.04:1 / 深 9.79:1);danger 表面改为 `color-mix(error-primary 12%, bg-layer-1)`(浅 `#fde3e3` / 深 `#3c2a2a`),按仓库既有约定先写实心 token 兜底。**原有的 `.lg-bar.*` 与 `.lg-chip.wait` 有同样问题,一并修正。**
46
+
47
+ ### 修复 — 目录弹层的面包屑与快捷入口两行被压扁重叠
48
+
49
+ **根因**:flex item 的**自动最小尺寸**在其 `overflow` 不是 `visible` 时解析为 **0**,而这两行都要横向滚动;列表又写了 `min-height`,于是内容超高时被压缩的只有这两行(实测被压到 9px / 11px,内容需要 24px / 27px,必然溢出重叠)。
50
+
51
+ **改动**:固定行显式 `flex:0 0 auto`,列表成为唯一可伸缩行(底部按钮永远不会被挤出),sheet 加 `overflow:hidden`,面包屑与快捷入口 chip 加 `white-space:nowrap`。
52
+
53
+ ### 验证
54
+
55
+ - `pnpm run typecheck` ✓;`pnpm test` — **330 项全绿**(0.3.5 为 273 项,+57);
56
+ - **逐提交隔离验证**(在独立 worktree 里检出每个提交单独跑):`fix(proxy)` 278 项、`feat(picker)` 宿主半边 304 项、`feat(picker)` 浏览器半边 330 项,三个提交各自 typecheck 干净、测试全绿;
57
+ - 新增用例覆盖:代理 cookie 双向中转(含 gate cookie 不外泄的反证)、目录栅栏(敏感段 / 符号链接逃逸 / 截断 / 限流)、路由鉴权矩阵(本机 / 远程只读 / 需解锁 / 已解锁 / 栅栏拒绝)、slot 注册契约、错误码→可执行提示、CSS 布局不变量、设置页控件覆盖、toast 单一常量与定时器清理;
58
+ - **反证**(隔离回退后重跑):回退 cookie 中转 → round-trip 用例失败;回退 `flex:0 0 auto` → 布局不变量用例失败;把 hover 染色当背景 → 配色用例失败;
59
+ - 配色对比度用 DSH 真实 token 取值逐项计算,**浅色/深色 10/10 通过**;弹层布局在真实 Chrome 里量过尺寸(修复前 9px/11px → 修复后 30px/36px)。
60
+
61
+ ### 升级
62
+
63
+ ```sh
64
+ dsh plugin --profile web add dsh-lan-guard@latest
65
+ ```
66
+
67
+ 然后重启一次 DSH(宿主与客户端 bundle 都变了,刷新页面不够)。
68
+
3
69
  ## [0.3.5] — 2026-09-26(连接层可见性:明文请求 301 + 旧设备 cookie 不再锁死)
4
70
 
5
71
  ### 修复 — 用 `http://` 打开 TLS 端口时只看到「无法访问」,日志里也什么都没有
package/README.md CHANGED
@@ -38,6 +38,7 @@ DSH serves its Web UI on `127.0.0.1` only, and it deliberately refuses to bind `
38
38
  - **Your own machine is never locked** — direct `127.0.0.1` access is physically unlocked (whoever can use this computer could change these settings anyway). Remote access follows `adminPolicy`: read-only (default), password-unlocked, or open.
39
39
  - **Device pairing and permanent blocking** — a phone names itself once when it first passes the gate, receives an HttpOnly device-identity cookie, and appears under **已授权设备** (name / created / last used / source IP) where you can **revoke and block** it. Blocking does not rely on device fingerprinting: re-pairing with the access password from another browser is refused too, and unblocking is the only way back.
40
40
  - **Settings inside the official page** — the "局域网访问" section has four tabs: QR access, authentication, authorised devices, and connection & certificates. All typography and colours use the official design tokens; **no official layout is replaced**.
41
+ - **Adding a workspace from a phone (smart routing)** — DSH resolves its directory picker once at boot, and a loopback bind with a display resolves to `native`: tapping "添加工作区" on a phone actually opens the folder dialog **on the host's screen**. This plugin shadows the official pick flow from the browser half at a lower slot priority, so **the local browser keeps the OS dialog while a remote device gets an in-page directory browser** (breadcrumbs, shortcuts, directory list). The chosen path still goes through DSH's own workspace flow — this plugin only reads directories, never writes anything.
41
42
  - **Configurable port and listen scope** — defaults to `3081` (DSH's port + 1) and walks up to ten ports when that one is taken, with an availability check in the settings page. The listen scope toggles between "LAN (default)" and "this machine only"; both need a DSH restart.
42
43
  - **Optional mDNS** — off by default; advertises `_dsh-lan-guard._tcp` when enabled.
43
44
  - **Update check** — the settings page shows "current version → latest on npm" with a copyable upgrade command. The plugin **never installs or restarts anything itself**.
@@ -92,6 +93,8 @@ Everything lives under **Settings → 局域网访问**, in four tabs. The non-s
92
93
  | Access password | unset | The login password for visitor devices. **While unset, the gate refuses every device.** |
93
94
  | Admin password | unset | Unlocks this settings page's management console; falls back to the access password. |
94
95
  | Loopback exempt | **on** | Direct `127.0.0.1` access skips the gate (physically unlocked). |
96
+ | Remote management rights | **this machine only** | Whether LAN devices may manage: "this machine only" is read-only; "password unlock" needs an unlock first; "not locked" adds no requirement. **Browsing directories and adding a workspace remotely needs one of the latter two.** |
97
+ | Management needs an unlock | **on** | Turned off, a remote session that satisfies the policy may change settings directly — except under "this machine only", which never allows remote management. |
95
98
  | Official settings page on the LAN | **on** | DSH opens its official settings surface only to loopback pages, so a LAN device opening **Settings → Models** reports `settings are unavailable in this browser`. With this on, any device that passes the gate (phones included) can use those pages after a page refresh. It is a UI unlock, not a new privilege: the settings RPC is gated by the visitor gate either way, and DSH still redacts secret reads. Refresh the page to apply; no restart needed. |
96
99
  | Require naming | **on** | A new device must name itself once before it appears in the device list. |
97
100
  | Require approval | off | When on, a named device still needs your **批准** before it is let in. |
@@ -137,10 +140,11 @@ The plugin reads its config from its Cordis entry. **Every key has a usable defa
137
140
 
138
141
  ## Compatibility
139
142
 
140
- Current version: plugin **`0.3.5`**; connection-level visibility and gate-recovery fixes (verified on DeepSeek Harness **`0.1.7-rc.2`**).
143
+ Current version: plugin **`0.3.6`**; adding a workspace from a remote device, plus the proxy defect that kept the remote console locked forever (verified on DeepSeek Harness **`0.1.7-rc.2`**).
141
144
 
142
145
  | Plugin | Verified DeepSeek Harness | What this version is |
143
146
  | --- | --- | --- |
147
+ | **`0.3.6`** | **`0.1.7-rc.2`**, `0.1.7-rc.1` | Adding a workspace from a remote device: the browser half shadows the official directory flow (the local browser keeps the OS dialog, a remote device gets an in-page browser and can unlock inside it); fixes the proxy dropping the plugin's admin cookie in both directions, which made `password_unlock` meaningless remotely; adds the missing "remote management rights" control; moves the "saved" confirmation to a top-right notification; reworks status-surface colours against measured contrast; fixes the picker's crushed breadcrumb/shortcut rows |
144
148
  | **`0.3.5`** | **`0.1.7-rc.2`**, `0.1.7-rc.1` | Connection-level visibility: an `http://` request to the TLS port goes from "blank page + no log" to a 301 onto `https` with a log line; a deleted device record no longer locks that browser out (revoked/blocked still refuse); the removal-page copy follows |
145
149
  | **`0.3.4`** | **`0.1.7-rc.2`**, `0.1.7-rc.1` | Official settings page on the LAN: a new `settingsUnlock` switch (on by default) that injects the host-surface marker into the index; applies on page refresh; a UI unlock, not a new privilege |
146
150
  | **`0.3.3`** | **`0.1.7-rc.2`**, `0.1.7-rc.1` | Gate UX fixes: the two first-visit steps are announced up front; an inert-link page can be logged into again; the blocking note now matches real behaviour (no host-facing change) |
@@ -154,6 +158,7 @@ Current version: plugin **`0.3.5`**; connection-level visibility and gate-recove
154
158
  - Declared range `>=0.1.7-rc.1 <0.2.0` (`dsh.engines.dsh`); DSH versions not listed are **unverified** — verify them yourself before use.
155
159
  - Host/client interfaces this plugin uses: `webServer.register` / `webServer.tapIndex` (indexTaps), `connection.requestRejection`, `connection.authenticatedUrl`, the additive `settings.section` seat, `@deepseek-ai/schemastery`, and `profileContext` (for deriving the default data directory).
156
160
  - **Breaking default change (from `0.3.2`)**: `listenHost` now defaults to `0.0.0.0` instead of `127.0.0.1`, so one restart after install is enough; `0.3.1` and earlier default to loopback only. The gate and self-signed TLS defaults are unchanged (with no password the gate still refuses every device). See the [CHANGELOG](CHANGELOG.md).
161
+ - **`0.3.6` verification status**: the change spans the host side (a new directory-listing route and cookie relaying) and the client side (the directory browser, the settings controls, the notification and the colour rework). The suite is green at **330** specs (+57); all three commits were verified in isolation in their own worktrees (278 / 304 / 330 each passing); it was falsified (reverting the cookie relay, the no-shrink rule, or the hover-tint surface each fails its specs); and contrast was computed from DSH's real token values, 10/10 passing in light and dark. The real-DSH install verification follows the release.
157
162
  - **`0.3.5` verification status**: the changes touch only the proxy's connection-level handling and the gate's verdict; no host/client interface changed; the suite is green at **273** specs (+10) and was falsified (reverting a fix fails its specs); the real-DSH install verification follows the release.
158
163
  - **`0.3.4` verification status**: the change adds one host-side switch, one index injection and a switch on the plugin's own settings page (`webServer.tapIndex` is a declared host interface); the suite is green at **263** specs; the injected script was exercised in a real Chrome over a non-loopback address in three states; the real-DSH install verification follows the release.
159
164
  - **`0.3.3` verification status**: the changes touch only the plugin's own pages, copy and gate-form availability; no host/client interface changed; the suite is green at **247** specs; the real-DSH install verification follows the release.
@@ -173,6 +178,8 @@ The official UI is reused with zero modifications and adapts on a phone viewport
173
178
  - Loopback access is **physically unlocked by design** — whoever can use this computer could change these settings anyway.
174
179
  - **The official-settings-page unlock (`settingsUnlock`) is a UI compatibility patch, not a new transport privilege.** A proxied request is already rewritten to a loopback `host`, and DSH's settings RPC is gated only by the visitor gate (reads are redacted by DSH); the switch merely stops the official page from reporting "settings are unavailable in this browser". Turn it off to restore DSH's stock behaviour.
175
180
  - The access password is **shared**: revoking a device invalidates that device's identity cookie immediately, but the same browser can re-pair with the password. Permanently blocking one machine would need device fingerprinting or per-device tokens, which this project deliberately avoids.
181
+ - **Exactly one cookie is relayed.** The proxy injects DSH's loopback session cookie and never passes an upstream `set-cookie` through — with one exception: this plugin's OWN admin session cookie (`dsh_lan_guard_admin`, HttpOnly, SameSite=Strict, 30 minutes by default). The plugin mints it and the plugin's route validates it, but that route runs on DSH's web server, so without the relay no remote device could ever unlock the console and `password_unlock` would be meaningless. The visitor's gate session and device identity still never reach DSH.
182
+ - **The remote directory browser is read-only and carries the management console's authority.** It lists directory names only (credential stores such as `.ssh`/`.aws`/`.env` and system directories are refused, symlinks are re-checked against their real target, one level is capped at 1,000 rows and rate-limited), and it **creates or modifies nothing** — DSH's own workspace flow performs the registration. The route reuses the management authentication: the machine's operator or an unlocked remote session, so under the default `local_only` a remote device gets `read_only_remote`.
176
183
  - LAN only: no public tunnels, no IM bots, no port forwarding.
177
184
  - The plugin **installs, restarts and pushes nothing**: you copy and run the upgrade command yourself.
178
185
 
@@ -190,6 +197,12 @@ The official UI is reused with zero modifications and adapts on a phone viewport
190
197
 
191
198
  **"This device's access was removed" (403).** The device was revoked or blocked under **已授权设备**. Delete the record to let it pair again (a blocked device needs **解除拉黑** first).
192
199
 
200
+ **Tapping "添加工作区" remotely does nothing (or the dialog opens on the computer).** That is DSH's directory picker: it resolves once at boot, and a loopback bind with a display resolves to `native`, so the dialog opens **on the host's screen** where a remote device cannot see or reach it. This plugin takes it over with two interactions — the OS dialog locally, an in-page directory browser remotely.
201
+
202
+ If the sheet reports "**远程设备当前只读**", the policy is still "this machine only": open **设置 → 局域网访问 → 安全认证 → 远程设备管理权限** on the computer and pick "密码解锁" (or "不锁定"), then refresh the page on that device.
203
+
204
+ If it reports "**需要先解锁管理控制台**", just type the admin password into the sheet and press 解锁 — the list appears immediately, with no trip to the settings page.
205
+
193
206
  **I forgot the access password.** On the machine that runs DSH, open `http://127.0.0.1:3080` (direct loopback access is physically unlocked) and set a new one. On a headless server, delete `secrets.json` in `dataDir` and set a new password — until then the gate refuses every device.
194
207
 
195
208
  **Every device needs the password again after I changed it.** That is intentional: changing the access password or switching the auth mode **revokes every existing visitor session**.
package/README.zh.md CHANGED
@@ -38,6 +38,7 @@ DSH 的 Web 界面只监听 `127.0.0.1`,而官方明确拒绝绑定 `0.0.0.0`
38
38
  - **本机永不锁定**:直连 `127.0.0.1` 享有物理免锁特权(能用这台电脑的人本就能改这些设置);远程访问按 `adminPolicy` 处理——只读(默认)、需密码解锁、或不锁。
39
39
  - **设备配对与永久拉黑**:手机首次通过门禁时自己命名一次,获得 HttpOnly 设备身份 cookie,出现在 **已授权设备** 里(名称 / 创建时间 / 最近使用 / 来源 IP),可逐个「吊销并拉黑」。拉黑不依赖设备指纹——换浏览器用密码重新配对也会被拒,「解除拉黑」是唯一的恢复方式。
40
40
  - **设置挂在官方设置页内**:「局域网访问」分区含四个 tab——扫码访问、安全认证、已授权设备、连接与证书。排版与配色全部使用官方设计 token,**不替换任何官方布局**。
41
+ - **远程也能添加工作区(智能分流)**:DSH 的目录选择器在启动时判定一次,本机回环绑定 + 有显示器会判成「原生」——手机点「添加工作区」实际是在**电脑屏幕上**弹文件夹对话框。本插件在浏览器侧以更低优先级遮蔽官方选择流程:**本机浏览器照旧走系统原生对话框,远程设备改用页面内目录浏览器**(面包屑、快捷入口、目录列表)。选中后仍由 DSH 官方工作区流程登记,插件只读目录、不写任何东西。
41
42
  - **端口与监听范围可配**:默认 `3081`(DSH 端口 + 1),被占用时自动往后顺延(最多试 10 个);设置页可改端口并带可用性检查,也可在「局域网(默认)/ 仅本机」之间切换(两者都需重启 dsh 生效)。
42
43
  - **可选 mDNS**:默认关闭;开启后广播 `_dsh-lan-guard._tcp`。
43
44
  - **升级检测**:设置页显示「当前版本 → npm 上最新版本」并给出可复制的升级命令;插件**不会自己安装或重启任何东西**。
@@ -92,6 +93,8 @@ dsh plugin --profile web add "link:$(pwd)"
92
93
  | 访问密码 | 未设置 | 手机等访客设备的登录密码。**未设置时门禁拒绝所有设备**。 |
93
94
  | 管理密码 | 未设置 | 解锁本设置页的管理台;未设置时退回访问密码。 |
94
95
  | 本机回环访问免密 | **开** | `127.0.0.1` 直连跳过门禁(物理免锁)。 |
96
+ | 远程设备管理权限 | **仅本机** | 决定局域网设备能否管理:「仅本机」只读;「密码解锁」需先解锁;「不锁定」不额外要求。**远程浏览目录并添加工作区需要后两者之一**。 |
97
+ | 管理操作需要先解锁 | **开** | 关闭后,符合策略的远程会话可直接修改设置(`local_only` 除外,它永远只允许本机)。 |
95
98
  | 局域网设备可用官方设置页 | **开** | DSH 官方设置面默认只对回环页面开放,局域网设备打开「设置 → 模型」会提示 `settings are unavailable in this browser`。开启后,通过门禁的设备(含手机)刷新页面即可使用官方设置页;这是界面解锁,不是新增权限——设置接口本来就只由门禁把关,读取密钥仍由 DSH 脱敏。刷新页面生效,无需重启。 |
96
99
  | 新设备需要命名确认 | **开** | 新设备首次通过门禁时要自己命名一次,之后才出现在设备列表里。 |
97
100
  | 新设备需要管理员批准 | 关 | 开启后,命名完还要你在设备列表点「批准」才能进入。 |
@@ -137,10 +140,11 @@ dsh plugin --profile web add "link:$(pwd)"
137
140
 
138
141
  ## 兼容性
139
142
 
140
- 当前版本:插件 **`0.3.5`**;连接层可见性与门禁恢复修复(已在 DeepSeek Harness **`0.1.7-rc.2`** 上验证)。
143
+ 当前版本:插件 **`0.3.6`**;远程设备也能添加工作区 + 修掉让远程管理台永远锁定的代理缺陷(已在 DeepSeek Harness **`0.1.7-rc.2`** 上验证)。
141
144
 
142
145
  | 插件 | 已验证的 DeepSeek Harness | 这个版本是什么 |
143
146
  | --- | --- | --- |
147
+ | **`0.3.6`** | **`0.1.7-rc.2`**、`0.1.7-rc.1` | 远程也能添加工作区:浏览器侧遮蔽官方目录流程(本机仍走系统对话框,远程改用页面内目录浏览器,可在弹层内解锁);修掉代理双向丢弃插件管理 cookie 导致 `password_unlock` 对远程形同虚设;补上一直缺失的「远程设备管理权限」控件;「已保存」改为右上角提示;状态表面配色按实测重做;弹层两行被压扁重叠 |
144
148
  | **`0.3.5`** | **`0.1.7-rc.2`**、`0.1.7-rc.1` | 连接层可见性:`http://` 访问 TLS 端口由「空白页 + 无日志」改为 301 跳 `https` 并记日志;删除设备记录后旧 cookie 不再把浏览器锁死(吊销/拉黑仍拒绝);移除页文案同步修正 |
145
149
  | **`0.3.4`** | **`0.1.7-rc.2`**、`0.1.7-rc.1` | 局域网设备可用官方设置页:新增默认开启的 `settingsUnlock` 开关(index 注入宿主界面标记,刷新页面生效;界面解锁而非新增权限) |
146
150
  | **`0.3.3`** | **`0.1.7-rc.2`**、`0.1.7-rc.1` | 门禁体验修复:首次访问的两道关提前说明;失效链接页恢复可登录;拉黑说明改为与实现一致(未触碰宿主接口) |
@@ -154,6 +158,7 @@ dsh plugin --profile web add "link:$(pwd)"
154
158
  - 声明范围 `>=0.1.7-rc.1 <0.2.0`(`dsh.engines.dsh`);未列入的 DSH 版本属**未验证**,请自行验证后再使用。
155
159
  - 本插件用到的宿主/客户端接口:`webServer.register` / `webServer.tapIndex`(indexTaps)、`connection.requestRejection`、`connection.authenticatedUrl`、追加型 `settings.section` seat、`@deepseek-ai/schemastery`,以及 `profileContext`(用于推导默认数据目录)。
156
160
  - **破坏性默认值变更(`0.3.2` 起)**:`listenHost` 默认由 `127.0.0.1` 改为 `0.0.0.0`,装完重启一次即可用;`0.3.1` 及更早默认仅回环。门禁与自签 TLS 的默认值未变(未设密码仍拒绝所有设备)。详见 [CHANGELOG](CHANGELOG.md)。
161
+ - **`0.3.6` 的验证状态**:改动包含宿主侧(新增目录列举路由与 cookie 中转)与客户端(目录浏览器、设置页控件、提示层与配色)。测试套件 **330 项**全绿(+57);三个提交在独立 worktree 里逐提交验证(278 / 304 / 330 各自通过);并做过反证(回退 cookie 中转、固定行不收缩、hover 染当背景,各自让对应用例失败);配色对比度按 DSH 真实 token 逐项计算,浅色/深色 10/10 通过。真实 DSH 上的装机验证在发布后进行。
157
162
  - **`0.3.5` 的验证状态**:改动只在代理的连接层处理与门禁判定,未改动任何宿主/客户端接口;测试套件 **273 项**全绿(+10),并做过反证(回退修复后对应用例失败);真实 DSH 上的装机验证在发布后进行。
158
163
  - **`0.3.4` 的验证状态**:改动只新增一个宿主侧开关、一行 index 注入与插件自己的设置页开关(`webServer.tapIndex` 是已声明的宿主接口);测试套件 **263 项**全绿;注入脚本已在真实 Chrome + 非回环地址实测三种状态;真实 DSH 上的装机验证在发布后进行。
159
164
  - **`0.3.3` 的验证状态**:改动只在插件自己的页面、文案与门禁表单可用性,未改动任何宿主/客户端接口;测试套件 **247 项**全绿;真实 DSH 上的装机验证在发布后进行。
@@ -173,6 +178,8 @@ dsh plugin --profile web add "link:$(pwd)"
173
178
  - 回环直连**按设计物理免锁**——能使用这台电脑的人本就能改这些设置。
174
179
  - **官方设置页解锁(`settingsUnlock`)是界面层的兼容补丁,不是新的传输权限**:经代理的请求本就会被改写成回环 `host`,DSH 的设置接口只由门禁把关(读取被 DSH 脱敏),该开关只是让官方页面不再显示「settings are unavailable in this browser」。想恢复 DSH 原生行为,把开关关掉即可。
175
180
  - 访问密码是**共享**的:吊销设备会立即让该设备的身份 cookie 失效,但换个浏览器用密码仍可重新配对。要「同一台机器永久拉黑」需要设备指纹或每设备独立令牌,本项目刻意不用指纹。
181
+ - **Cookie 中转只有一个例外**:代理注入 DSH 的回环会话 cookie,且**绝不**把上游的 `set-cookie` 透传给访客;唯一被中转的是**本插件自己的**管理会话 cookie(`dsh_lan_guard_admin`,HttpOnly、SameSite=Strict、默认 30 分钟)。它由本插件签发、也只由本插件的路由校验,但校验代码跑在 DSH 的 web server 上——不中转它,远程设备就永远无法解锁管理台(`password_unlock` 形同虚设)。访客的门禁会话与设备身份 cookie 依旧不会到达 DSH。
182
+ - **远程目录浏览器只读,且要管理台同等的权限**:它只列举目录名(凭据目录 `.ssh`/`.aws`/`.env` 等与系统目录一律拒绝,符号链接解析到真实路径后二次校验,单层上限 1000 行、带限流),**不创建、不修改任何文件**;登记工作区仍由 DSH 官方流程完成。该接口复用管理台鉴权——本机操作者或已解锁的远程会话可用,默认 `local_only` 下远程设备得到 `read_only_remote`。
176
183
  - 只面向局域网:不做公网隧道、不做 IM Bot、不做端口转发。
177
184
  - 插件自己**不安装、不重启、不推送**任何东西:升级命令由你复制执行。
178
185
 
@@ -190,6 +197,12 @@ dsh plugin --profile web add "link:$(pwd)"
190
197
 
191
198
  **「此设备已被移除访问权限」(403)。** 该设备已在 **已授权设备** 中被吊销或拉黑。删除那条记录即可让它重新配对(被拉黑的需先「解除拉黑」)。
192
199
 
200
+ **远程点「添加工作区」没反应(或对话框开在电脑上)。** 这是 DSH 目录选择器的机制:它在启动时判定一次,本机回环绑定 + 有显示器 ⇒ 判成「原生」,对话框开在**电脑屏幕上**,远程设备看不到也点不到。本插件已把它接管为「本机走系统原生对话框 / 远程走页面内目录浏览器」两套交互。
201
+
202
+ 若远程弹出「**远程设备当前只读**」,说明策略还是「仅本机」:去电脑的 **设置 → 局域网访问 → 安全认证 → 远程设备管理权限** 选「密码解锁」(或「不锁定」),然后在远程设备上刷新页面。
203
+
204
+ 若弹出「**需要先解锁管理控制台**」,直接在弹层里输入管理密码(未设管理密码时用访问密码)点「解锁」,列表会立刻出现——不必再去找设置页的锁定卡片。
205
+
193
206
  **我忘了访问密码。** 在运行 DSH 的电脑上直连 `http://127.0.0.1:3080`(本机直连物理免锁)重设。无头服务器则删除 `dataDir` 下的 `secrets.json` 后重设——在此之前门禁会拒绝所有设备。
194
207
 
195
208
  **改过密码后所有设备都要重新输密码。** 这是有意的:更换访问密码或切换验证模式会**吊销所有已有访客会话**。