dsh-web-relay: Expose local DSH web to remote devices without port forwarding

Introduction

DeepSeek Harness (dsh) dsh web only listens on 127.0.0.1, which is part of its security model: authentication is single-operator oriented, involving a startup token exchanged for a long-term cookie, without multi-user support or session revocation. When away from the home network, if you simply want to continue using the Web interface on your home machine via a mobile phone or another laptop, the common practices are VPN or router port forwarding—the former requires maintaining an additional set of access controls, while the latter directly exposes an interface capable of executing commands to the public network, conflicting with DSH’s design premise.

Below is an introduction to the community plugin dsh-web-relay (maintainer LFF28): the internal host actively connects to a self-hosted relay. Through an SSH reverse tunnel and a Caddy gateway, it allows remote devices to access the local dsh web via HTTPS without opening inbound ports.

What is this

dsh-web-relay is a networking plugin for DSH (npm package name dsh-web-relay, version 0.1.0 in current materials, MIT license). It solves the problem of securely “accessing” the Web console from the public network side without changing the fact that dsh web remains bound only to the loopback interface.

The relay side relies solely on the system’s built-in sshd and Caddy; no code from this repository is installed. The connection direction is always initiated by the internal host, and the browser only communicates with the relay.

Core Features

The capabilities verifiable in the materials are as follows.

Topology and Invariants

flowchart LR
  D["Device<br/>Phone / Computer"] -->|"HTTPS + Gateway Passphrase"| R["Relay Server<br/>Caddy + sshd"]
  R -->|"SSH Reverse Tunnel<br/>Initiated by internal host"| H["Internal Host<br/>dsh web"]
  • The internal host does not open any inbound ports; the tunnel endpoint on the relay is bound only to the loopback, meaning only the Caddy on the same machine can connect to it.
  • After filling in parameters on the settings page and clicking “Deploy”, the wizard idempotently completes the setup of restricted accounts, sshd hardening, Caddy, certificates, and tunnels on the relay; if it fails, it can be re-run as-is.
  • Four layers of mutually independent verification: TLS, Gateway Passphrase, DSH Session Cookie, and Host/Origin fencing. No DSH credentials are stored on the relay, and typically only one HTTPS gateway port is opened externally.

What you get (Summarized from README)

  • NAT traversal without binding dsh web directly to a public interface.
  • Upon successful deployment, the terminal prints the access URL, along with information such as the root certificate fingerprint, relay host key fingerprint, and Caddy version (see typical usage below for examples).
  • The documentation included in the package covers working principles, deployment, configuration items, local/relay changes, security design, and troubleshooting (repository docs/ directory).

Installation and Activation

Prerequisites (from README):

  • A relay with a public address (e.g., VPS), with security groups allowing the gateway port to be used.
  • The management account on the relay supports public key login and passwordless sudo.
  • DSH is installed on the local machine, and dsh web runs normally.

Install from npm (official command, requires the web profile):

dsh plugin --profile web add dsh-web-relay

Restart dsh web after installation for the plugin to load the settings page and related logic.

Typical Usage

1. Complete initial configuration on the local machine

You must open the settings on the local machine running dsh web: DSH downgrades settings persistence to memory for non-loopback access, meaning remote pages cannot write configurations.

Access the following in a local browser:

http://127.0.0.1:<dshPort>

Enter Settings ▸ Remote Access, fill in the relay address, management account, gateway port, and Gateway Passphrase, etc., and click “Deploy”.

2. Bookmark the remote access address

After successful deployment, output similar to the following will appear in the terminal:

dsh-web-relay: https://203.0.113.7:8443/
  Root Certificate Fingerprint SHA256:...
  Relay Host Key SHA256:...
  Caddy v2.11.4

Save the HTTPS address from the first line to your mobile phone or the computer used when away. Access requires entering the Gateway Passphrase set during deployment, followed by completing session authentication as per standard DSH procedures.

When the relay uses a private CA, the browser will indicate that the certificate is untrusted. The README explains: without installing the CA, there is only encryption, but no identity verification. In the status area of the settings page, click “Download Root Certificate”, verify the fingerprint, and install it on your device to reduce warnings and restore verification of the relay’s identity.

Configuration Description

The fields on the settings page include deployment parameters such as relay address, management account, gateway port, and gateway passphrase; there are also behavior items adjustable via package default values (such as reconnection backoff, timeout, and entry switch). See the repository configuration.md for field meanings.

Use Cases and Notes

Who it is for

  • Those who already have or can provide a VPS as a relay and want to operate the DSH on their home/office machine via a browser while away, without wanting to open inbound ports on the internal host.
  • Those who can accept the operational costs of self-hosting a relay and are willing to configure gateway passphrases and TLS according to the documentation.

Must Know

  • The plugin runs under the permissions of the current dsh process; before installation, you should read the source code and the MIT License, and understand the threat model and known limitations in the Security Design.
  • Gateway Passphrase is mandatory, not an optional hardening measure; DSH’s own authentication strength is insufficient to face the public network directly.
  • It is recommended to run only sshd and Caddy on the relay, and expose only the necessary HTTP(S) port for the gateway—opening multiple ports may increase the surface for session cookies to be read.
  • If the relay is compromised, plaintext on the tunnel may be read; this is an inherent cost of this architecture.
  • The community directory SkillHub Plugin Page and the GitHub repository are maintained by the community and have no official affiliation with DeepSeek / High-Flyer; the DSH ecosystem itself is “everything is a plugin”, and this article only introduces the behavior of this plugin as stated in the materials.

Conclusion

dsh-web-relay uses the method of “internal active outbound connection + relay TLS and gateway passphrase + local listening only on 127.0.0.1” to separate remote access from DSH’s single-operator security boundary. If your scenario meets the prerequisites above, you can enable it via the npm installation command and complete a one-time deployment on the local settings page.

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

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

Xiaoye