@linxin666/dsh-ssh 0.3.20 → 0.3.21

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: bf12f2cd3c82e9f12800c74f1d907f8cf08370f2
6
- README.zh.md: c404cbbf891f1d004ff23dc52c95d1e67d665450
5
+ README.md: e477f468d33c808362bab0fd246dc6eb2bfefb62
6
+ README.zh.md: d37b585d6e6a18f1a9bb22e8d9e223fb39b91076
package/README.md CHANGED
@@ -8,8 +8,8 @@ Built on the capability list of [badseal/ssh-skill](https://github.com/badseal/s
8
8
 
9
9
  | Capability | Description |
10
10
  | --- | --- |
11
- | 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) |
12
- | Config import | One-click parse of a standard `~/.ssh/config` (Host/HostName/User/Port/IdentityFile/IdentityAgent/ProxyJump etc.); existing aliases are skipped |
11
+ | 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) |
12
+ | Config import | One-click parse of a standard `~/.ssh/config` (Host/HostName/User/Port/IdentityFile/IdentityAgent/ProxyJump/ProxyCommand, `Include` files, blocks without HostName); skipped blocks are listed with their reason (wildcard pattern, existing alias, Match block, invalid fields) |
13
13
  | 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) |
14
14
  | Command execution | exec with a timeout (default 60s), stdout/stderr separated, output truncation guard (2MB) |
15
15
  | Web terminal | xterm.js + WebSocket PTY terminal, auto-sizing, real-time output |
@@ -18,13 +18,16 @@ Built on the capability list of [badseal/ssh-skill](https://github.com/badseal/s
18
18
  | Cluster execution | One command run concurrently across many hosts (filter by alias / environment / tag, default concurrency 8) |
19
19
  | Agent tools | `ssh_list` / `ssh_exec` / `ssh_upload` / `ssh_download` / `ssh_tunnel` / `ssh_cluster`; GUI and Agent share the same host config |
20
20
 
21
+ The panel loads its contents on first open. Closing and reopening it preserves the selected tab, form drafts and terminal session. The tunnel list refreshes every five seconds while its tab, panel and browser page are visible; automatic reads pause when hidden, resume immediately on return, and do not overlap slow reads. Port forwarding itself continues in the Host.
22
+
21
23
  ## Security model
22
24
 
23
25
  - 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.
24
26
  - 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).
25
27
  - ssh-agent auth stores only the agent socket path (or the special value `pageant`); it never reads or stores private-key material.
26
28
  - Tunnels only listen on `127.0.0.1`.
27
- - Deleting a host or changing its connection fields (host / port / user / auth / proxyJump) 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.
29
+ - Deleting a host or changing its connection fields (host / port / user / auth / proxyJump / proxyCommand) 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.
30
+ - A `proxyCommand` value is a shell command executed by the DSH host process with its privileges — exactly the trust `ssh(1)` gives the same line in `~/.ssh/config`. It can only come from the user's own 0600 store file: the Agent cannot create or edit hosts, and `ssh_list` reports only whether a host has one, never the command text.
28
31
  - Before the Agent uses a tool, the host must first be configured in the GUI (or imported from ~/.ssh/config).
29
32
  - `ssh_upload` / `ssh_download` read/write arbitrary local paths on this machine with host-process privileges (not through the bash sandbox) — same host-local-path semantics as ssh-skill, be aware of that permission surface.
30
33
  - Agent transfer tools move files only between this machine and a remote SSH host; local-file reads and writes must use the local file tools (read / write / edit / bash), never the `ssh_*` tools.
@@ -70,7 +73,10 @@ pnpm --filter @linxin666/dsh-ssh build # tsc types + tsdown dual-half artifact
70
73
  - The remote target path of an upload must be an absolute path (relative paths are rejected).
71
74
  - Download does not support a whole directory yet (download files individually); upload supports recursive directories (walks the local directory and transfers file by file).
72
75
  - exec auto-reconnect on disconnect (up to 3 times) may re-execute non-idempotent commands — watch out for side effects on long commands.
73
- - Every hop of a ProxyJump jump host must be a host alias already configured in this plugin.
76
+ - A ProxyJump hop is either a host alias configured in this plugin or an OpenSSH `[user@]host[:port]` address; an address hop has no stored credentials, so it reuses the target host's authentication (configure a host entry when the hop needs its own).
77
+ - `proxyCommand` and `proxyJump` cannot be combined on one host (OpenSSH resolves them by "whichever appears first in the config"; a stored entry has no order, so the plugin rejects the pair), and only the first hop of a chain may declare a ProxyCommand.
78
+ - A ProxyCommand is executed through the user's shell, so it inherits the DSH process's `PATH` and environment. On Windows the shell is killed without its process group, so a client it spawned may outlive the transport.
79
+ - The ssh_config import expands `Include` (globs, `~`, several pathnames, relative to the config directory) but not environment variables or `%` tokens, and a multi-pattern `Host a b` line still imports only its first pattern.
74
80
  - Resume (broken-transfer continuation) is not implemented yet.
75
81
  - The transfer of Agent tools is a host-machine local path (same semantics as ssh-skill).
76
82
 
package/README.zh.md CHANGED
@@ -8,8 +8,8 @@
8
8
 
9
9
  | 能力 | 说明 |
10
10
  | --- | --- |
11
- | 主机管理 | 增删改查、搜索、连接测试;支持按环境 / 标签分组折叠与组内批量测试;配置存 `~/.dsh/dsh-ssh.json`;支持密钥 / 密码 / ssh-agent 认证(OpenSSH agent / Pageant)、passphrase 密钥、ProxyJump 跳板机(多级) |
12
- | 配置导入 | 一键解析标准 `~/.ssh/config`(Host/HostName/User/Port/IdentityFile/IdentityAgent/ProxyJump 等),已有别名自动跳过 |
11
+ | 主机管理 | 增删改查、搜索、连接测试;支持按环境 / 标签分组折叠与组内批量测试;配置存 `~/.dsh/dsh-ssh.json`;支持密钥 / 密码 / ssh-agent 认证(OpenSSH agent / Pageant)、passphrase 密钥、ProxyJump 跳板机(多级)与 OpenSSH `ProxyCommand` 传输层(堡垒机客户端场景) |
12
+ | 配置导入 | 一键解析标准 `~/.ssh/config`(Host/HostName/User/Port/IdentityFile/IdentityAgent/ProxyJump/ProxyCommand、`Include` 文件、无 HostName 的块);被跳过的块逐条列出原因(通配符 pattern、别名已存在、Match 条件块、字段不合法) |
13
13
  | 持久连接池 | 每台主机复用长连接(对应 ssh-skill 的守护进程),空闲 30 分钟自动断开,断线自动重连(最多 3 次) |
14
14
  | 命令执行 | exec 带超时(默认 60s),stdout/stderr 分离,输出截断保护(2MB) |
15
15
  | Web 终端 | xterm.js + WebSocket PTY 终端,自适应尺寸,实时输出 |
@@ -18,13 +18,16 @@
18
18
  | 集群执行 | 一条命令并发跑多台主机(按别名 / 环境 / 标签过滤,默认并发 8) |
19
19
  | Agent 工具 | `ssh_list` / `ssh_exec` / `ssh_upload` / `ssh_download` / `ssh_tunnel` / `ssh_cluster`,GUI 与 Agent 共享同一份主机配置 |
20
20
 
21
+ 面板在首次打开时加载内容。关闭后重新打开会保留选中的页签、表单草稿和终端会话。隧道列表仅在隧道页签、面板和浏览器页面都可见时每五秒刷新;隐藏时暂停自动查询,恢复可见时立即刷新,慢查询期间不叠加请求。端口转发本身继续在 Host 中运行。
22
+
21
23
  ## 安全模型
22
24
 
23
25
  - 所有 `/api/dsh-ssh/*` 路由仅限 loopback 访问(含同源校验)——对远程服务器执行命令的接口不会暴露给局域网。
24
26
  - 密码 / 密钥口令以明文保存在 `~/.dsh/dsh-ssh.json`,文件权限 0600、目录 0700(与 ssh-skill 把密码写进 ssh-config 注释同一信任模型)。
25
27
  - ssh-agent 认证仅保存 agent socket 路径(或 `pageant` 特殊值),不读取也不保存任何私钥材料。
26
28
  - 隧道只监听 `127.0.0.1`。
27
- - 删除主机或修改其连接字段(host / port / user / auth / proxyJump)会立即断开该别名的池化连接与隧道,后续操作按新配置重新建连,不会复用旧凭据的已认证连接。
29
+ - 删除主机或修改其连接字段(host / port / user / auth / proxyJump / proxyCommand)会立即断开该别名的池化连接与隧道,后续操作按新配置重新建连,不会复用旧凭据的已认证连接。
30
+ - `proxyCommand` 是一条由 DSH 宿主进程以其自身权限执行的 shell 命令——与 `ssh(1)` 执行 `~/.ssh/config` 里同一行的信任模型一致。它只能来自用户自己的 0600 配置文件:Agent 无法创建或修改主机,`ssh_list` 只报告该主机是否配置了 ProxyCommand,不返回命令原文。
28
31
  - Agent 使用工具前,主机需先在 GUI 中配置(或从 ~/.ssh/config 导入)。
29
32
  - `ssh_upload` / `ssh_download` 以宿主进程权限直接读写本机任意路径(不经 bash 沙箱)——与 ssh-skill 的宿主本地路径语义一致,注意该权限面。
30
33
  - Agent 传输工具只在本机与远程 SSH 主机之间移动文件;本机文件的读写一律使用本地文件工具(read / write / edit / bash),不要使用 `ssh_*` 工具。
@@ -70,7 +73,10 @@ pnpm --filter @linxin666/dsh-ssh build # tsc 类型 + tsdown 双半区产物
70
73
  - 上传的远程目标路径必须是绝对路径(相对路径会被拒绝)。
71
74
  - 下载暂不支持整个目录(逐文件下载);上传支持目录递归(walk 本地目录逐文件传)。
72
75
  - exec 断线自动重连(最多 3 次)可能重复执行非幂等命令——长命令注意副作用。
73
- - 跳板机 ProxyJump 的每一跳必须是本插件已配置的主机别名。
76
+ - 跳板机 ProxyJump 的每一跳可以是本插件已配置的主机别名,也可以是 OpenSSH 的 `[user@]host[:port]` 地址;地址形式的跳板没有自己的凭据,复用目标主机的认证(跳板需要独立凭据时请单独配置主机)。
77
+ - 同一台主机不能同时配置 `proxyCommand` 与 `proxyJump`(OpenSSH 按「配置中先出现者生效」解析,而存储条目没有先后顺序,因此直接报错),且链式跳板中只有第一跳可以声明 ProxyCommand。
78
+ - ProxyCommand 由用户 shell 执行,因此继承 DSH 进程的 `PATH` 与环境变量。Windows 上只杀 shell、不带进程组,它拉起的客户端进程可能比传输层存活更久。
79
+ - ssh_config 导入会展开 `Include`(glob、`~`、多路径、相对配置目录),但不支持环境变量与 `%` token;`Host a b` 这类多 pattern 行仍只导入第一个 pattern。
74
80
  - 断点续传(resume)暂未实现。
75
81
  - Agent 工具的传输为宿主机器本地路径(与 ssh-skill 相同的语义)。
76
82