SummerSec/dsh-web-auth0

@summersec/dsh-web-auth

Transport-level authentication gate for the DeepSeek Harness Web GUI

AI 分析

核心用途是为 DSH 网页服务添加登录密码验证,防止未授权访问。适合将 DSH 部署在公网服务器、局域网或需要多设备远程访问,注重隐私安全的用户。

パッケージ
@summersec/dsh-web-auth
バージョン
0.1.2
ライセンス
MIT
最終更新
2026/08/16

インストール

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:SummerSec/dsh-web-auth

ドキュメント

README 全文を読む ↗

Advanced configuration

The bundle:

  1. Sets the stock webserver row to disabled: true.
  2. Inserts webserver-auth with name @summersec/dsh-web-auth.

DSH patches replace config as a whole. To override advanced fields, restate the full webserver-auth block in the profile patch (e.g. profile cordis.patch.yml):

- id: webserver-auth
  name: '@summersec/dsh-web-auth'
  inject: [webStartup]
  config:
    host: !!js ctx.webStartup.host ?? '127.0.0.1'
    port: !!js ctx.webStartup.port ?? 3080
    authMode: always
    username: admin
    passwordHash: !!js process.env.WEB_AUTH_PASSWORD_HASH
    sessionTtlMinutes: 720
    maxAttempts: 5
    attemptWindowSeconds: 300
    secureCookie: auto
    trustProxy: false

Config reference

FieldType / valuesDefaultNotes
host127.0.0.1 | 0.0.0.0127.0.0.1Listen address (from web startup)
port0655353080Listen port; 0 for ephemeral
authModealways | non-loopbackalwaysSee Authentication modes
usernamestringadminSingle shared account
passwordstringPlaintext; avoid in production
passwordHashscrypt$...Required format from the CLI
sessionTtlMinutes143200720 (12h)Sliding window on each authenticated request
maxAttempts110005Failed logins per IP per window
attemptWindowSeconds186400300Attempt window length
secureCookieauto | always | neverautoWhen to set the Secure flag
trustProxybooleanfalseTrust X-Forwarded-* only behind a locked-down proxy

secureCookie and trustProxy

ScenarioSuggested settings
Local HTTP on loopbacksecureCookie: auto, trustProxy: false
Direct TLS on the Node processsecureCookie: auto (sets Secure when the socket is encrypted)
HTTPS terminated at nginx / Caddy / CloudflaresecureCookie: auto or always, trustProxy: true, and only the proxy may reach DSH’s port

If trustProxy is true while the port is reachable by untrusted clients, attackers can spoof X-Forwarded-For / X-Forwarded-Proto and weaken IP limits or cookie security. Lock network access first.