dsh-service-portal: Exposing Local Services Externally on Demand Using Random Domain Names and Passwords

Introduction

When running local web services, configuration consoles, or debug panels within DSH (DeepSeek Harness), the common practice is to manually configure reverse proxies, find tunneling tools, and implement a separate layer of access control. This involves multiple steps and often leads to inconsistencies between internal and external network policies. dsh-service-portal, a DSH plugin (Category: Networking Tools) released by maintainer dingminhua, consolidates “Portal Process + cloudflared Tunnel + Passphrase Login + Node Routing” into the plugin settings page. By default, it only enables internal network access and displays a QR code upon installation; public exposure requires explicit activation. Originating from the portal capabilities in ld-rl-poker, the plugin is business-agnostic and allows any local HTTP service to be mounted via path.

What is this

dsh-service-portal (External Service Portal) is a plugin for DeepSeek Harness. The npm package name is dsh-service-portal, the current version is 1.0.4, and it is MIT licensed. In short: it uses cloudflared to provide a random *.trycloudflare.com domain when needed, and guards the public entry point with a passphrase (no account system). On the internal network side, access is passwordless via QR code by default. Node management (add/delete) and access control (open/block) are handled within the DSH plugin configuration, requiring no configuration file edits or portal restarts.

Directory and Source Code:

  • SkillHub Directory Page: https://www.skillhub.cn/plugins/dingminhua/dsh-service-portal
  • GitHub: https://github.com/dingminhua/dsh-service-portal

Core Features

Ready-to-use out of the box & Start/Stop State Memory

The portal starts automatically after the plugin loads, but only on the internal network; it will not automatically expose local services to the public internet. The settings page displays the internal network address and QR code. External access must be enabled manually by clicking “Enable Public Access,” and each enablement requires checking a disclaimer (which is also verified by the server).

autoStart defaults to true, following your “Start / Stop Portal” action on the settings page: if stopped, it will not automatically start the next time DSH opens; clicking start again will resume it. Whether automatic or not, public access is always manually enabled.

Settings Page: Two Entries for Internal and Public Networks

The interface aligns with dsh-pocket: two blocks for LAN and Public Network, each with toggles, QR codes, addresses, access password fields, and advanced options (manual address selection). Toggling either switch takes effect immediately without restarting the portal (restarting would change the tunnel domain).

  • LAN (Example format: http://192.168.x.x:8899): Passwordless by default under the same WiFi; “LAN Access Password” can be enabled, or LAN access can be disabled entirely (if disabled, internal requests receive a direct 403 explanation page, not the public login page).
  • Public (https://<random>.trycloudflare.com): Requires a passphrase.
  • Local Access (loopback): Always passwordless, preventing the issue where the local machine cannot access its own portal.

Node Management

In DSH: Plugin Page → This Plugin → Configuration, you can add nodes (Name, External Path, Local Port, Notes). You can Open / Block (this acts only as a routing gate; it does not stop the upstream process), edit, or delete nodes. Each node provides two entries: “LAN Access” and “Public Access.” The availability of these buttons depends on the corresponding switches (e.g., if public access is off, the public button greys out with a prompt to enable it first).

Portal Web Page (Read-only)

The page opened via QR code is a test and guide page: it lists published nodes. “Access” opens the service, and “Test” performs an in-place probe and displays the result (e.g., HTTP 200, 502, distinguishing between “Upstream not running” and “Upstream online but returning 502 itself”). The page has no settings functions; please return to the DSH plugin configuration to change settings.

Security and Authentication Model

Classified by Host (fail-closed: any unrecognized Host is treated as Public):

Host Category Determination Portal Page / Service
loopback localhost, 127.x, ::1 Passwordless
lan RFC1918 private network, CGNAT, .local, etc. Passwordless by default (LAN password can be enabled)
public Everything else Passphrase required

The public network uses a custom passphrase login page (not the browser’s native basic authentication box). The passphrase can be randomized each time (passwordMode: random) or fixed (fixed, minimum 12 characters). Login rate limiting: 5 consecutive failures from a single IP locks it for 60 seconds, with additional global thresholds. Health checks perform TCP probes on the upstream port, rather than just reading status flags.

How it Works (Routing Overview)

The portal process listens on 8899 by default, distinguishing between loopback / lan / public by Host. Typical routing:

  • / → Portal read-only page
  • /_auth/login → External passphrase login
  • /_api/* → Portal API (for DSH settings calls)
  • /<route path>/… → Forwarded to the corresponding local service

Installation and Activation

Compatible Versions

package.json declares:

  • engines.node: >=24
  • engines.dsh: >=0.2.1-rc.1 <0.3.0-0

DSH restart is required after installation (the plugin loads in the host process).

Method 1: npm (README example is for Windows Desktop)

$dsh = "$env:LOCALAPPDATA\Programs\DeepSeek Harness\resources\runtime\cli\bin\dsh.cmd"
& $dsh plugin --profile desktop add dsh-service-portal

If the old profile still has the deleted sub-plugin dsh-poker-viewer, the README suggests removing it before installing the root plugin:

& $dsh plugin --profile desktop remove dsh-poker-viewer
$dsh = "$env:LOCALAPPDATA\Programs\DeepSeek Harness\resources\runtime\cli\bin\dsh.cmd"
& $dsh plugin --profile desktop add "link:D:/DshProject/dsh-service-portal"

The cloudflared path can be left blank for the plugin to auto-detect (e.g., ~/.dsh/dsh-pocket/bin, ~/.dsh/bin, PATH, etc.).

Configuration Key Points

The following fields can be modified in the DSH settings page, all taking effect immediately (.volatile()). Excerpt from the README table:

Field Default Description
repoPath Empty Root of the repository containing the exposed service; must be filled manually
portalPort 8899 Portal port
autoStart true Auto-start portal when DSH opens (Internal network only)
passwordMode random random / fixed
fixedPassword Empty At least 12 characters when fixed
lanAuthEnabled false Whether to require a passphrase on the internal network
cloudflaredPath Empty Executable path; if empty, auto-detects
infraPath Repo root Infrastructure path containing tools/ and runs/

Passphrase mode and fixed passphrase cannot be changed while the portal is running (the portal must be stopped first) to avoid inconsistencies between the interface and the actual passphrase.

Typical Usage

  1. Install the plugin and restart DSH, open the plugin configuration page, and fill in necessary items like repoPath.
  2. Confirm the portal has started: view the internal network address and QR code, scan the code with a phone on the same network segment to enter the read-only portal page.
  3. Add nodes in the configuration (External path, Local port), and use “Test” to confirm if the upstream responds.
  4. To access from the external network: check the disclaimer in the settings page and click “Enable Public Access,” use the displayed random domain and passphrase to log in, then access the node via the public entry.
  5. If you temporarily do not want to route a service externally, set the node to “Blocked”; the upstream process can continue running.

Scenarios and Caveats

Suitable for: Scenarios where you need to quickly expose local HTTP services to LAN devices for QR code access within the DSH workflow, or occasionally access via a Cloudflare quick tunnel with a passphrase from the public internet, while preferring GUI-based routing management instead of hand-writing nginx or repeatedly editing configs.

Notes:

  • The plugin runs with the current DSH process permissions; please read the Source Code and License before installation and assess the risks of exposing local services yourself.
  • The public tunnel relies on cloudflared and trycloudflare-style random domains; it is not suitable as a long-term production-grade fixed domain solution.
  • SkillHub etc. are community directories, with no official affiliation to DeepSeek / High-Flyer; star counts and other data are subject to the directory page (current lead is 1 star on GitHub).
  • It only handles forwarding routing and is not responsible for starting your upstream services; on 502 errors, distinguish between “not started” and “upstream self-error” according to the portal page prompts.

Conclusion

dsh-service-portal turns “LAN QR Code + Public Tunnel + Single Passphrase + Path-based Forwarding” into a switchable, state-memorizing plugin capability within DSH, with node and dual-entry management centralized in the settings page. For further information and installation instructions, see the SkillHub Directory Page and the GitHub Repository.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye