Introduction¶
The Web launch token for DeepSeek Harness (DSH) is randomly generated at process startup and printed only once in the startup log. Any third-party remote client (DSH Go, scripts, other devices) must save it, which means that after every restart or boot, all paired clients are immediately invalidated, and a human must manually copy a 43-character random string from journalctl. This approach lacks a “fixed, rotatable, per-device revocable” layer and cannot prevent the token from appearing in plaintext in logs.
dsh-device-auth adds this layer at the profile level without modifying any DSH installation packages, and it won’t be lost when dsh is upgraded.
Plugin Positioning¶
dsh-device-auth is a plugin for DeepSeek Harness, maintained by nypyp, categorized under admin-security. It provides stable, per-device revocable login tokens for the DeepSeek Harness Web UI: after dsh web restarts, paired clients no longer need to copy a new 43-character random launch token.
Core Features¶
- Stable: One long-lived token per device. No reconfiguration is needed after
dsh webrestarts, machine reboots, ornpm i -g @deepseek-ai/dsh@new-version. - Rotatable: Re-issuing for the same device performs an in-place rotation; the old token returns 401 on the very next request.
- Per-device, instant revocation:
dsh-auth list / revoke— one credential per device; after revocation, cookies already obtained by that device are rejected on the next request (not merely unable to be exchanged for new ones). - No log leakage: The bundle layer disables startup URL printing; tokens are displayed only once, explicitly during
dsh-auth add|rotate. - Zero regression: Requests are handed back to the original implementation only when a device token matches. The original
/?token=, 302/303 redirects, 30-day signed cookie, Host/Origin fence,--trusted-host, and--public-urlall retain their original behavior. - Self-contained: No runtime dependencies, no build step; the server stores only SHA-256 hashes.
Installation & Activation¶
Plugin Management (Web / Desktop)¶
Search for dsh-device-auth in Plugins → Add Plugin and install it, then restart dsh web.
Command Line¶
# Install from npm (available since 0.2.0)
dsh plugin --profile web add -w dsh-device-auth
# Update
dsh plugin --profile web update dsh-device-auth@latest
# Install from a local directory (development/debugging)
dsh plugin --profile web add -w file:/absolute/path/to/dsh-device-auth
After installation or update, dsh web will reload with the new module; if the UI prompts for a restart, simply restart once.
Once installed, the bundle layer where the plugin resides also sets web-runtime.printUrl to false: the startup log will no longer contain a URL with a real token.
Typical Usage¶
dsh-auth add phone --kind dsh-go # Issue a token for a phone (token shown only once)
dsh-auth add laptop --kind browser # Issue a token for a browser
dsh-auth list # Device list: label / id / status / time
dsh-auth rotate phone # Rotate: old token becomes invalid immediately
dsh-auth revoke phone # Revoke a single device
dsh-auth revoke --all # Revoke all
dsh-auth purge # Clean up revoked records
add / rotate print three formats — pick one based on the client type:
token (shown once): dsh_dev_…
app connect link: http://127.0.0.1:3080/connect?token=dsh_dev_…
browser login link: http://127.0.0.1:3080/?token=dsh_dev_…
- DSH Go / SSH tunnel clients: Fill
dsh_dev_…into the host configuration’s “DSH Login Token” field. Local tunnel port changes don’t matter; the client uses the same token on every reconnection to exchange for a new cookie. - Browser: Open the
browser login linkdirectly (replace the origin with your public address, e.g.,https://dsh.example.com/?token=dsh_dev_…), after which the normal 30-day cookie flow applies.
The CLI reads and writes $DSH_HOME/remote-auth.json by default (or ~/.dsh/remote-auth.json if not set); use --store to specify an alternative path. --origin only affects the printed links.
Configuration¶
In the profile’s cordis.patch.yml (or your bundle patch):
- id: device-auth
config:
storePath: !!js dshHomePath('remote-auth.json') # Required: device table path
prefix: dsh_dev_ # Optional: token prefix
Compatibility¶
| Item | Value |
|---|---|
| DSH | >=0.2.2-rc.1 <0.3.0-0 (verified against 0.2.2-rc.1) |
| Node | >=24.9.0 (follows the DSH Web runtime) |
| Platform | Web / Desktop profile (Host plugin, no client UI) |
The plugin explicitly probes for the required service methods upon activation. If future DSH versions change these two methods, the plugin will fail to start with an error rather than silently passing through. Please check CHANGELOG.md and this repository’s CI before upgrading.
Known Limitations¶
- Scope of instant revocation: The plugin indexes the “cookies issued during device exchange” by hash; after revocation, the next request from those cookies returns 401 (covering both
/apiand browser pages). However, two types of cookies cannot be attributed to a device: ① owner sessions logged in with the real launch token; ② legacy cookies issued before the plugin was installed/upgraded. These are not affected by device revocation until they expire. If the session index file is lost, these cookies fall back to the “delegate to original auth” behavior (legitimate sessions won’t be wrongly rejected, but the corresponding device won’t be kicked either). - All devices have owner-level permissions — DSH has no per-device permission model; this plugin’s “per-device” granularity only extends to the credential level.
- Device tokens are stored in plaintext on the client side (phone secure storage / DSH Go config); the server stores only hashes.
- One-time pairing codes are not implemented (DSH Go only exchanges via
token=; there is no pairing code consumer).
Use Cases & Cautions¶
Suitable for scenarios that require providing long-lived login tokens to multiple devices or clients, with per-device revocation, and no need to copy a random launch token from logs after every restart.
The plugin runs with the current dsh process privileges. Review the source code and license before installation.
In Summary¶
dsh-device-auth provides stable, rotatable, per-device revocable login tokens at the profile level, eliminating the need to copy a random token from logs after every restart. It is well-suited for DSH Web use cases that require persistent connections and per-device control.