Preface¶
When running dsh web with DeepSeek Harness (DSH), the browser console typically requires a ?token=… query parameter in the URL upon first opening. This token is output during process startup. If you have a reverse proxy like nginx in front and want users to access the root path / directly, you have to find a way to inject the token at the proxy layer or via bookmarks, which is inconvenient for both operations and link sharing.
@beyondandsharp/dsh-plugin-notoken is a local plugin for the DSH web profile. It registers a fixed login entry route and swaps the startup token from the process for a browser session cookie on the server side. This allows “first-time access” without including a token in the URL. Maintained by BeyondandSharp and categorized as admin-security in the plugin directory, the following sections describe verifiable facts regarding installation, implementation highlights, nginx coordination, and security boundaries. Please read the repository source code and the MIT license yourself before installation.
What is this¶
The plugin registers a login entry (default GET /__dsh_login) within the DSH web process. Once a request passes the trust fence validation, it uses the current process token to complete the token-to-cookie exchange. Subsequent access relies on DSH’s existing browser session mechanism rather than long-term URL parameters.
It does not modify DSH source code, sign cookies, access secrets, or parse startup output; it hooks into the web profile via a bundle patch using cordis.patch.yml.
Core Features¶
- Stable Login Entry: Default path is
GET /__dsh_login. This route can be fixed in a reverse proxy or bookmark, or pointed to an equivalent entry rewritten internally by nginx. - Token-for-Session Exchange: For requests passing the trust fence, it calls the in-process
authorizeIndex()logic to complete the exchange via methods like 303 +Set-Cookie; access with an existing session will 303 redirect to./. - Adaptation for Browser Navigation and SameSite: For document navigations without a session that are labeled as cross-site (requires
allowCrossSiteNavigationon the DSH side) ornone, the plugin returns the app shell directly and sets the cookie in the same response. This avoids “too many redirects” errors caused by Strict cookies in the 303 chain; same-origin / same-site requests still follow the 303 path. - Integration with nginx Reverse Proxy: The repository provides
examples/nginx.conf. The typical approach is to internally rewrite the 401 from the bare/to the entry route, allowing the address bar to stay at/throughout the session;/apiand WebSocket requests must be passed through transparently.
Installation and Activation¶
In an environment where DSH is installed and the web profile is used, the installation method provided by the official README is as follows (where $DSH is the DSH executable path or alias):
$DSH plugin --profile web add @beyondandsharp/dsh-plugin-notoken # From npm
# You can also install directly from GitHub or a local directory:
$DSH plugin --profile web add github:BeyondandSharp/dsh-plugin-notoken
$DSH plugin --profile web add /path/to/dsh-plugin-notoken # DSH=/path/to/dsh
The npm package name is @beyondandsharp/dsh-plugin-notoken, and the current version in package.json is 1.0.6. The plugin runs with the permissions of the current dsh web process; you should review the contents of notoken.js and the patch to ensure they meet your security policy before installation.
Typical Usage¶
Direct Connection or Local Debugging¶
After enabling the plugin, the browser can first visit the default entry GET /__dsh_login (or the equivalent path after configuration). The plugin completes the cookie exchange and then enters the console shell. If dsh web is bound only to a specific interface, the shell return will use the actual host:port the process is listening on. The README reminds you: if dsh web --host <address> only listens on that interface, using the 127.0.0.1 loopback might result in ECONNREFUSED.
With nginx Reverse Proxy¶
- Refer to the repository’s examples/nginx.conf.
- Pass
Hostthrough transparently (cookies are bound to Host), and this authority must be in DSH’strustedHosts. - Only intercept
location = /; do not rewrite/apiand WebSocket traffic into the login entry.
When rewriting internally via nginx, the user’s address bar can remain at /, whereas for direct entry access with none navigation, the address bar will stay at the entry path; both deployment methods are described in the README.
Implementation Highlights (Relation to DSH Auth Gaps)¶
DSH performs browser authentication before frontend-static renders the index and on /api routes; the named route registered by the plugin matches before both of these, and by default does not go through the aforementioned authentication. This plugin’s entry leverages this matching order: first, requestRejection() passes the trust fence (403 rejection; 401 allowed if no session), then it obtains the process token and completes the index authorization exchange.
mode: redirect performs a 302 to a URL with a token before the exchange; the README marks this as a compatibility fallback that does not cover the main screen startup scenario. Old clients that completely lack Sec-Fetch-* headers will still follow the 303 path.
Scenarios and Caveats¶
Suitable for: Intranet or strictly restricted network reachability, where Host is included in the DSH trust fence; deployments that wish to provide “clean URLs” via nginx without writing the startup token into bookmarks or shared links.
Not suitable or requires extreme caution: Any visitor who has access to the listening port and whose Host passes the trust fence.
The README uses a prominent warning to state: Once installed, anyone who can access the port and whose Host passes the DSH trust fence effectively gains operator privileges—they can execute tools, read credentials, and operate the machine as the OS user running dsh web. This is not a convenience plugin to “save typing a token,” but rather actively removes the browser-side authentication step; it should not be used if exposed to the public internet or without network isolation.
The community plugin directory (such as skillhub.cn) has no official affiliation with DeepSeek / High-Flyer; selecting plugins is an autonomous decision within the “everything is a plugin” ecosystem. You must base your decision on the source code and license.
Verification and References¶
You can use the following commands within the repository for self-checks (from the README):
node --test && bash verify/e2e.sh
- Plugin Directory Page: https://www.skillhub.cn/plugins/BeyondandSharp/dsh-plugin-notoken
- Source Code and Full Description: https://github.com/BeyondandSharp/dsh-plugin-notoken
If your scenario is “reverse proxy + first visit without ?token=” and you have accepted the aforementioned risk of equivalent operator exposure, you can install it according to the README and tighten trustedHosts and network ACLs based on the nginx example; otherwise, you should continue using DSH’s default URL token or standard authentication flow.