dsh-server-box: Manage Multiple SSH Servers with Cards in DSH

Introduction

When working on networking or operations capabilities in DeepSeek Harness (DSH), common practices include piecing together SSH commands within conversations or switching hosts in separate terminal windows. As the number of hosts increases, online status, resource usage, and file transfers become scattered across different tools, making it difficult to align the session context with “which machine is currently connected.”

Below is an introduction to the community plugin dsh-server-box (maintainer hoshino114): It provides a server card dashboard, metric trends, an xterm interactive terminal, and SFTP file transfers on the DSH Web side, with the ledger and keys stored locally in ~/.dsh/. Originally named dsh-server-deck (meyaomiao/DSH-server-deck), the current repository is hoshino114/dsh-server-box; the SkillHub category is “Networking Tools.” Licensed under MIT, the current package version is 0.5.0, with the mainline corresponding to DSH 0.1.5-rc.1 / 0.1.5-rc.2 and subsequent 0.1.5 releases.

What is this

dsh-server-box is a host + web client capability plugin for DSH: The Host half provides loopback-only REST, WebSocket PTY bridges, and SFTP interfaces; the Client half displays a “Servers” tab in the sidebar (or a standalone drawer), rendering cards, trend charts, terminals, and file browsers using React.

It solves the problem of: under the permissions of the local DSH process, centrally maintaining SSH host ledgers, periodically collecting snapshots, persisting trends locally, and clicking cards in the browser to enter shells or transfer files—complementing pure conversational tools without replacing your actual remote operations workflows.

Card Dashboard and Auto-Refresh

One card per host, elements include:

  • Status dot: Online (with breathing glow), Offline, Probing, Unknown.
  • System info: OS name, uptime, CPU cores, handshake latency.
  • CPU / Memory / Disk usage bars (<60% green, ≥60% yellow, ≥85% red).
  • Network speed and monthly traffic (Linux ~1s sampling; skipping lo, docker, veth, and other virtual NICs).
  • Inline display of failure reasons when offline.

Refresh strategy options: Manual / 10s / 15s / 30s / 60s; it reads host-side snapshots without initiating separate on-site SSH sessions for refreshing. The “Refresh” button forces an immediate probe.

Trend View and Local Metrics

Card view and Trend view are switchable (no overlay charts within cards). Each host has separate charts for CPU, Memory, and Disk.

Capability Description
Time Window 1 hour (rolling, default), 24 hours (rolling), Week, Month (local calendar days starting from 0:00, including today), Custom (≤31 days)
Granularity Auto / 10s / 30s / 1m / 5m / 15m / 1h; single query limit 1200 points, auto-upscaling if exceeded
Collection Resident on host side, default 10s (optional 30s / 1m / 5m), independent of whether the panel is open
Persistence ~/.dsh/server-box-metrics/{hostId}/; cascade deletion when host is removed

Open the “Servers” tab → click “📈 Trends” in the toolbar. When first enabled, curves may only show a small segment on the right; wait for a few collection cycles to spread out. If the window is earlier than local records, try using sar -u / sar -r (sysstat) to backfill CPU / Memory; disk capacity cannot be backfilled.

Interactive Terminal and File Transfer

Terminal: Click a card to enter an xterm.js terminal (5000 lines scrollback, 256 colors, size synchronization). The Node side bridges WebSocket ↔ ssh2 shell. Web WS derives based on the page Host origin; DSH Desktop (dsh-app://app) derives ws://127.0.0.1:<port>/server-box/ws/pty from __DSH_TRANSPORT__.streamBaseUrl (0.5.x fixes desktop WebSocket errors).

SFTP: Click “📁 Files” on cards or trend cards, or use the shortcut in the terminal header, to enter the remote directory browser—list, upload, download, create directories, delete (prompts before recursing for non-empty directories). Transfers open a separate SFTP channel within the connection pool and close after use; APIs are mounted at /server-box/api/hosts/<id>/files*, loopback only like REST / PTY.

Conversational tools (same SSH connection pool, not via card xterm):

  • server_box_upload: Local → Remote
  • server_box_download: Remote → Local

Deep link #sd-files/<hostId> opens the file view for a specific host directly.

Host Ledger: Import and Add

  1. One-click import ~/.ssh/config: Parses Host / HostName / User / Port / IdentityFile / ProxyJump; skips Host *, existing hosts, and Git hosting platform key aliases (e.g., Host github.com-xxx, User git); prioritizes semantic aliases for display names in multi-alias lines.
  2. Manual addition: Supports passwords, private key files (with passphrases), SSH Agent; provides connection testing and latency feedback.

Ledger file: ~/.dsh/server-box.json; passwords and private key passphrases: ~/.dsh/server-box.secrets.json (0600). When upgrading from the old name dsh-server-deck, it automatically migrates server-deck.json → server-box.json, metrics directory server-deck-metrics/ → server-box-metrics/ on first startup, changes route prefix from /server-deck/* to /server-box/*, and conversational tools from server_deck_* to server_box_*.

Tab Mounting Methods

Environment Form
DSH 0.1.5+ Prefer registering official native right sidebar (ctx.sidebarRightTabs)
dsh-better-sidebar installed Can also be a sidebar “🖥 Servers” tab (order 45)
Above extensions not installed Self-drawn expandable/collapsible right panel, draggable width with persistence

Loading order is independent; client does not declare hard dependencies, waiting internally for service readiness before registering the tab.

Installation and Activation

The plugin is installed as a web profile; after installation, restart dsh web is required (Host half adds new routes and resident collectors), and browser Ctrl+F5 for hard refresh. The appearance of the “Servers” tab in the sidebar “+” menu indicates successful loading.

# Method 1: Install directly from GitHub (dsh CLI, recommended)
dsh plugin --profile web add github:hoshino114/dsh-server-box

# Method 3: npm (available after publishing to npm)
dsh plugin --profile web add dsh-server-box

The README also describes a local mount method via pnpm install && pnpm build followed by dsh plugin --profile web add .; daily installation should follow the CLI commands above.

Typical Usage

  1. Install and restart dsh web per the section above, then hard refresh the page.
  2. In the “Servers” tab, import ssh config or manually add hosts, and confirm reachability with connection tests.
  3. View online status and CPU / Memory / Disk in card view; adjust auto-refresh intervals as needed.
  4. Switch to “Trends” when historical curves are needed, select 1h / 24h / 7d / 30d or custom windows.
  5. Click a card to open xterm; use “📁 Files” or call server_box_upload / server_box_download in conversation for file transfers.
  6. Other conversational tools (same pool, non-interactive): server_box_hosts, server_box_exec, etc., see repository README and security model descriptions.

Scenarios and Notes

Suitable for: Users already developing daily in DSH Web or Desktop who need to maintain a small to medium number of Linux / macOS / BSD / Windows OpenSSH hosts in the same interface, and wish to keep metrics, terminals, and file operations within DSH.

Must Note:

  • The plugin runs under the permissions of the current dsh process; SSH ledgers and secrets are on local disk, please read the source code and MIT License before installation.
  • All /server-box/api/*, PTY, and file interfaces are loopback only (127.0.0.1/::1), reducing DNS rebinding and LAN direct connection risks; APIs never return passwords or private key passphrases.
  • Metric probes: Linux / macOS / BSD use read-only POSIX sh; Windows OpenSSH uses PowerShell CIM when sh is unavailable; parsed failure fields show “—”.
  • Version line: 0.5.x is the current mainline (including SFTP, desktop WS fixes); older DSH (≤0.1.2-rc.1) needs to select 0.2.x maintenance branches per the README compatibility table.

The DSH ecosystem emphasizes “Everything is a plugin”; the SkillHub catalog is a community site with no official affiliation with DeepSeek / High-Flyer.

Conclusion

dsh-server-box consolidates the status, trends, terminals, and SFTP of multiple SSH hosts into the right-side “Servers” tab of DSH, keeping ledgers and metrics local, and routing APIs and transfers via loopback and connection pools. For installation or Issue submission, see the GitHub Repository and SkillHub Plugin Page.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye