Introduction¶
DeepSeek Harness (DSH) adopts an “everything is a plugin” architecture. After installing or updating plugins, developers usually need to restart the dsh web service for the new plugins to take effect. Manually executing the restart operation in the command line can interrupt the current workflow. The dsh-restart plugin aims to address this pain point by encapsulating the restart operation as an entry point in the settings page, enabling UI-based restarts without using the command line.
Plugin Overview¶
This is a standalone plugin maintained by zhouchengke2046 and belongs to the admin-security category. It does not include any balance or usage management features; it only provides a “Restart dsh” entry point in the settings page. The plugin follows the MIT license and supports standalone installation and uninstallation.
Core Features¶
- Zero Dependencies and Security: The plugin itself has zero dependencies and zero coupling, and can be uninstalled independently after installation. It does not read any keys or sensitive information and operates only as a system management tool.
- Native UI Adaptation: The plugin natively adapts to DSH design tokens (
--dsw-alias-*) and displays correctly under both light and dark themes. - Reliable Restart Mechanism:
- First attempts to use
launchctl kickstartto trigger a service restart. - If triggering fails, a fallback solution is provided (see the configuration for the specific logic).
- Uses launchd’s
KeepAlivemechanism to ensure the service is brought back up.
- First attempts to use
- Automatic Recovery: After the user confirms the restart, the plugin polls the service status and automatically refreshes the page once the service recovers.
- Observability: The execution trace of the restart operation is recorded in
/tmp/dsh-restart.logto facilitate troubleshooting.
Installation and Configuration¶
Installation¶
Run the following command in the terminal to add the plugin to the Web configuration file:
dsh plugin --profile web add github:zhouchengke2046/dsh-restart
To install from a local path, you can use:
dsh plugin --profile web add /path/to/dsh-restart
After installation, the dsh web process needs to be restarted.
Configuration Options¶
The plugin supports overriding default behavior through cordis.patch.yml. The main configuration options are as follows:
| Key | Default | Description |
|---|---|---|
restartEnabled |
true |
Whether to register the restart route. Set to false to disable this feature. |
restartCommand |
"" |
Overrides the restart command. If left empty, the system defaults to using launchctl kickstart -k gui/<uid>/<label>. |
restartLabel |
com.dsh.web |
The label of the launchd agent, used to specify the target service for restart. |
restartDelayMs |
600 |
The delay in milliseconds after the user clicks Confirm before execution. |
Configuration Example (Overriding Default Behavior):
- insert:
- id: dsh-restart
name: dsh-restart
config:
restartEnabled: true
restartLabel: com.dsh.web
Usage¶
- Ensure the plugin is installed and
dsh webhas been restarted. - Open the Settings page in the Web interface.
- Find and click the Restart dsh button.
- Click Confirm in the confirmation dialog.
- The plugin will perform the restart operation and automatically refresh the page after the service recovers.
Notes¶
- Runtime Environment: The plugin depends on a Node.js environment and requires
>= 18. - Permissions: The plugin runs with the current permissions of the
dsh webprocess, so make sure the current user has permission to executelaunchctl-related commands. - Code Review: Given that the plugin involves restarting system services, it is recommended to inspect its GitHub source code and license before installation to ensure compliance with local security policies.
Conclusion¶
dsh-restart integrates the restart logic into the settings page, simplifying the service maintenance workflow after DSH plugin development. For developers who frequently debug or update plugins, this plugin can effectively reduce command-line operations and improve the development experience.