@linxin666/dsh-ssh 0.4.8 → 0.4.10

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.i18n.yaml CHANGED
@@ -2,5 +2,5 @@
2
2
  # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
3
  # after editing either side, bring the other along and re-record with:
4
4
  # node scripts/verify-docs.mjs --write <dir>
5
- README.md: e44e8d7b173631b5a89c84b8528e2473ff8f761a
6
- README.zh.md: fe03e7ef27d6c70c96f8d71bfbc548ebab910c19
5
+ README.md: e7e0f86ba8665e61d5240b46dc6d56573f6680e1
6
+ README.zh.md: 0ad01f5c53c93cf2b4286ff25923643bfe3724de
package/README.md CHANGED
@@ -5,7 +5,7 @@ English | [中文](README.zh.md)
5
5
  <p align="center">
6
6
  <img src="https://img.shields.io/npm/v/@linxin666/dsh-ssh?style=flat-square" alt="Version">
7
7
  &nbsp;
8
- <img src="https://img.shields.io/badge/DSH-%3E%3D0.2.1--rc.2-4c6ef5?style=flat-square&amp;labelColor=454a54" alt="DSH">
8
+ <img src="https://img.shields.io/badge/DSH-%3E%3D0.2.1--rc.3-4c6ef5?style=flat-square&amp;labelColor=454a54" alt="DSH">
9
9
  &nbsp;
10
10
  <img src="https://img.shields.io/badge/license-Apache--2.0-blue?style=flat-square" alt="License">
11
11
  </p>
@@ -21,10 +21,10 @@ A dedicated remote Linux server operations and cluster management plugin for Dee
21
21
 
22
22
  | Capability | Description |
23
23
  | --- | --- |
24
- | Host management | CRUD, search, connection test; collapsible grouping by environment / tags with per-group batch test; config stored in `~/.dsh/dsh-ssh.json`; supports key / password / ssh-agent auth (OpenSSH agent / Pageant), passphrase keys, ProxyJump jump hosts (multi-level) and OpenSSH `ProxyCommand` transports (bastion clients) |
24
+ | Host management | CRUD, search, connection test; collapsible grouping by environment / tags with per-group batch test; config stored in `~/.dsh/dsh-ssh.json`; supports key / password / ssh-agent auth (OpenSSH agent, with Pageant still selectable on Windows), passphrase keys, ProxyJump jump hosts (multi-level) and OpenSSH `ProxyCommand` transports (bastion clients) |
25
25
  | Config import | One-click parse of a standard `~/.ssh/config` (Host/HostName/User/Port/IdentityFile/IdentityAgent/ForwardAgent/ProxyJump/ProxyCommand, `Include` files, blocks without HostName); `ForwardAgent yes|true|on` imports as enabled and `no|false|off` (or no directive) as disabled; skipped blocks are listed with their reason (wildcard pattern, existing alias, Match block, invalid fields) |
26
26
  | Persistent connection pool | Reuses a long-lived connection per host (opposite of the ssh-skill daemon), automatically disconnects after 30 minutes idle, auto-reconnects on disconnect (up to 3 times) |
27
- | Agent forwarding | Opt-in per host through the `forwardAgent` flag (`ssh -A`); the form has an "Enable agent forwarding" checkbox, the host list shows an agent-forwarding badge for enabled hosts, and `ssh_list` reports `forwardAgent` with a forward column in its table. The endpoint is the host's configured agent path, otherwise `SSH_AUTH_SOCK`, otherwise Pageant on Windows; a host with no local endpoint fails with an explicit error instead of connecting without forwarding. A server that refuses the request (`AllowAgentForwarding no`) surfaces its own error and is never downgraded to a silent non-forwarded session. The flag never touches the stored profile when it is off |
27
+ | Agent forwarding | Opt-in per host through the `forwardAgent` flag (`ssh -A`); the form has an "Enable agent forwarding" checkbox, the host list shows an agent-forwarding badge for enabled hosts, and `ssh_list` reports `forwardAgent` with a forward column in its table. The endpoint is the host's configured agent path, otherwise `SSH_AUTH_SOCK`, otherwise the native OpenSSH named pipe (`\\.\pipe\openssh-ssh-agent`) on Windows; a host with no local endpoint fails with an explicit error instead of connecting without forwarding. A server that refuses the request (`AllowAgentForwarding no`) surfaces its own error and is never downgraded to a silent non-forwarded session. The flag never touches the stored profile when it is off |
28
28
  | Command execution | exec with a timeout (default 60s), stdout/stderr separated, output truncation guard (2MB) |
29
29
  | Web terminal | xterm.js + WebSocket PTY terminal, auto-sizing, real-time output |
30
30
  | File transfer | SFTP upload (browser file picker, NDJSON progress stream), download (progress bar + browser save); remote directory browsing |
@@ -38,8 +38,8 @@ The panel loads its contents on first open. Closing and reopening it preserves t
38
38
 
39
39
  - All `/api/dsh-ssh/*` routes are loopback-only (with same-origin checks) — the interfaces that execute commands against remote servers are not exposed to the LAN.
40
40
  - Passwords / key passphrases are stored in plain text in `~/.dsh/dsh-ssh.json`, file mode 0600, directory 0700 (the same trust model as ssh-skill writing passwords into ssh-config comments).
41
- - ssh-agent auth stores only the agent socket path (or the special value `pageant`); it never reads or stores private-key material.
42
- - Agent forwarding is opt-in per host and off by default. With `forwardAgent` enabled, every exec and PTY session on that host asks the server for `auth-agent-req@openssh.com`, which means the remote host can authenticate as this machine with your local keys. Enable it only for hosts you trust, and remember every session on such a host can use the forwarded agent. When no agent endpoint resolves (the configured agent path, `SSH_AUTH_SOCK`, Pageant on Windows) the connection fails instead of forwarding nothing, and a server that refuses the request surfaces its error exactly as it comes back.
41
+ - ssh-agent auth stores only the agent socket path (or the special value `pageant`); it never reads or stores private-key material. An empty agent path is not a secret and is always saved: it means auto-detect (`SSH_AUTH_SOCK`, then the native OpenSSH named pipe on Windows), so switching a host to SSH Agent takes effect even with the field left blank.
42
+ - Agent forwarding is opt-in per host and off by default. With `forwardAgent` enabled, every exec and PTY session on that host asks the server for `auth-agent-req@openssh.com`, which means the remote host can authenticate as this machine with your local keys. Enable it only for hosts you trust, and remember every session on such a host can use the forwarded agent. When no agent endpoint resolves (the configured agent path, `SSH_AUTH_SOCK`, the native OpenSSH named pipe on Windows) the connection fails instead of forwarding nothing, and a server that refuses the request surfaces its error exactly as it comes back.
43
43
  - Tunnels only listen on `127.0.0.1`.
44
44
  - Deleting a host or changing its connection fields (host / port / user / auth / proxyJump / proxyCommand / forwardAgent) immediately closes that alias's pooled connection and tunnels; later operations reconnect with the new configuration and never reuse a connection authenticated with the old credentials.
45
45
  - When the SSH connection behind a tunnel drops, the tunnel retires itself: the local port stops accepting, the tunnel leaves the list, and the connection that arrives during the drop is closed without traffic instead of interrupting the host process.
@@ -69,7 +69,7 @@ After installing, **restart `dsh web`**: a "SSH" entry appears in the sidebar; t
69
69
 
70
70
  ## Configuration
71
71
 
72
- The settings panel (plugin config) toggles `announceToAgent` (whether to announce the plugin to the Agent; off by default so system prompts stay clean) and `enabled` (master switch), and sets `terminalFontFamily` (the web terminal font; empty defers to the CSS chain: `--dsh-ssh-terminal-font` → the official `--ds-font-family-code` token → the built-in monospace stack). The terminal font is fixed in the xterm constructor, so a plain stylesheet cannot override it; to render powerline / Nerd Font glyphs, enter a Nerd Font stack here (e.g. `"SauceCodePro Nerd Font", monospace`). Changes re-apply to open terminals live, no reconnect needed.
72
+ The settings panel (plugin config) toggles `announceToAgent` (whether to announce the plugin to the Agent; off by default so system prompts stay clean) and `enabled` (master switch), sets `terminalFontFamily` (the web terminal font; empty defers to the CSS chain: `--dsh-ssh-terminal-font` → the official `--ds-font-family-code` token → the built-in monospace stack), and sets `connectTimeoutMs` (the shared ceiling for TCP connect, SSH key exchange and user authentication, default 30000 ms, allowed 1000-600000). Raise `connectTimeoutMs` on hosts whose authentication is slow (for example PAM or LDAP behind a distant directory service): every connection entry point — `ssh_exec`, the web terminal, SFTP transfers, tunnels and cluster runs — reads it, while the `timeoutMs` argument of `ssh_exec` / `ssh_cluster` only bounds the remote command once the connection is ready. The terminal font is fixed in the xterm constructor, so a plain stylesheet cannot override it; to render powerline / Nerd Font glyphs, enter a Nerd Font stack here (e.g. `"SauceCodePro Nerd Font", monospace`). Changes re-apply to open terminals live, no reconnect needed; a new `connectTimeoutMs` applies to connections opened afterwards, and pooled connections are unaffected until they reconnect.
73
73
 
74
74
  ## Data
75
75
 
package/README.zh.md CHANGED
@@ -5,7 +5,7 @@
5
5
  <p align="center">
6
6
  <img src="https://img.shields.io/npm/v/@linxin666/dsh-ssh?style=flat-square" alt="Version">
7
7
  &nbsp;
8
- <img src="https://img.shields.io/badge/DSH-%3E%3D0.2.1--rc.2-4c6ef5?style=flat-square&amp;labelColor=454a54" alt="DSH">
8
+ <img src="https://img.shields.io/badge/DSH-%3E%3D0.2.1--rc.3-4c6ef5?style=flat-square&amp;labelColor=454a54" alt="DSH">
9
9
  &nbsp;
10
10
  <img src="https://img.shields.io/badge/license-Apache--2.0-blue?style=flat-square" alt="License">
11
11
  </p>
@@ -21,10 +21,10 @@
21
21
 
22
22
  | 能力 | 说明 |
23
23
  | --- | --- |
24
- | 主机管理 | 增删改查、搜索、连接测试;支持按环境 / 标签分组折叠与组内批量测试;配置存 `~/.dsh/dsh-ssh.json`;支持密钥 / 密码 / ssh-agent 认证(OpenSSH agent / Pageant)、passphrase 密钥、ProxyJump 跳板机(多级)与 OpenSSH `ProxyCommand` 传输层(堡垒机客户端场景) |
24
+ | 主机管理 | 增删改查、搜索、连接测试;支持按环境 / 标签分组折叠与组内批量测试;配置存 `~/.dsh/dsh-ssh.json`;支持密钥 / 密码 / ssh-agent 认证(OpenSSH agent,Windows 上仍可选 Pageant)、passphrase 密钥、ProxyJump 跳板机(多级)与 OpenSSH `ProxyCommand` 传输层(堡垒机客户端场景) |
25
25
  | 配置导入 | 一键解析标准 `~/.ssh/config`(Host/HostName/User/Port/IdentityFile/IdentityAgent/ForwardAgent/ProxyJump/ProxyCommand、`Include` 文件、无 HostName 的块);`ForwardAgent yes|true|on` 导入为启用,`no|false|off` 或没有该指令导入为关闭;被跳过的块逐条列出原因(通配符 pattern、别名已存在、Match 条件块、字段不合法) |
26
26
  | 持久连接池 | 每台主机复用长连接(对应 ssh-skill 的守护进程),空闲 30 分钟自动断开,断线自动重连(最多 3 次) |
27
- | Agent 转发 | 按主机选择性启用(`ssh -A`):主机表单提供「启用 Agent 转发」勾选框,主机列表为已启用的主机显示「Agent 转发」标记;`ssh_list` 输出带 `forwardAgent`,渲染表格中对应一列。转发的本地端点依次取主机配置的 agent 路径、`SSH_AUTH_SOCK`、Windows 上的 Pageant;三者都拿不到时连接直接报错,不会静默地不转发。服务端拒绝该请求(`AllowAgentForwarding no`)时原样呈现服务端错误,绝不静默降级为未转发的会话。关闭时不写入配置文件 |
27
+ | Agent 转发 | 按主机选择性启用(`ssh -A`):主机表单提供「启用 Agent 转发」勾选框,主机列表为已启用的主机显示「Agent 转发」标记;`ssh_list` 输出带 `forwardAgent`,渲染表格中对应一列。转发的本地端点依次取主机配置的 agent 路径、`SSH_AUTH_SOCK`、Windows 上的原生 OpenSSH 命名管道(`\\.\pipe\openssh-ssh-agent`);三者都拿不到时连接直接报错,不会静默地不转发。服务端拒绝该请求(`AllowAgentForwarding no`)时原样呈现服务端错误,绝不静默降级为未转发的会话。关闭时不写入配置文件 |
28
28
  | 命令执行 | exec 带超时(默认 60s),stdout/stderr 分离,输出截断保护(2MB) |
29
29
  | Web 终端 | xterm.js + WebSocket PTY 终端,自适应尺寸,实时输出 |
30
30
  | 文件传输 | SFTP 上传(浏览器选文件,NDJSON 进度流)、下载(进度条 + 浏览器保存);远程目录浏览 |
@@ -38,8 +38,8 @@
38
38
 
39
39
  - 所有 `/api/dsh-ssh/*` 路由仅限 loopback 访问(含同源校验)——对远程服务器执行命令的接口不会暴露给局域网。
40
40
  - 密码 / 密钥口令以明文保存在 `~/.dsh/dsh-ssh.json`,文件权限 0600、目录 0700(与 ssh-skill 把密码写进 ssh-config 注释同一信任模型)。
41
- - ssh-agent 认证仅保存 agent socket 路径(或 `pageant` 特殊值),不读取也不保存任何私钥材料。
42
- - Agent 转发是按主机选择性启用的能力,默认关闭。启用 `forwardAgent` 后,该主机上的每个 exec 与 PTY 会话都会向服务端请求 `auth-agent-req@openssh.com`,这意味着远端主机可以用你本机的密钥以这台机器的身份完成认证。只为你信任的主机启用,并记住这类主机上的每个会话都能使用被转发的 agent。本地端点(主机配置的 agent 路径、`SSH_AUTH_SOCK`、Windows 上的 Pageant)解析不出来时连接直接失败,而不是什么都不转发;服务端拒绝该请求时,其错误原样呈现。
41
+ - ssh-agent 认证仅保存 agent socket 路径(或 `pageant` 特殊值),不读取也不保存任何私钥材料。空的 agent 路径不是机密,任何时候都会提交:它表示自动检测(`SSH_AUTH_SOCK`,Windows 上再退到原生 OpenSSH 命名管道),因此把主机改成 SSH Agent 后即使路径留空也会生效。
42
+ - Agent 转发是按主机选择性启用的能力,默认关闭。启用 `forwardAgent` 后,该主机上的每个 exec 与 PTY 会话都会向服务端请求 `auth-agent-req@openssh.com`,这意味着远端主机可以用你本机的密钥以这台机器的身份完成认证。只为你信任的主机启用,并记住这类主机上的每个会话都能使用被转发的 agent。本地端点(主机配置的 agent 路径、`SSH_AUTH_SOCK`、Windows 上的原生 OpenSSH 命名管道)解析不出来时连接直接失败,而不是什么都不转发;服务端拒绝该请求时,其错误原样呈现。
43
43
  - 隧道只监听 `127.0.0.1`。
44
44
  - 删除主机或修改其连接字段(host / port / user / auth / proxyJump / proxyCommand / forwardAgent)会立即断开该别名的池化连接与隧道,后续操作按新配置重新建连,不会复用旧凭据的已认证连接。
45
45
  - 隧道背后的 SSH 连接一旦断开,隧道会自行退役:本地端口不再接受连接,隧道从列表中消失;断开期间到达的连接被直接关闭且没有流量,不会打断宿主进程。
@@ -69,7 +69,7 @@ dsh plugin --profile web add link:$(pwd)/packages/dsh-ssh
69
69
 
70
70
  ## 配置
71
71
 
72
- 设置面板(插件配置)可开关 `announceToAgent`(是否向 Agent 宣告插件;默认关闭,保持系统提示词干净)与 `enabled`(总开关),并可设置 `terminalFontFamily`(Web 终端字体,留空则按 CSS 链解析:`--dsh-ssh-terminal-font` → 官方 `--ds-font-family-code` token → 内置 monospace 栈)。终端字体写死在 xterm 构造参数里,CSS 无法直接覆盖;要渲染 powerline / Nerd Font 图标,请在此填入对应 Nerd Font 栈(如 `"SauceCodePro Nerd Font", monospace`),修改对已打开的终端即时生效,无需重连。
72
+ 设置面板(插件配置)可开关 `announceToAgent`(是否向 Agent 宣告插件;默认关闭,保持系统提示词干净)与 `enabled`(总开关),设置 `terminalFontFamily`(Web 终端字体,留空则按 CSS 链解析:`--dsh-ssh-terminal-font` → 官方 `--ds-font-family-code` token → 内置 monospace 栈),并设置 `connectTimeoutMs`(TCP 连接、SSH 密钥交换与用户认证三个阶段共用的上限,默认 30000 毫秒,允许 1000-600000)。认证较慢的主机(例如 PAM 或 LDAP 位于较远的目录服务后面)应调大 `connectTimeoutMs`:`ssh_exec`、Web 终端、SFTP 传输、隧道与集群执行等所有连接入口都读取该值,而 `ssh_exec` / `ssh_cluster` 的 `timeoutMs` 只约束连接就绪后的远程命令。终端字体写死在 xterm 构造参数里,CSS 无法直接覆盖;要渲染 powerline / Nerd Font 图标,请在此填入对应 Nerd Font 栈(如 `"SauceCodePro Nerd Font", monospace`),修改对已打开的终端即时生效,无需重连;新的 `connectTimeoutMs` 对之后建立的连接生效,池化连接在重连前不受影响。
73
73
 
74
74
  ## 数据
75
75
 
package/lib/client.js CHANGED
@@ -87,8 +87,8 @@ window.__ModuleLoader__.load({
87
87
  "form.auth.password": "密码",
88
88
  "form.auth.agent": "SSH Agent",
89
89
  "form.agentPath": "Agent 路径",
90
- "form.agentPathHint": "留空自动检测(SSH_AUTH_SOCK / Windows Pageant);也可填 socket 路径或 pageant",
91
- "form.authKeepHint": "编辑时密钥/密码/Agent 留空将保留原认证方式与已存凭据;如需更换认证方式请填写新凭据。",
90
+ "form.agentPathHint": "留空自动检测(SSH_AUTH_SOCK;Windows 上为原生 ssh-agent 命名管道);也可填 socket 路径或 pageant",
91
+ "form.authKeepHint": "编辑时密码 / 私钥留空将保留已存凭据;Agent 路径留空是合法的自动检测,选「SSH Agent」即切换到 agent 认证。",
92
92
  "form.keyPath": "私钥路径",
93
93
  "form.keyPathHint": "如 ~/.ssh/id_ed25519",
94
94
  "form.passphrase": "密钥口令",
@@ -247,8 +247,8 @@ window.__ModuleLoader__.load({
247
247
  "form.auth.password": "Password",
248
248
  "form.auth.agent": "SSH Agent",
249
249
  "form.agentPath": "Agent path",
250
- "form.agentPathHint": "Leave empty to auto-detect (SSH_AUTH_SOCK / Pageant on Windows), or set a socket path or \"pageant\"",
251
- "form.authKeepHint": "While editing, empty secret fields keep the stored authentication and credentials; enter new values to switch methods.",
250
+ "form.agentPathHint": "Leave empty to auto-detect (SSH_AUTH_SOCK; the native ssh-agent named pipe on Windows), or set a socket path or \"pageant\"",
251
+ "form.authKeepHint": "While editing, an empty password or key field keeps the stored credential; an empty agent path is a valid auto-detect, so choosing SSH Agent switches the host to agent auth.",
252
252
  "form.keyPath": "Private key path",
253
253
  "form.keyPathHint": "e.g. ~/.ssh/id_ed25519",
254
254
  "form.passphrase": "Key passphrase",
@@ -1296,7 +1296,7 @@ window.__ModuleLoader__.load({
1296
1296
  setError(tt("form.passwordRequired"));
1297
1297
  return;
1298
1298
  }
1299
- const secretEmpty = form.authKind === "password" ? form.password === "" : form.authKind === "key" ? form.keyPath.trim() === "" : form.agentPath.trim() === "";
1299
+ const secretEmpty = form.authKind === "password" ? form.password === "" : form.authKind === "key" ? form.keyPath.trim() === "" : false;
1300
1300
  const payload = {
1301
1301
  host,
1302
1302
  port,
@@ -16452,7 +16452,7 @@ window.__ModuleLoader__.load({
16452
16452
  /** The building package's version, when the bundle carries it. */
16453
16453
  function bakedVersion() {
16454
16454
  try {
16455
- return "0.4.8";
16455
+ return "0.4.10";
16456
16456
  } catch {
16457
16457
  return;
16458
16458
  }