Introduction¶
DeepSeek Harness (DSH) allows running an agent workbench locally. We typically access its Web GUI via a browser on the local network. However, accessing it from an external network (internet) is inconvenient without a public IP or open port mappings.
The dsh-remote-frp plugin introduced below solves this problem using an frp reverse tunnel scheme: it utilizes your own cloud server as a relay. Your local Mac only needs to listen on 127.0.0.1, requiring no public IP and no open inbound ports.
Plugin Overview¶
Plugin Name: dsh-remote-frp
Maintainer: baigei0710
License: MIT
It handles configuration management on the local Mac side. Core features include:
* Generating frpc configuration and token files (located in $DSH_HOME/remote-frp/, permissions 0600).
* Writing a macOS LaunchAgent to enable auto-start on login and automatic restart on disconnect.
* Providing the GET /api/dsh-remote-frp/status endpoint (localhost only) to view status and logs.
* Optionally installing caffeinate as a daemon to prevent the Mac from sleeping and breaking the tunnel during idle.
* Optionally writing the domain name into trustedHosts in the managed block.
Installation and Configuration¶
1. Install Local Plugin¶
Execute in the DSH settings page:
dsh plugin --profile web add dsh-remote-frp
2. Configure Server¶
The server side requires the installation of frps and a Web server (supporting Caddy or Nginx).
Upload the server installation script to the server and execute it:
scp scripts/setup-server.sh root@<your_server>:/tmp/
ssh root@<your_server> 'bash /tmp/setup-server.sh --domain dsh.example.com --email you@example.com'
The script will automatically:
* Install frps and verify SHA256.
* Install Caddy or Nginx.
* Issue Let’s Encrypt certificates.
* Configure TLS reverse proxy to 127.0.0.1:13080.
* Print the frp token.
3. Fill in Configuration¶
Return to the DSH settings page and fill in the following fields based on the script output:
| Field | Description | Default |
|---|---|---|
server |
Server address (IP or domain) | - |
serverPort |
frps control port | 7000 |
remotePort |
Server side forwarding port (loopback only) | 13080 |
localPort |
Local DSH Web port | 0 (auto-detect current) |
token |
frp token (stored in plaintext, permission 0600) | - |
trustedHosts |
List of trusted domains (JSON array) | - |
autoStart |
Whether to install LaunchAgent | On |
keepAwake |
Whether to install caffeinate to prevent sleep | Off |
Usage and Troubleshooting¶
Check Status¶
Localhost only, used to check tunnel status:
curl -s http://127.0.0.1:3080/api/dsh-remote-frp/status
View Logs¶
View frpc tunnel logs:
tail -f ~/.dsh/remote-frp/frpc.log
View LaunchAgent status:
launchctl print gui/$(id -u)/com.local.dsh-remote-frp
End-to-end Checkup¶
The server side provides a verification script to check domain, frp, TLS, and security group configurations:
bash scripts/verify.sh --domain dsh.example.com --ssh root@<your_server>
Notes¶
- Scope of Responsibility: This plugin only manages the local Mac side. The server side requires running the installation script from the repository.
- Managed Block & API: If the domain is not written to
trustedHosts,/apirequests from non-loopback sources will return 403; the interface will open but data retrieval will fail. - Security Model:
frptoken and configuration file permissions are0600, server/etc/frp/tokenpermissions are0600.- The TLS entry point is bound only to loopback (
127.0.0.1); even if scanned by the public internet, direct access is impossible. - It is recommended to add
auth_basicor other authentication layers at the server entry point.
- Uninstallation:
- Stop and remove the LaunchAgent.
- Delete the
~/.dsh/remote-frpdirectory. - Stop
frpsand Web services on the server, and delete the/etc/frpdirectory.