dsh-server-ops-agent 0.0.0-stage → 0.3.0-beta.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.
- package/DSH-Linux-/351/246/226/346/254/241/350/277/236/346/216/245.md +33 -0
- package/LICENSE +21 -0
- package/README.md +31 -2
- package/client.js +640 -0
- package/connection-protocol.js +7 -0
- package/connections.js +213 -0
- package/cordis.patch.yml +12 -0
- package/deployment.js +93 -0
- package/generated/linux-release.json +5 -0
- package/generated/linux-release.tgz +0 -0
- package/generated/ssh-client.cjs +20120 -0
- package/generated/ssh-licenses.txt +161 -0
- package/native-workspace.js +75 -0
- package/package.json +62 -4
- package/plugin.js +140 -0
- package/ssh-client.js +182 -0
- package/workspace-tool.js +21 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# 在 DSH 连接 Linux
|
|
2
|
+
|
|
3
|
+
公开 beta 为 `0.3.0-beta.1`。DSH 兼容版本为 `0.2.2-rc.5`。Linux 需要 systemd、OpenSSH、Python 3、`flock`、`ss` 及可运行 Node.js 的 glibc 环境。安装器接受 Linux ARM64 与 x64。两端使用同一个发行版本。
|
|
4
|
+
|
|
5
|
+
## 使用 DSH 安装
|
|
6
|
+
|
|
7
|
+
在 DSH 添加插件 `dsh-server-ops-agent@0.3.0-beta.1`。使用 GitHub 预发布中的插件包离线安装时,将下载路径传给 DSH CLI。
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
dsh plugin --profile ops-workbench add "file:/path/to/dsh-server-ops-agent-0.3.0-beta.1.tgz" --offline
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
1. 打开侧栏的「服务器运维」,填写 SSH 主机、端口和用户。使用服务器管理员核对过的 SHA256 主机指纹。
|
|
14
|
+
2. 选择「验证并连接」。已有服务会直接连接。首次部署时,有 root 或免密 sudo 的账号可在核对目标与版本后选择「确认部署并连接」。普通账号可将页面上的命令交给管理员。
|
|
15
|
+
3. DSH 在 SSH 会话中上传并校验内置的同版发行包。安装后会重新连接,让 SSH 用户取得运维读取组权限。值班页显示真实容量采样、本机 SSH 服务状态和最近同步时间。「运维 Agent」可打开绑定该主机的原生会话。
|
|
16
|
+
|
|
17
|
+
SSH 私钥可使用本机未加密私钥的绝对路径。留空时,插件尝试 SSH agent 及默认私钥。加密私钥可先加入 SSH agent。私钥保留在 DSH 宿主。
|
|
18
|
+
|
|
19
|
+
## 手工安装与升级
|
|
20
|
+
|
|
21
|
+
从 GitHub 预发布下载 `server-ops-agent-linux-0.3.0-beta.1.tgz` 和 `SHA256SUMS`。核对该文件的 SHA-256 后解压。服务器上执行以下命令,将 `opslogin` 替换为实际 SSH 用户。
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
sudo sh install-linux.sh install
|
|
25
|
+
sudo usermod -aG server-ops-read -- opslogin
|
|
26
|
+
sudo ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
已安装旧版本时,使用新版安装包中的 `sudo sh install-linux.sh upgrade`。安装器在升级失败时恢复旧版本、systemd 单元与 SSH 入口,并复查原服务。重复执行同版 `install` 会沿用现有安装与 SQLite 账本。使用 `start` 或 `stop` 启动或停止服务。
|
|
30
|
+
|
|
31
|
+
安装器优先使用带 SQLite 的 Node.js 22.13 或新版,否则在专用目录安装通过 SHA-256 校验的官方 Node.js 22.23.5。离线安装可以预装兼容 Node,或将对应架构的 [官方 Node.js tar.xz](https://nodejs.org/dist/v22.23.5/) 放到安装器旁边。安装器不会更改系统默认 Node。
|
|
32
|
+
|
|
33
|
+
服务账户为 `server-ops`,账本目录为 `/var/lib/server-ops-agent`,SSH 入口为 `/usr/local/bin/dsh-server-ops`。可在 `/etc/server-ops-agent.conf` 设置 `SERVER_OPS_HOST_ID` 和 `SERVER_OPS_SSH_PORT`。默认观察服务器本地的 SSH 端口 22。更改配置后运行 `sudo systemctl restart server-ops-agent`。升级后 DSH 会继续使用已登记的服务器标识和工作区。
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 yanaoyong
|
|
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
|
@@ -1,3 +1,32 @@
|
|
|
1
|
-
#
|
|
1
|
+
# DSH 服务器运维 Agent
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
DeepSeek Harness 的 Linux 运维插件。通过已有 SSH 连接读取服务器采样、巡检日报和事件证据,在 DSH 中提供绑定服务器的原生运维会话。
|
|
4
|
+
|
|
5
|
+
## 安装并连接
|
|
6
|
+
|
|
7
|
+
1. 在 DSH 添加 `dsh-server-ops-agent@0.3.0-beta.1`,或使用 GitHub 预发布中的同版插件包离线安装。
|
|
8
|
+
2. 打开侧栏「服务器运维」,填写 SSH 主机、端口、用户和管理员核对过的 SHA256 主机指纹。选择「验证并连接」。
|
|
9
|
+
3. 已部署的服务器直接连接。首次部署时,管理员确认目标、版本和权限后,插件上传同版本 Linux 包并校验,部署后重新连接。普通 SSH 用户可以把指引中的命令交给服务器管理员。
|
|
10
|
+
4. 在「值班」查看容量采样、趋势和事件,在「日报」查看每日巡检记录,或从「运维 Agent」打开原生会话。
|
|
11
|
+
|
|
12
|
+
本版面向 DSH `0.2.2-rc.5` 和运行 systemd 的 Linux。服务器通过独立账户运行服务,在本机 SQLite 保存采样。运维会话使用只读工具。
|
|
13
|
+
|
|
14
|
+
- [安装、升级和运行时依赖](DSH-Linux-首次连接.md)
|
|
15
|
+
- [下载插件、Linux 包和校验值](https://github.com/yanaoyong/dsh-server-ops-agent/releases)
|
|
16
|
+
- [公开分发方案](docs/distribution.md)
|
|
17
|
+
|
|
18
|
+
## 从源码构建
|
|
19
|
+
|
|
20
|
+
构建机需要 Node.js 22.13 或更新版本及 Python 3。检出目标版本标签后运行:
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
npm ci --ignore-scripts
|
|
24
|
+
npm test
|
|
25
|
+
mkdir -p dist
|
|
26
|
+
npm pack --pack-destination dist
|
|
27
|
+
cp generated/linux-release.tgz dist/server-ops-agent-linux-0.3.0-beta.1.tgz
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
`npm pack` 会生成 Linux 发行包并原样内置到 DSH 插件。发布时将同一份 Linux 包和两份产物的 SHA-256 上传到 GitHub 预发布,并把已验收的插件包发布到 npm 的 `beta` 标签。
|
|
31
|
+
|
|
32
|
+
本项目采用 [MIT 许可证](LICENSE)。插件包内的 `generated/ssh-licenses.txt` 记录 SSH 依赖的许可。
|