只读的 Linux 端口、服务与 Caddy 路由地图:监听套接字及其所属 unit 或容器、反向服务视图,以及 reverse_proxy 存活检查。需要 iproute2(ss),docker 与 Caddyfile 可选。
安装
# npm 包(预构建)
dsh plugin --profile web add dsh-port-map
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:ozanstn1-stack/dsh-port-map
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
该插件的 README 只有英文版本。
Port, service and Caddy route map for DeepSeek Harness.
dsh-port-map answers the questions a busy server keeps asking: what is on
9094? which unit owns this port? is every Caddy route still pointing at
something alive? what is exposed to the internet?
Every tool is read-only. Nothing is opened, closed or reconfigured.
Tools
| Tool | Kind | What it does |
|---|---|---|
listening_ports |
read-only | TCP listening sockets: port, bound address, reachability scope (public / localhost / interface), process, and the systemd unit or docker container that owns it. Filters: scope, port. |
service_map |
read-only | The reverse view: every unit/container with the ports it listens on, plus the ports nothing claims. |
caddy_routes |
read-only | Parses the Caddyfile into site → path → reverse_proxy upstream, then checks each upstream against the listening sockets. |
url_check |
read-only | HTTP status, latency and content type for an allow-listed host. A redirect is reported, not followed. |
Example output
Listening TCP sockets (39):
port address scope owner
8790 127.0.0.1 localhost dsh-web.service
1933 127.0.0.1 localhost docker:openviking
9090 0.0.0.0 public map-service.service
Bound to all interfaces: 22, 443, 8642, 8799, 9090, 9091, 9094, 11434
Caddy routes (11) from /etc/caddy/Caddyfile:
example.org /panel → 127.0.0.1:8788 · up (vps-panel.service)
example.org /gone → 127.0.0.1:9999 · DOWN
Install
dsh plugin --profile web add dsh-port-map
systemctl restart dsh-web # or restart your DSH process
- id: port-map
config:
caddyfile: /etc/caddy/Caddyfile
urlCheck:
hosts:
- 127.0.0.1
- localhost
- example.org
timeoutMs: 10000
docker: true
safety:
timeoutMs: 15000
maxOutputBytes: 65536
Configuration
| Key | Default | Meaning |
|---|---|---|
caddyfile |
/etc/caddy/Caddyfile |
File parsed by caddy_routes. |
urlCheck.hosts |
["127.0.0.1", "localhost"] |
Hosts url_check may request; everything else is refused. |
urlCheck.timeoutMs |
10000 |
Per-request timeout. |
docker |
true |
Resolve container names for published ports. |
safety.timeoutMs |
15000 |
Default command timeout. |
safety.maxOutputBytes |
65536 |
Output cap per call. |
How the owner is resolved
ss -tlnpHgives the socket, its bound address and the owning PID.- The PID's cgroup gives the systemd unit (
/proc/<pid>/cgroup). - A
docker-proxysocket is matched to its container through the published port (docker ps --format '{{.Names}}\t{{.Ports}}'), so the map showsdocker:openvikingrather thandocker.service.
Nothing is guessed: an unclaimed socket is reported as unowned:<process>.
Honest limits
- Read-only: it reports, it does not fix. No firewall changes, no restarts.
- The Caddyfile parser understands site blocks,
handle/handle_pathandreverse_proxy(with or without an options block).!!jsexpressions, imported snippets orphp_fastcgi-style directives are not modelled and are simply not reported. - Docker name resolution needs
docker psto work for the current user; without it the socket is still listed with itsdocker:<id>marker. url_checknever follows a redirect, so a redirect chain is reported as one hop, not resolved to the final page.
Requirements
- DSH
>= 0.2.1-rc.4(Node^22.19.0 || >=24.0.0). ss(iproute2) for the socket tools;dockeroptional; the Caddyfile optional.
Development
npm run link-peers
node --test
License
MIT
链接
同类插件
DayuanJiang/next-ai-draw-io#dsh-plugin★ 36548
dsh 的 draw.io 绘图插件:通过 next-ai-drawio MCP 服务器作图,点回复里的链接在右侧栏打开实时预览,可以手动修改图,AI 的每次修改都是可以恢复的版本。需 Node.js 18+,首次使用由 npx 下载 MCP 服务器。
Tencent/WeKnora#dsh-weknora★ 36201
把 WeKnora 知识库接入 dsh 的四个只读工具:列出知识库、混合检索原文片段、按顺序还原单篇文档,以及直接取用 WeKnora 自己带引用的 RAG 或 ReAct agent 回答(含可续聊的 session id)。
superdesigndev/treg★ 6962
给 Agent 的工具目录:按「要做的事」检索约 2,600 个外部接口(SEO 与 SERP、外链、社交、人物与公司信息补全、广告库、抓取),查看参数与单次调用价格后直接调用,凭据由服务端注入。附带技能,MCP 行在未设置 TREG_TOKEN 前保持禁用。
T-Auto/dsh-ops★ 5011
为 Windows 的 DSH 提供 bash、PowerShell 7 及 Rust 高性能工具,减少 token 消耗。
sixtysevenlf/dsh-blender-plugin★ 1536
让 DSH agent 通过直连 TCP 通道驱动本地 Blender,提供 15 个工具:视口帧、自定义视角渲染、Python 执行、无头与作业卸载、事务回滚,以及 34 个 family / 228 个 op 的规划层。
TencentCloudBase/CloudBase-AI-Toolkit#dsh-plugin★ 1153
把腾讯云 CloudBase 后端接入 DeepSeek Harness——在对话里搭好并部署全栈应用,查询结果渲染为表格卡片(分页、排序、导出 CSV),部署后可预览真实域名,并提供 CloudBase MCP 工具集(`mcp__cloudbase__*`),登录走 device-code 流程。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。