@hyzyn/dsh-docker 0.7.0 → 0.7.2

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/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.2",
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
  // 空表(面板启动竞态拿到的快照)不清空既有记录
@@ -662,6 +662,13 @@ test('resolveTarget:本机 / 连接簿命中 / 连接簿缺失 / 内联', () =
662
662
  const missing = host.resolveTarget({ name: 'prod', kind: 'ssh', book: 'nope' }, books)
663
663
  assert.equal(missing.resolved, undefined)
664
664
  assert.match(missing.error, /连接簿条目不存在:nope/)
665
+ /*
666
+ * 指引必须指向用户**真能做的动作**:旧文案让用户"去 tty 终端面板的设置卡片里添加",
667
+ * 但那张卡片管的是 tty 自己的连接簿条目,改不了 docker 目标引用的名字——照着找只会扑空
668
+ * (实测:目标引用 HS-248、连接簿里只有 HS_248_ADMIN)。真正要改的是本卡片的「连接簿」下拉。
669
+ */
670
+ assert.match(missing.error, /本卡片/, '缺失引用时该指回本卡片的「连接簿」下拉')
671
+ assert.doesNotMatch(missing.error, /请在 tty 终端面板的设置卡片里添加/, '不该再让人去 tty 卡片做它做不到的事')
665
672
 
666
673
  const inline = host.resolveTarget({ name: 'inline', kind: 'ssh', host: 'h', username: 'u' }, books)
667
674
  assert.deepEqual(inline.resolved, { name: 'inline', kind: 'ssh', spec: { host: 'h', port: 22, username: 'u', auth: 'agent', keyPath: '', password: '', passphrase: '', agentForward: false } })