dsh-restart-button
其他 活跃维护

dsh-restart-button

hadesybil-hub/dsh-restart-button

轻量界面重启按钮插件,安装后会在原有界面右下角上方新增重启按钮,无需额外配置,点击即可触发对应重启流程,无冗余功能,对原有界面逻辑无干扰。

0
Stars 标星
0
Forks 分支
0
Watchers 关注
0
Open Issues
JavaScript
主要语言
MIT
开源协议
23 KB
仓库大小
27 天前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:hadesybil-hub/dsh-restart-button
git clone https://github.com/hadesybil-hub/dsh-restart-button.git
git clone git@github.com:hadesybil-hub/dsh-restart-button.git
README.md master

dsh-restart-button

A small DeepSeek Harness (DSH) plugin that adds a restart button just above the existing bottom-right shutdown button in the Web GUI.

Click it once → a confirm dialog asks if you're sure → restart the dsh web process: the server comes back up and the browser reopens — no need to close and double-click the desktop icon.

What it does

Floating restart button Pinned above the shutdown power button
Confirm gate One click → "确定重启?" dialog → restart only if confirmed
Server route POST /api/dsh-restart/restart (loopback-only)
Restart flow Spawns a detached node waiter → waits for the port to free → starts a fresh dsh web (which auto-opens the browser)

Install

dsh plugin --profile web add "dsh-restart-button"

Then restart dsh web. The restart button appears in the bottom-right, above the shutdown button.

How it works

  • Server half (lib/index.js): a cordis plugin that registers the loopback-only POST /api/dsh-restart/restart route. On request it writes a self-contained node waiter (~/.dsh/desktop-launcher/dsh-restart-waiter.mjs) and spawns it fully detached, then asks the host to exit gracefully (with a hard process.exit fallback so the port always frees).
  • Waiter: waits for port 3080 to be free, then spawn(node …/dsh/lib/bin.js web) detached. dsh web auto-opens the browser, so no manual browser-open step is needed. It also logs to ~/dsh-restart-waiter.log.
  • Client half (lib/client.js): plain-DOM, no React, no build step. Loaded through window.__ModuleLoader__, it appends the floating restart button with the confirm gate.

Security

  • The route is loopback-only (peer socket + Host header + same-origin fence), matching the DSH plugin family convention.
  • The restart uses node's child_process with detached/unref so the new server survives the old process's exit.

License

MIT

Repository

https://github.com/hadesybil-hub/dsh-restart-button