Repository navigation
Releases
dsh-expose 0.1.0 — one switch to publish a DSH instance
Publish a running DSH instance to the LAN or the public internet, behind one switch.
Install it from the Plugins page — Add plugin accepts this repository URL directly:
https://github.com/WONGIII/dsh-expose
or github:WONGIII/dsh-expose (pin this release with github:WONGIII/dsh-expose#v0.1.0).
What it does
- Binds a forwarding listener on the address and port you choose (default
0.0.0.0:3080) in front of this instance's own loopback web carrier, with one switch to open and close it. - Lists the remote URLs to hand out: the LAN address, a directly reachable public address, or the public egress address with a port-forwarding reminder when the machine is behind NAT.
- Copies and opens tokenized login links, so a phone or a second computer lands straight in the same session.
- Runs a four-leg self-test from this machine (listener → real NIC → anonymous refusal → token login) and can add the Windows firewall rule for the chosen port.
- Remembers the switch and the port in
$DSH_HOME/dsh-expose.json, and re-opens on boot if it was on.
Why it is safe to run
The web carrier deliberately refuses --host 0.0.0.0, because that would expose remote code execution. This plugin does not weaken that decision: it wraps the carrier with a listener you control and rewrites Host/Origin/Referer to the upstream loopback authority, so the /api Host/Origin fence, the authority-bound browser cookie, and the token login all keep working unchanged. The control API lives on the instance's own authenticated /api channel, so a remote stranger cannot toggle exposure. You open the port; DSH still does the login.
Conventions followed
Bundle manifest (dsh.bundle.patch + cordis.patch.yml), browser half (dsh.client + ./client module-loader registration), the documented configuration page (plugins.bundle.config, keyed by the package name, rendered on the bundle's own page) plus a Settings tab, display metadata (locale/en.json + locale/zh.json with meta.title/meta.description, top-level icon), and no dependencies or install scripts — lib/ is committed, so a git install needs no build-script approval.
Verified
scripts/verify-package.mjs: 46 checks over the bundle, client, locale, icon, exports, publication list, and install-time scripts.- 31-case test suite (
npm test): header rewriting, Upgrade tunnelling, address classification, persistence, browser half, host-half integration. - Live end-to-end run in a profile created from the shipped web template, installed from this repository through the Add plugin dialog: 16/16 checks, including token login over the published LAN address and an anonymous 401.
Every address in the screenshots and documentation is a placeholder (192.168.1.20, 203.0.113.10, 198.51.100.7, token=TOKEN).