@hyzyn/dsh-docker 0.7.0 → 0.7.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.
@@ -6627,7 +6627,7 @@ window.__ModuleLoader__.load({
6627
6627
  * 宿主回显的实际连接(tty 挂在 tab.target 上的 `user@host[:port]`)。
6628
6628
  * 从连接簿打开的 SSH 标签,spec 里只有条目名、没有 host;少了这一份,
6629
6629
  * 「按 host 匹配目标」就整条失效——哪怕用户早就按同一台主机配过目标,
6630
- * 只是那条目标引用的是**另一条**连接簿条目(如 HS-248 vs 192.168.80.248)。
6630
+ * 只是那条目标引用的是**另一条**连接簿条目(如 lab-a vs 192.0.2.10)。
6631
6631
  */
6632
6632
  const liveTarget = typeof payload?.tab?.target === 'string' ? payload.tab.target : ''
6633
6633
  const matched = matchTargetForSession(spec, bookName, liveTarget)
@@ -12,7 +12,7 @@
12
12
  * 两个来源共用它:宿主 `/targets` 里每个目标的 `label`,以及宿主在 ready 帧里
13
13
  * 回显、由 tty 挂在 `tab.target` 上的实际连接(`user@host[:port]`)。
14
14
  *
15
- * @param text 形如 `root@192.168.80.248` 或 `root@host:2222`;其它形态返回 undefined。
15
+ * @param text 形如 `root@192.0.2.10` 或 `root@host:2222`;其它形态返回 undefined。
16
16
  */
17
17
  export function parseUserHostPort(text) {
18
18
  const parsed = /^([^@]+)@(.+?)(?::(\d+))?$/.exec(typeof text === 'string' ? text : '')
@@ -27,8 +27,8 @@ export function parseUserHostPort(text) {
27
27
  * 退回宿主回显的 `tab.target` —— **从连接簿打开的 SSH 标签,spec 里只有条目名**
28
28
  * (tty 侧构造:`{t:'ssh', name: bookName, command}`),host 是空串。没有这层兜底,
29
29
  * 按 host 的匹配整条失效:会话主机显示为空、面板判成「该主机尚未配置为 Docker 目标」,
30
- * 哪怕用户早就按同一个主机配了目标(只是连接簿条目名不同,如 `HS-248` vs
31
- * `192.168.80.248`)。
30
+ * 哪怕用户早就按同一个主机配了目标(只是连接簿条目名不同,如 `lab-a` vs
31
+ * `192.0.2.10`)。
32
32
  *
33
33
  * @param spec tty 传过来的会话规格。
34
34
  * @param liveTarget 宿主回显的实际连接(tty 的 `tab.target`)。
@@ -71,7 +71,7 @@ export function pickTargetByHost(rows, session) {
71
71
  * 「该主机没配目标」,只能沿用上一次选的目标 → 屏幕上出现**另一台主机**的容器。
72
72
  *
73
73
  * 有了这一层,只要「会话走的那条连接簿」和「某条 docker 目标」指向同一台主机
74
- * (哪怕两条目标的 book 字段引用的是**不同**条目,如 HS-248 vs 192.168.80.248),
74
+ * (哪怕两条目标的 book 字段引用的是**不同**条目,如 lab-a vs 192.0.2.10),
75
75
  * 连接失败时也能对上目标——而那正是最需要面板的时候。
76
76
  *
77
77
  * @param bookName 会话所属的连接簿条目名(可能为空,如内联连接)。
package/lib/index.js CHANGED
@@ -752,8 +752,8 @@ const plugin = definePlugin({
752
752
  * SSH 标签,spec 里只有条目名;宿主回显的 `tab.target` 只在**连接成功**后才
753
753
  * 有值,而连不上(握手超时 / 主机没开机)恰恰是最需要面板的时候。少了这张表,
754
754
  * 面板只能判成「该主机没配目标」,然后沿用上一次选的目标——把另一台主机的容器
755
- * 显示出来。有了它,按主机配的目标(如目标绑 HS-248 条目、会话走
756
- * 192.168.80.248 条目)在连接失败时也能对上。
755
+ * 显示出来。有了它,按主机配的目标(如目标绑 lab-a 条目、会话走
756
+ * 192.0.2.10 条目)在连接失败时也能对上。
757
757
  */
758
758
  ttyBookHosts: [...books.entries()].map(([name, spec]) => ({ name, host: spec.host, port: spec.port })),
759
759
  ttyAvailable: books.size > 0,
package/lib/ssh-exec.js CHANGED
@@ -90,7 +90,7 @@ export function shJoin(argv) {
90
90
  /**
91
91
  * 连接池键:同一主机同一账号复用一条 SSH 连接。
92
92
  *
93
- * host 要 trim + 小写(D111):否则 `NAS.local` 与 `nas.local` 各建一条连接,而
93
+ * host 要 trim + 小写(D111):否则 `NAS.example` 与 `nas.example` 各建一条连接,而
94
94
  * `MAX_STREAMS_PER_TARGET` 与 `shouldRecycleConn` 都是**按连接**计的 → 同一台主机的
95
95
  * 长流额度被悄悄翻倍(恰好掩盖 D07 想暴露的 MaxSessions 问题)。口径与 TOFU 的
96
96
  * hostVerifier(D03)保持一致:那里也用 `trim().toLowerCase()` 分组指纹。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyzyn/dsh-docker",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "DSH Web GUI 的 Docker 容器面板插件:本机或 SSH 主机上的容器列表 / 启停删 / 日志 / 统计 / 镜像 / 一次性 exec,默认只读,配套只读优先的 agent 工具。",
5
5
  "keywords": [
6
6
  "dsh",
package/scripts/smoke.mjs CHANGED
@@ -626,24 +626,24 @@ test('sanitizeHostKeys:接受 fingerprints[] 与旧版单指纹,合并同 ho
626
626
  { host: '', fingerprint: 'abc' },
627
627
  { host: 'b', fingerprint: '' },
628
628
  { host: 'c', fingerprints: ['def', 'def'] },
629
- { host: 'NAS.local', port: 2222, fingerprints: ['fp1', ''] },
629
+ { host: 'NAS.example', port: 2222, fingerprints: ['fp1', ''] },
630
630
  null,
631
631
  ])
632
632
  assert.deepEqual(keys, [
633
633
  { host: 'a.example.com', port: 22, fingerprints: ['abc', 'def'] },
634
634
  { host: 'c', port: 22, fingerprints: ['def'] },
635
- { host: 'nas.local', port: 2222, fingerprints: ['fp1'] },
635
+ { host: 'nas.example', port: 2222, fingerprints: ['fp1'] },
636
636
  ])
637
637
  })
638
638
 
639
639
  test('mergeHostKeys:并集合并——客户端快照不得整表覆盖既有钉扎(D10)', () => {
640
640
  const base = [
641
- { host: 'nas.local', port: 22, fingerprints: ['pinned-1', 'pinned-2'] },
641
+ { host: 'nas.example', port: 22, fingerprints: ['pinned-1', 'pinned-2'] },
642
642
  { host: 'old.local', port: 2222, fingerprints: ['pinned-3'] },
643
643
  ]
644
- const merged = host.mergeHostKeys(base, [{ host: 'NAS.local', port: 22, fingerprints: ['pinned-1'] }])
644
+ const merged = host.mergeHostKeys(base, [{ host: 'NAS.example', port: 22, fingerprints: ['pinned-1'] }])
645
645
  assert.deepEqual(merged, [
646
- { host: 'nas.local', port: 22, fingerprints: ['pinned-1', 'pinned-2'] },
646
+ { host: 'nas.example', port: 22, fingerprints: ['pinned-1', 'pinned-2'] },
647
647
  { host: 'old.local', port: 2222, fingerprints: ['pinned-3'] },
648
648
  ])
649
649
  // 空表(面板启动竞态拿到的快照)不清空既有记录