dsh-bridge-gateway 0.2.0 → 0.2.1

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
@@ -2,6 +2,30 @@
2
2
 
3
3
  本项目 `dsh-bridge-gateway` 是基于 [dsh-bridge](https://github.com/wenbin-wb/dsh-bridge) 的移植增强分支,在保留原版能力之外,重点新增「公网直连网关」。
4
4
 
5
+ ## [0.2.1] - 2026-09-25
6
+
7
+ ### 兼容性核查:DSH 0.1.7 无需改动
8
+
9
+ 对 `0.1.7-rc.2` 逐项复核后确认本插件不需要适配:宿主侧注入的 `connection`、`webServer`、
10
+ `sessions`、`agents`、`approval`、`workspaceRegistry`、`sessionPersistence`、`loader`
11
+ 八个服务全部仍在;客户端注入的 `slots` / `connection` / `workspaces` / `sessions` 与注册的
12
+ `settings.section` 槽位也仍在;`dsh-llm` 的 `createUserMessage`、`@deepseek-ai/cordis` 的
13
+ `Service` 导出未变。`0.1.5` 线继续兼容(peer 范围 `^4.0.1` / `>=0.1.0-rc.6` 两条线都满足)。
14
+
15
+ ### 修复:HTML 响应强制 no-store(远程端"改了页面不变")
16
+
17
+ DSH 的 index HTML **不带 cache-control**,浏览器按启发式缓存它;而该 HTML 里钉着各客户端模块的
18
+ `rev`,模块 bundle 又是 `immutable` 长缓存 —— 于是 host 重启/重建后换了新 rev,旧标签页与
19
+ **普通刷新**仍然指向旧 rev 的旧代码,表现为"改动永远不生效"(远程直连场景尤其明显:
20
+ 页面只重连、不重新取 index)。
21
+
22
+ 透明反向代理分支对 `content-type: text/html` 的响应统一加
23
+ `Cache-Control: no-store, must-revalidate`,并删除 `etag` / `last-modified`;
24
+ 非 HTML(含带 rev 的模块 bundle)保持原样,缓存策略不变。
25
+
26
+ 注意:这条只对**新取到的响应**生效;浏览器里已经存下的旧 index 需要一次硬刷新
27
+ (Cmd+Shift+R)或带新查询串的地址来替换。
28
+
5
29
  ## [0.2.0] - 2026-09-19
6
30
 
7
31
  ### 破坏性变更(移除 dsh-mobile 协议舱;访问配置 Tab 重构;新增 Tailscale 隧道)
package/README.md CHANGED
@@ -55,6 +55,7 @@ Upstream's tunnels either go through Cloudflare or require your own server. This
55
55
  Upstream iterates quickly and this repository keeps up. Ported fixes are listed in [CHANGELOG](./CHANGELOG.md), notably:
56
56
 
57
57
  - DSH 0.1.5 adaptation: real agent-preset mounting, already-persisted session misdetection, platform config lost on restart, `/rename` durability;
58
+ - DSH 0.1.7 compatibility check: no change needed (the injected host services `connection` / `webServer` / `sessions` / `agents` / `approval` / `workspaceRegistry` / `sessionPersistence` / `loader`, the `settings.section` slot, and `createUserMessage` from `dsh-llm` all still exist);
58
59
  - Tunnel keepalive: WebSocket Ping/Pong answered at the frame layer, cloudflared crash self-healing and autoupdate disabled;
59
60
  - Reliability: Telegram proxy broken on Node >= 24, login session persistence.
60
61
 
@@ -99,7 +100,7 @@ The panel has 5 tabs: **Access** / **Visitors** / **IM Bots** / **Security** / *
99
100
  ## Requirements
100
101
 
101
102
  - Node `^22.19.0 || >=24.0.0`.
102
- - DSH with a web profile (built and tested against `0.1.5-rc.2`; adapted for the 0.1.5 RPC/webServer entry points).
103
+ - DSH with a web profile (built and tested against `0.1.7-rc.2`, and still compatible with the `0.1.5` line: the host services, client slots and settings entry points it uses exist in both, so no extra adaptation is needed).
103
104
 
104
105
  ## Install
105
106
 
package/README.zh.md CHANGED
@@ -68,6 +68,9 @@ DeepSeek Harness(DSH)远程访问插件。以 [wenbin-wb/dsh-bridge](https:/
68
68
  上游迭代很快,本仓库持续跟进。已移植的修复见 [CHANGELOG](./CHANGELOG.md),主要包括:
69
69
 
70
70
  - DSH 0.1.5 适配:agent preset 真实挂载、会话已存在误判、平台配置重启即丢、`/rename` 持久化;
71
+ - DSH 0.1.7 兼容性核查:无需改动(宿主注入的 `connection` / `webServer` / `sessions` / `agents` /
72
+ `approval` / `workspaceRegistry` / `sessionPersistence` / `loader` 服务、`settings.section` 槽位、
73
+ `dsh-llm` 的 `createUserMessage` 均仍存在);
71
74
  - 隧道保活:WebSocket Ping/Pong 帧层应答、cloudflared 崩溃自愈与禁用 autoupdate;
72
75
  - 可靠性:Telegram 代理在 Node ≥ 24 下失效、登录 Session 持久化。
73
76
 
@@ -123,7 +126,8 @@ DeepSeek Harness(DSH)远程访问插件。以 [wenbin-wb/dsh-bridge](https:/
123
126
  ## 要求
124
127
 
125
128
  - Node `^22.19.0 || >=24.0.0`。
126
- - DSH web profile(构建与测试基于 `0.1.5-rc.2`,已适配 0.1.5 的 RPC/webServer 入口)。
129
+ - DSH web profile(构建与测试基于 `0.1.7-rc.2`,同时兼容 `0.1.5` 线:宿主服务、客户端槽位与
130
+ 设置接口在两个版本上都存在,无需额外适配)。
127
131
 
128
132
  ## 安装
129
133
 
package/lib/index.js CHANGED
@@ -558,7 +558,18 @@ class ProxyServer {
558
558
  const proxyReq = httpRequest(
559
559
  { host: '127.0.0.1', port: this.targetPort, method: req.method, path: req.url, headers, agent: false },
560
560
  (proxyRes) => {
561
- res.writeHead(proxyRes.statusCode ?? 502, proxyRes.headers);
561
+ // DSH 的 index HTML 不带 cache-control,浏览器会**启发式缓存**它;而它里面钉着
562
+ // 各客户端模块的 rev,于是 host 重启换了新 rev 之后,旧标签页/普通刷新仍指向旧 rev
563
+ // 的 immutable bundle —— 表现就是"改了但页面永远不变"(远程端尤其明显)。
564
+ // 这里对 HTML 响应强制 no-store:每次刷新都重新取 index。bundle 本身仍按 rev 长缓存。
565
+ const outHeaders = { ...proxyRes.headers };
566
+ const contentType = String(outHeaders['content-type'] ?? '');
567
+ if (contentType.includes('text/html')) {
568
+ outHeaders['cache-control'] = 'no-store, must-revalidate';
569
+ delete outHeaders.etag;
570
+ delete outHeaders['last-modified'];
571
+ }
572
+ res.writeHead(proxyRes.statusCode ?? 502, outHeaders);
562
573
  proxyRes.pipe(res);
563
574
  res.on('close', () => proxyRes.destroy());
564
575
  proxyRes.on('error', () => res.destroy());
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "dsh-bridge-gateway",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "以 dsh-bridge 为根基的 DSH 远程访问网关:局域网 / Cloudflare 隧道 / Tailscale 隧道 / 自建隧道 / 公网直连网关 / IM Bot,全部在 Web 面板中配置。",
5
- "releaseNotes": "【dsh-bridge-gateway 0.2.0】\n• 🆕 Tailscale 隧道卡片:网关自动探测 `tailscale serve` 地址(只读,不代改配置),支持一键填入、手动编辑与二维码扫码直连\n• 🗂️ 访问配置 Tab:原「局域网」「公网访问」两块合并,直连网关 / Cloudflare / Tailscale / 自建隧道 / 局域网五张卡片,默认只展开直连网关\n• 👥 访客管理 Tab:远程连接监控与持久黑名单从公网 Tab 独立出来\n• 📱 移除 dsh-mobile 协议舱(/ws/mobile 设备配对)及其 Linux 一键部署 CLI(init / setup / status / remove)\n• 🎨 卡片支持折叠,折叠时保留状态标签与一行关键信息\n• 🐛 修复 Tab 数量超出容器宽度导致「运维监控」在桌面端不可见(Tab 合并后恢复)",
5
+ "releaseNotes": "【dsh-bridge-gateway 0.2.1】\n• 🐛 修复远程端「改了页面不变」:透明反向代理对 `text/html` 响应强制 `Cache-Control: no-store, must-revalidate` 并去掉 etag/last-modified,普通刷新即可拿到新 index(模块 bundle 的长缓存策略不变)\n• ✅ DSH 0.1.7 兼容性核查:无需改动(宿主 8 个注入服务、客户端槽位、dsh-llm 导出全部仍在),0.1.5 线继续兼容",
6
6
  "type": "module",
7
7
  "main": "lib/index.js",
8
8
  "exports": {