Skip to content
dsh.fish
Bundle

@woyeshishen/dsh-restart-backend

为 DeepSeek Harness Web 页面左下角添加“重启后端”按钮,一键重启 dsh 后端进程。

Source
woyeshishen
License
Apache-2.0
Updated
Updated 2 days ago

Readme

# dsh-restart-backend

[![npm version](https://img.shields.io/npm/v/@woyeshishen/dsh-restart-backend)](https://www.npmjs.com/package/@woyeshishen/dsh-restart-backend)
[![license](https://img.shields.io/npm/l/@woyeshishen/dsh-restart-backend)](LICENSE)

[中文](README.zh.md) | English

Adds a **Restart Backend** button to the bottom-left of the [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH) Web sidebar. Click it to restart the `dsh web` backend process in one step.

When the button is clicked, the Host side spawns a detached watchdog that waits for the current `dsh web` process to exit and release its port, then starts a fresh `dsh web` process with the same startup arguments. The old process exits gracefully through `ctx.appExit`.

## Features

| | |
| --- | --- |
| 🔄 **One-click restart** | Restart the backend from the Web UI without opening a terminal |
| 🧱 **Watchdog restart** | Detached process survives the old backend exiting, then relaunches with the same args |
| 🔒 **Loopback-safe by default** | Only `127.0.0.1` / `localhost` can trigger a restart unless remote restart is enabled |
| 📦 **Install once, keep working** | Auto-loads at DSH startup, survives restarts |

## Install

### One-liner (recommended)

**Windows (PowerShell)**

```powershell
irm https://raw.githubusercontent.com/woyeshishen/dsh-restart-backend/main/scripts/install.ps1 | iex
```

**macOS / Linux**

```sh
bash <(curl -fsSL https://raw.githubusercontent.com/woyeshishen/dsh-restart-backend/main/scripts/install.sh)
```

### dsh plugin command

**From npm**

```sh
dsh plugin --profile web add @woyeshishen/dsh-restart-backend
```

**From GitHub**

```sh
dsh plugin --profile web add github:woyeshishen/dsh-restart-backend
```

After install, the plugin auto-mounts into the profile; restart DSH (or hard-refresh the page) to activate.

## Usage

Once installed, open the DSH Web page. A circular **↻ Restart Backend** button appears at the bottom-left of the sidebar.

Click it when you need to restart the backend. The page may disconnect briefly; after the backend comes back up, refresh the page if needed.

## Configuration

The plugin exposes one optional setting:

| Config | Type | Default | Description |
| --- | --- | --- | --- |
| `allowRemoteRestart` | boolean | `false` | Allow non-loopback/trusted-host sources to trigger a restart. |

To enable remote restart, add a `config` block in your `cordis.patch.yml`:

```yaml
- insert:
    - id: restart-backend
      name: '@woyeshishen/dsh-restart-backend'
      config:
        allowRemoteRestart: true
```

## Requirements

- [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)

## License

[Apache-2.0](LICENSE)

Install

dsh plugin --profile web add github:woyeshishen/dsh-restart-backend

Profile: web

  • This package builds from source on install. pnpm will ask you to allow its build script — that is permission to run the package’s code on your machine, outside the agent sandbox. Only allow sources you trust.
  • This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.
Source