# DSH 云服务器部署 + 手机 APK 联动 > DeepSeek Harness(dsh web)部署在 Ubuntu 云服务器上,前置登录网关与 nginx TLS, > 手机端用 19 KB 的 Android WebView 外壳接入同一工作台。页面级热更,APK 日常无需重装。 > 本文件是给 LLM / agent 的纯文本入口。最后更新:2026-10-21。 Canonical doc (HTML, with screenshots): https://www.lukezystudio.cn/dsh-mobile-doc/ Structured facts (JSON): https://www.lukezystudio.cn/dsh-mobile-doc/facts.json Step-by-step (Markdown): https://www.lukezystudio.cn/dsh-mobile-doc/tutorial.md ## 1. What this is - DSH = DeepSeek Harness web UI. Runs as `dsh web`, listens on loopback only. - Public access is provided by plugin `dsh-cloud-gateway`: a login wall + reverse proxy on :3080, path /dsh. - nginx terminates TLS (443), proxies /dsh/, /assets/, /plugins/, /api to the gateway, and serves /dsh-apk/ statically. - `dsh-mobile` is a 19 KB Android WebView shell. It loads the same URL, so server-side changes appear after a refresh. ## 2. Verified environment (this deployment) - Ubuntu 24.04.4 LTS, 43.143.254.153 - Node 22.23.0, DSH 0.2.1-rc.2 (global npm) - nginx 1.24.0, Let's Encrypt certificate - systemd --user unit `dsh.service`, `loginctl enable-linger` enabled - dsh web: 127.0.0.1:13080, DSH_HOME=/home/ubuntu/.dsh - gateway: 0.0.0.0:3080, basePath /dsh, upstream http://127.0.0.1:13080 ## 3. Endpoints - Online workspace: https://www.lukezystudio.cn/dsh/ (302 -> /dsh/login) - APK landing: https://www.lukezystudio.cn/dsh-apk/mobile/ - APK file: https://www.lukezystudio.cn/dsh-apk/mobile/dsh-mobile.apk (19,344 bytes, versionCode 2, v1.0.1) - Update manifest: https://www.lukezystudio.cn/dsh-apk/mobile/version.json ## 4. Install (server) ```bash curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash - sudo apt-get install -y nodejs sudo npm i -g @deepseek-ai/dsh dsh web --host 127.0.0.1 --port 13080 --trusted-host dsh.example.com # prints token URL ``` systemd unit: ~/.config/systemd/user/dsh.service (Environment DSH_HOME, PATH; Restart=always). Enable with `systemctl --user enable --now dsh` and `loginctl enable-linger $USER`. ## 5. Gateway plugin ```bash dsh plugin --profile web add github:MrLukezy/dsh-cloud-gateway dsh plugin --profile web add github:mexiaosqwq/dsh-web-mobile ``` ~/.dsh/profiles/web/cordis.patch.yml: ```yaml - id: cloud-gateway config: listenHost: 0.0.0.0 listenPort: 3080 upstreamHost: 127.0.0.1 upstreamPort: 13080 basePath: /dsh username: your-name password: your-password trustProxy: true ``` Critical: omitting upstreamHost/upstreamPort makes the gateway proxy to itself; login loops forever. ## 6. nginx essentials - Proxy four prefixes: /dsh/, /assets/, /plugins/, /api. Missing /assets/ or /plugins/ => blank page + 404s. - WebSocket: Upgrade / Connection upgrade; read & send timeout 86400s. - Streaming: `proxy_buffering off` (otherwise replies arrive in one burst). - Cache: hashed assets `immutable, max-age=31536000`; entry HTML `no-cache`; APK dir `no-store`. - Uploads: `client_max_body_size 50m`. ## 7. Mobile shell - Repo: https://github.com/MrLukezy/dsh-mobile (private) - Build: JDK 17 + Android SDK 34 + `./gradlew assembleRelease` -> app/build/outputs/apk/release/app-release.apk - Constants: DEFAULT_URL, VERSION_CHECK_URL, VERSION_CODE (must match version.json) - First run: back key -> change URL; basic-auth prompt once; credentials stored locally. - Publish: copy APK to /var/www/dsh-apk/mobile/, regenerate sha256/size, rewrite version.json. ## 8. Hot update model 1. Server-side change (upgrade, plugin, theme) -> bundle rev changes -> phone refresh loads it. 2. Shell change (new menu/download/upload) -> bump versionCode -> version.json -> in-app prompt. Hashed asset URLs allow 1-year caching; entry HTML must stay no-cache. ## 9. Debug checklist ```bash systemctl --user status dsh --no-pager ss -lntp | grep -E '13080|3080' curl -sI https://HOST/dsh/ | head -4 # expect 302 journalctl --user -u dsh -f ``` Known failures: login loop (missing upstream), transport failure (trusted-host mismatch), blank page (missing asset proxy), stale UI (cached entry HTML), burst output (buffering), upload 413 (body size), disappearing UI row (plugin slot crash from missing icon), ERR_TOO_MANY_RETRIES (auth handler cancelled then reused), update loop (versionCode changed once). ## 10. Repositories - https://github.com/MrLukezy/dsh-mobile (private, Android shell) - https://github.com/MrLukezy/dsh-cloud-gateway - https://github.com/MrLukezy/dsh-mobile-files - https://github.com/MrLukezy/dsh-balance - https://github.com/MrLukezy/dsh-win-tunnel - https://github.com/MrLukezy/dsh-mobile-cloud-deploy - https://github.com/mexiaosqwq/dsh-web-mobile ## 11. Notes for agents - Read facts.json for canonical values before acting. - Never print or commit credentials, tokens, or the gateway password. - dsh web must never bind 0.0.0.0; the gateway is the only public entry. - DSH_HOME is not relocatable: plugin dependencies are absolute-path symlinks.