dsh-foreman-node 0.1.0 → 0.2.0
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 +64 -3
- package/LICENSE +21 -21
- package/README.md +29 -0
- package/cordis.patch.yml +0 -0
- package/lib/client.js +611 -0
- package/lib/index.d.ts +245 -28
- package/lib/index.js +620 -16
- package/package.json +27 -3
- package/src/client/index.tsx +211 -0
- package/src/client/locales.ts +95 -0
- package/src/client/page-state.ts +99 -0
- package/src/client.ts +0 -0
- package/src/config.ts +100 -0
- package/src/index.ts +141 -33
- package/src/keys.ts +49 -0
- package/src/protocol.ts +0 -0
- package/src/report-tool.ts +0 -0
- package/src/routes.ts +157 -0
- package/src/session.ts +0 -0
- package/src/tunnel.ts +267 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,68 @@
|
|
|
1
|
-
|
|
1
|
+
## 0.2.0 — 2026-11-07
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
### 新增:配置页,设备绑定不用再碰命令行
|
|
4
|
+
|
|
5
|
+
以前绑定一台设备要动四样东西,全是手写:在服务器上跑注册脚本拿 token、改服务器的
|
|
6
|
+
`cordis.patch.yml`、改设备自己的 `cordis.patch.yml`、再手动开一条
|
|
7
|
+
`ssh -L 8790:127.0.0.1:8790` 隧道。最后那一步最要命——插件连不上时只表现为「离线」,
|
|
8
|
+
真正的原因是一条没人开的隧道。
|
|
9
|
+
|
|
10
|
+
现在这条隧道由设备自己开,配置也由设备自己的页面填:
|
|
11
|
+
|
|
12
|
+
- **「设置 › 插件 › dsh-foreman-node」多了一个配置页**:从这台机器 `~/.ssh` 里
|
|
13
|
+
**列出密钥让你挑**、填主机/用户/端口、点「测试连接」看认证通不通、填项目路径,
|
|
14
|
+
保存后重启 DSH 生效。
|
|
15
|
+
- **隧道由插件自己拉起**:`ssh -N -L`,断了按 1s→60s 退避重连。就绪判定是
|
|
16
|
+
TCP 连本机端口,不看 ssh 的措辞。
|
|
17
|
+
- **两种失败会翻译成人话**:钥匙有口令(`Permission denied (publickey)`)会说
|
|
18
|
+
「请改用 ssh-agent 或换一把无口令的钥匙」;本地端口被占会说
|
|
19
|
+
「local port 8790 已经有人占了」,而不是把 ssh 原文丢给你。
|
|
20
|
+
- **配置页在没有配置时也能打开**:路由注册排在「缺配置就返回」之前。否则新装的
|
|
21
|
+
设备打不开配置页,等于装完就卡死。
|
|
22
|
+
- **没有 Web 界面的 DSH 照常接单**:`webServer` 是可选注入,不是硬依赖。headless
|
|
23
|
+
或 CLI 里的设备只是没有配置页,干活不受影响。
|
|
24
|
+
|
|
25
|
+
### 新增配置
|
|
26
|
+
|
|
27
|
+
`ssh` 一整块,全部有默认值,所以**旧的手写配置不会因为缺这一块而变 invalid**:
|
|
28
|
+
|
|
29
|
+
```yaml
|
|
30
|
+
ssh:
|
|
31
|
+
enabled: false
|
|
32
|
+
host: ''
|
|
33
|
+
port: 22
|
|
34
|
+
user: ''
|
|
35
|
+
keyPath: ''
|
|
36
|
+
remotePort: 8790
|
|
37
|
+
localPort: 8790
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
`enabled: true` 时,`url` **不再参与连接**:设备拨的是 `ws://127.0.0.1:<localPort>`,
|
|
41
|
+
也就是隧道自己那一头。页面会把地址置灰并显示真正会用的那个。
|
|
42
|
+
|
|
43
|
+
### 不支持
|
|
44
|
+
|
|
45
|
+
- 密码登录:Windows 没有 `sshpass`,而且自动重连的前提是 `BatchMode=yes`。
|
|
46
|
+
- 带口令的私钥:请放进 ssh-agent。
|
|
47
|
+
|
|
48
|
+
## 0.1.1 — 2026-11-07
|
|
49
|
+
|
|
50
|
+
### 修复:装上去就把整个 profile 弄成「异常」
|
|
51
|
+
|
|
52
|
+
设备包一进 profile 的 `bundles`,它的 patch 就会插入 `dsh-foreman-node` 这一行,
|
|
53
|
+
而这一行**还没有任何 config**——`0.1.0` 的 schema 把 `url` / `deviceId` / `token` 都写成 `.required()`,
|
|
54
|
+
于是激活直接失败:
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
invalid config:
|
|
58
|
+
- $.url missing required value (at url)
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
整个 profile 因此显示为异常,而不是「这个设备还没配好」。
|
|
62
|
+
|
|
63
|
+
现在这三项都有空字符串默认值,`apply` 在缺值时**干净地不激活**,只记一行说明缺哪几项、
|
|
64
|
+
去哪儿填,profile 保持健康。值填齐后才开始拨号。
|
|
65
|
+
只有空白的值也算缺——否则设备会一直拨一个空地址,看起来只是离线。
|
|
5
66
|
|
|
6
67
|
## 0.1.0 — 2026-11-07
|
|
7
68
|
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 DeepSeek Harness Team
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 DeepSeek Harness Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -25,6 +25,35 @@
|
|
|
25
25
|
└───────────────────────────────┘
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
+
## 配置
|
|
29
|
+
|
|
30
|
+
装进 profile 后会多出「设置 › 插件 › dsh-foreman-node」一个配置页:从这台机器的 `~/.ssh` 里
|
|
31
|
+
挑一把密钥、填枢纽机器与用户、点「测试连接」、把枢纽上登记设备时给出的 `deviceId` 和 `token` 填进来,
|
|
32
|
+
再填项目名到本机路径的对应关系。保存后重启 DSH 生效。
|
|
33
|
+
|
|
34
|
+
隧道由插件自己拉起(`ssh -N -L`,断了自动重连),不需要再手开 `ssh -L`。
|
|
35
|
+
|
|
36
|
+
也可以直接写 profile 的 `cordis.patch.yml`:
|
|
37
|
+
|
|
38
|
+
```yaml
|
|
39
|
+
- id: dsh-foreman-node
|
|
40
|
+
config:
|
|
41
|
+
url: wss://foreman.example.com # 隧道开着时不参与连接
|
|
42
|
+
deviceId: laptop
|
|
43
|
+
token: <枢纽登记设备时给出的令牌>
|
|
44
|
+
roots:
|
|
45
|
+
- project: shop
|
|
46
|
+
path: 'D:\工作\shop'
|
|
47
|
+
ssh:
|
|
48
|
+
enabled: true
|
|
49
|
+
host: 203.0.113.10
|
|
50
|
+
port: 22
|
|
51
|
+
user: ubuntu
|
|
52
|
+
keyPath: /home/me/.ssh/id_ed25519
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
不支持密码登录(自动重连的前提是 `BatchMode=yes`),也不支持带口令的私钥——请放进 ssh-agent。
|
|
56
|
+
|
|
28
57
|
## 状态
|
|
29
58
|
|
|
30
59
|
**早期开发中。** 协议、连接、接单与回报工具都已落地并有测试(14 项)。
|
package/cordis.patch.yml
CHANGED
|
File without changes
|