deepseek-harness
deepseek-ai
DeepSeek Harness: Everything is a Plugin.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:lijx122/dsh-plugin-auth-guard
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
English Documentation | 简体中文文档 (README_CN.md)
DeepSeek Harness (DSH) is a powerful AI coding agent runtime designed natively for local desktop workflows (127.0.0.1). When developers attempt to expose DSH across local area networks (LAN) to mobile devices (iOS/Android) or host it on remote cloud servers, they encounter critical barriers:
settings.describe or llm.providers is blocked with 403 Forbidden, making remote model switching impossible.crypto.randomUUID undefined and breaking all RPCs.dsh-better-sidebar) and package managers expose PTY terminal sockets (/sidebar/ws/terminal) and arbitrary file access without authentication.dsh-plugin-auth-guard is the zero-intrusion, production-ready solution. It unblocks remote access, injects mobile polyfills dynamically, and establishes a full-stack Default-Deny Zero-Trust Security Gateway with cryptographic credential lifecycle management.
flowchart TD
Client[Client Device Phone/Tablet/PC] -->|HTTP / WebSocket| Ingress[Node.js http.Server: 3080]
Ingress --> L1[L1: Physical Socket Origin Check isPhysicalLoopback]
L1 --> L2[L2: Enterprise Security Headers nosniff / SAMEORIGIN / Referrer / no-store]
L2 --> L3[L3: 64KB Payload OOM Protection]
L3 --> L4[L4: CSRF & CSWSH Strict Hostname Comparison]
L4 --> L5{L5: Public Whitelist Strict Regex Matching}
L5 -->|Whitelisted: Static Files / Login API| PassPublic[Serve Static Resource]
L5 -->|Non-Whitelisted: Core RPC / Plugin Routes / Terminal WS| L6{L6: Password-Fingerprinted HMAC-SHA256 Verification}
L6 -->|Authenticated / Physical Loopback| Router[Forward to Core App / Proxy Privileged RPC]
L6 -->|Unauthenticated / Revoked Token| Block[Block with HTTP 401 / Destroy WebSocket]
0.0.0.0:3080 and dynamically enumerates all active LAN IPv4 interfaces.settings.describe, llm.providers, credentials.* for authenticated clients, completely eliminating 403 Forbidden errors.<head> on the fly via tapIndex, ensuring smooth mobile operation over HTTP.request and WebSocket upgrade events at the lowest TCP server level./api/*), plugin managers (/api2/*), and sidebar routes (/sidebar/*)..role('secret') to prevent wire leakage.crypto.timingSafeEqual prevents timing side-channel attacks.req.socket.remoteAddress to prevent Host: 127.0.0.1 spoofing and proxy loopback inversion.HTTP 429) with auto-garbage collection (GC).--dsw-*), fish logo, and standard typography.document.body level (z-index: 2147483647) with background blur to prevent click-through.BroadcastChannel for instant cross-tab state updates.dsh plugin --profile web add github:lijx122/dsh-plugin-auth-guard
auth-guard and click Install.~/.dsh/plugins/dsh-plugin-auth-guard.~/.dsh/profiles/web/package.json, add:{
"dependencies": {
"dsh-plugin-auth-guard": "link:../../plugins/dsh-plugin-auth-guard"
}
}
"dsh-plugin-auth-guard" to dsh.profile.bundles and restart DSH.Navigate to Settings $ ightarrow$ Security & Access (安全与访问):
| Setting | Description | Default |
|---|---|---|
| Require password for LAN/Remote access | Requires password authentication when accessed from non-localhost IPs | Enabled |
| Enforce authentication globally | Enforces password authentication even on 127.0.0.1 localhost |
Optional |
| Administrator Credentials | Set or change admin username and password ($\ge 6$ characters) | Customizable |
| Active LAN IP Directory | Real-time overview of all listening LAN addresses with 1-click copy | Auto-detected |
When deploying behind a reverse proxy, configure the following 5 settings to ensure smooth large file uploads, unbuffered streaming responses, and accurate zero-trust perimeter defense:
Nginx default client_max_body_size is 1MB, which rejects image and file uploads.
client_max_body_size 160M; (aligned with DSH 160MB upload capacity).auth-guard relies on these headers to distinguish local from proxied traffic and apply accurate rate-limiting:
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
DSH real-time conversation streams and sidebar PTY terminals require WebSocket support.
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
Prevents Nginx from dropping connections during long-running agent tool runs.
proxy_read_timeout 3600s;
proxy_send_timeout 3600s;
Ensures tokens stream to the browser character-by-character without proxy-level buffering delays.
proxy_buffering off;# 1. HTTP -> HTTPS Redirect
server {
listen 80;
server_name dsh.yourdomain.com;
return 301 https://$host$request_uri;
}
# 2. HTTPS Proxy Core
server {
listen 443 ssl http2;
server_name dsh.yourdomain.com;
# SSL Certificates
ssl_certificate /etc/nginx/ssl/dsh.yourdomain.com.crt;
ssl_certificate_key /etc/nginx/ssl/dsh.yourdomain.com.key;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
# [Key 1] Allow up to 160MB file uploads
client_max_body_size 160M;
location / {
proxy_pass http://127.0.0.1:3080;
proxy_http_version 1.1;
# [Key 2] WebSocket Upgrade Support
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# [Key 3] Real IP and Scheme Forwarding
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# [Key 4 & 5] Timeout & Unbuffered Real-time Token Streaming
proxy_read_timeout 3600s;
proxy_send_timeout 3600s;
proxy_buffering off;
}
}
~/.dsh/settings.yaml on the host machine.auth-guard:, clear passwordHash and salt (set to "").http://127.0.0.1:3080 locally to initialize a new password.This is by design. Changing the password updates the password fingerprint in tokens and triggers the active WebSocket purge to ensure compromised credentials cannot be reused.
The plugin injects a crypto.randomUUID polyfill dynamically on the fly during HTML serving, allowing seamless mobile operation without local SSL setup.
Distributed under the MIT License.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。