@riceawa/dsh-lan-gateway 0.5.0 → 0.5.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/README.md +19 -1
- package/lib/index.js +7 -3
- package/package.json +23 -20
- package/src/index.ts +8 -3
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
8
|
<img src="https://img.shields.io/badge/DeepSeek%20Harness-4d6bfe?logo=deepseek&logoColor=fff&style=flat-square" alt="DeepSeek Harness" />
|
|
9
|
-
<img src="https://img.shields.io/badge/version-0.5.
|
|
9
|
+
<img src="https://img.shields.io/badge/version-0.5.1-2b7fff?style=flat-square" alt="version 0.5.1" />
|
|
10
10
|
<img src="https://img.shields.io/badge/TLS-8b5cf6?logo=lock&logoColor=fff&style=flat-square" alt="TLS" />
|
|
11
11
|
<img src="https://img.shields.io/github/license/rice-awa/dsh-lan-gateway?style=flat-square" alt="MIT license" />
|
|
12
12
|
</p>
|
|
@@ -229,6 +229,24 @@ IPv6 的 `fe80::/10`(link-local)与 `127.0.0.0/8` / `::1` 归类为 LAN/loop
|
|
|
229
229
|
- **WebSocket**:`/api` 升级请求同样过登录校验、同源 Origin 校验,再拼接转发给 dsh,
|
|
230
230
|
并纳入会话撤销(epoch 变化即断开)。
|
|
231
231
|
|
|
232
|
+
## 版本兼容(0.5.0 的加载失败与修复)
|
|
233
|
+
|
|
234
|
+
0.5.0 及更早版本装在 **dsh ≥ 0.1.2-rc.1** 上会让整个 plugin tree 起不来:
|
|
235
|
+
|
|
236
|
+
```
|
|
237
|
+
Error: dsh: plugin tree failed to load: ...
|
|
238
|
+
SyntaxError: The requested module '@deepseek-ai/dsh-settings' does not provide an export named 'settingsNamespace'
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
`@deepseek-ai/dsh-settings` 自 `0.1.2-rc.1` 起删掉了 `settingsNamespace()` 这个品牌化辅助
|
|
242
|
+
函数(命名空间改为 `register()` 内部校验的普通字符串字面量),旧版插件在 ESM 链接期就失败;
|
|
243
|
+
cordis 的 include 一旦失败会连坐整棵树,所以表现是**所有插件都起不来**,而报错点看着像隔壁
|
|
244
|
+
插件的名字。0.5.1 移除了该导入——运行时行为不变(新旧版本的 `register()` 都按同一个
|
|
245
|
+
`NAMESPACE_PATTERN` 校验并原样接受这个字面量),因此 0.5.1 在 `0.1.0-rc.6` 到 `0.1.5-rc.2`
|
|
246
|
+
的底座上都能加载。
|
|
247
|
+
|
|
248
|
+
升级:`pnpm add @riceawa/dsh-lan-gateway@0.5.1`(或重新 `pnpm install` 走 link/github 安装)。
|
|
249
|
+
|
|
232
250
|
## 从 v0.4(及更早)升级
|
|
233
251
|
|
|
234
252
|
1. **把底座升级到 dsh ≥ 0.1.2-rc.1**(含 QVD-2026-57410 上游修复)。低于该版本时本插件
|
package/lib/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { X509Certificate, createHmac, createSign, generateKeyPairSync, randomBytes, scryptSync, timingSafeEqual } from "node:crypto";
|
|
2
2
|
import z from "@deepseek-ai/schemastery";
|
|
3
|
-
import { settingsNamespace } from "@deepseek-ai/dsh-settings";
|
|
4
3
|
import http from "node:http";
|
|
5
4
|
import https from "node:https";
|
|
6
5
|
import { chmodSync, existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
@@ -1264,8 +1263,13 @@ var UpstreamSessionRelay = class {
|
|
|
1264
1263
|
const name = "dsh-lan-gateway";
|
|
1265
1264
|
/** Requires the web server service (binds before this row's apply runs) and the tool registry. */
|
|
1266
1265
|
const inject = ["webServer", "tools"];
|
|
1267
|
-
/**
|
|
1268
|
-
|
|
1266
|
+
/**
|
|
1267
|
+
* The `lan-gateway` user-settings namespace, mirroring the composition schema.
|
|
1268
|
+
* A plain string literal: dsh-settings dropped the `settingsNamespace()` brand
|
|
1269
|
+
* helper in 0.1.2-rc.1 and `register` validates the literal itself, so this
|
|
1270
|
+
* shape works against both that release line and the older branded one.
|
|
1271
|
+
*/
|
|
1272
|
+
const NS = "lan-gateway";
|
|
1269
1273
|
/** Optional config keys: an empty submitted value clears them back to the composition layer. */
|
|
1270
1274
|
const OPTIONAL_CONFIG_KEYS = /* @__PURE__ */ new Set([
|
|
1271
1275
|
"dshTargetPort",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riceawa/dsh-lan-gateway",
|
|
3
3
|
"description": "LAN/internet reverse-proxy gateway for the DeepSeek Harness web GUI: binds 0.0.0.0 and forwards to the loopback dsh web server. Default-deny: every source (loopback, LAN, internet) must sign in with an HMAC session cookie unless lanPasswordless is explicitly enabled; against dsh >= 0.1.2-rc.1 the gateway relays one shared upstream browser session, so the harness's own authorization still gates every request. Fail-closed start guard (password required, plaintext needs an explicit opt-in), session revocation by epoch (password changes and secret rotation kill cookies and live WebSockets), same-site/Origin fence on HTTP and WebSocket upgrades, optional TLS (auto self-signed or user-supplied certs), and a Settings → Plugins card for live adjustment of port, CIDRs, auth, and TLS. Includes an insecure-origin UUID shim client bundle: on gateway-served plain-HTTP origins browsers lack crypto.randomUUID, so the client half patches a getRandomValues-backed randomUUID onto the Crypto prototype, fixing workspace open over LAN without touching DSH source.",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/index.d.ts",
|
|
@@ -22,13 +22,6 @@
|
|
|
22
22
|
"skills",
|
|
23
23
|
"cordis.patch.yml"
|
|
24
24
|
],
|
|
25
|
-
"scripts": {
|
|
26
|
-
"build": "tsdown",
|
|
27
|
-
"typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.client.json --noEmit",
|
|
28
|
-
"test": "vitest run",
|
|
29
|
-
"build:client": "tsdown",
|
|
30
|
-
"prepack": "tsdown"
|
|
31
|
-
},
|
|
32
25
|
"dsh": {
|
|
33
26
|
"bundle": {
|
|
34
27
|
"patch": "./cordis.patch.yml"
|
|
@@ -42,18 +35,22 @@
|
|
|
42
35
|
}
|
|
43
36
|
},
|
|
44
37
|
"peerDependencies": {
|
|
45
|
-
"@deepseek-ai/cordis": "^4.0.
|
|
46
|
-
"@deepseek-ai/dsh-settings": "^0.1.
|
|
47
|
-
"@deepseek-ai/dsh-tools": "^0.1.
|
|
48
|
-
"@deepseek-ai/schemastery": "^3.18.
|
|
38
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
39
|
+
"@deepseek-ai/dsh-settings": "^0.1.2-rc.1 || ^0.1.5-rc.2",
|
|
40
|
+
"@deepseek-ai/dsh-tools": "^0.1.2-rc.1 || ^0.1.5-rc.2",
|
|
41
|
+
"@deepseek-ai/schemastery": "^3.18.2"
|
|
49
42
|
},
|
|
50
43
|
"devDependencies": {
|
|
51
|
-
"@deepseek-ai/cordis": "4.0.
|
|
52
|
-
"@deepseek-ai/dsh-
|
|
53
|
-
"@deepseek-ai/dsh-client-
|
|
54
|
-
"@deepseek-ai/dsh-
|
|
55
|
-
"@deepseek-ai/dsh-
|
|
56
|
-
"@deepseek-ai/
|
|
44
|
+
"@deepseek-ai/cordis": "4.0.2",
|
|
45
|
+
"@deepseek-ai/dsh-brand": "0.1.5-rc.2",
|
|
46
|
+
"@deepseek-ai/dsh-client-runtime": "0.1.1-rc.2",
|
|
47
|
+
"@deepseek-ai/dsh-client-ui-slots": "0.1.5-rc.2",
|
|
48
|
+
"@deepseek-ai/dsh-llm": "0.1.5-rc.2",
|
|
49
|
+
"@deepseek-ai/dsh-scope": "0.1.5-rc.2",
|
|
50
|
+
"@deepseek-ai/dsh-settings": "0.1.5-rc.2",
|
|
51
|
+
"@deepseek-ai/dsh-tools": "0.1.5-rc.2",
|
|
52
|
+
"@deepseek-ai/dsh-util-values": "0.1.5-rc.2",
|
|
53
|
+
"@deepseek-ai/schemastery": "3.18.2",
|
|
57
54
|
"@types/node": "^22.0.0",
|
|
58
55
|
"@types/react": "~18.3.1",
|
|
59
56
|
"react": "^18.2.0",
|
|
@@ -82,5 +79,11 @@
|
|
|
82
79
|
"bugs": {
|
|
83
80
|
"url": "https://github.com/rice-awa/dsh-lan-gateway/issues"
|
|
84
81
|
},
|
|
85
|
-
"homepage": "https://github.com/rice-awa/dsh-lan-gateway#readme"
|
|
86
|
-
|
|
82
|
+
"homepage": "https://github.com/rice-awa/dsh-lan-gateway#readme",
|
|
83
|
+
"scripts": {
|
|
84
|
+
"build": "tsdown",
|
|
85
|
+
"typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.client.json --noEmit",
|
|
86
|
+
"test": "vitest run",
|
|
87
|
+
"build:client": "tsdown"
|
|
88
|
+
}
|
|
89
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -42,7 +42,7 @@ import type { Context } from '@deepseek-ai/cordis'
|
|
|
42
42
|
import { randomBytes } from 'node:crypto'
|
|
43
43
|
import type { IncomingMessage, ServerResponse } from 'node:http'
|
|
44
44
|
import z from '@deepseek-ai/schemastery'
|
|
45
|
-
import {
|
|
45
|
+
import type { SettingsScope } from '@deepseek-ai/dsh-settings'
|
|
46
46
|
import { DEFAULT_LAN_CIDR_STRINGS, originMatchesHost } from './auth.ts'
|
|
47
47
|
import { LanGateway } from './gateway.ts'
|
|
48
48
|
import { readBody } from './login.ts'
|
|
@@ -160,8 +160,13 @@ export interface Config {
|
|
|
160
160
|
trustedTerminator?: string
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
/**
|
|
164
|
-
|
|
163
|
+
/**
|
|
164
|
+
* The `lan-gateway` user-settings namespace, mirroring the composition schema.
|
|
165
|
+
* A plain string literal: dsh-settings dropped the `settingsNamespace()` brand
|
|
166
|
+
* helper in 0.1.2-rc.1 and `register` validates the literal itself, so this
|
|
167
|
+
* shape works against both that release line and the older branded one.
|
|
168
|
+
*/
|
|
169
|
+
const NS = 'lan-gateway'
|
|
165
170
|
|
|
166
171
|
/** Optional config keys: an empty submitted value clears them back to the composition layer. */
|
|
167
172
|
const OPTIONAL_CONFIG_KEYS = new Set(['dshTargetPort', 'tlsCertPath', 'tlsKeyPath', 'trustedTerminator'])
|