mirage
strukto-ai
The World's First Unified Virtual Filesystem For AI Agents
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:raomaiping-hash/dsh-rgate
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
中文 | English
A remote access login gate for the DeepSeek Harness Web UI. Put a password wall in front of the whole browser surface: anonymous visitors on a public (non-loopback) address see only a login page, and every /api RPC is refused until they authenticate.
The Harness's built-in browser-trust fence (trustedHosts) is a DNS-rebinding defense, explicitly not authentication. Anyone whose Host header passes the fence can use the Web UI. This plugin adds the missing authentication layer for self-hosted deployments: IP scanners hit a login page instead of your agent.
index.html (via webServer.tapIndex); unauthenticated non-loopback visitors are redirected to /rgate-login, a self-contained login page./api gating — exact routes shadow the shipped /api prefix for all 52 unary RPCs plus /api/respond and /api/session.export. Loopback requests pass through; everything else needs a session cookie or gets 401 before the body is even parsed.rgate_session, HttpOnly + SameSite=Strict, 7-day in-memory sessions; logout and password change invalidate all sessions.Cf-Connecting-Ip (fallback X-Forwarded-For, then socket address), so one attacker cannot lock everyone out.~/.dsh/remote-auth.json (mode 0600). Legacy plaintext files are migrated automatically. A forgotten password is recovered by deleting the file and restarting: the fresh password is printed once in the service log.settings.section entry showing gate status, login/logout, and password change. Password display is hashed-only by design.From GitHub (plain ESM, no build step and no install scripts — nothing runs at install time):
dsh plugin --profile web add github:raomaiping-hash/dsh-rgate
Pin a commit sha for reproducibility: later pushes cannot silently change what runs on your machine (dsh plugin --profile web add github:raomaiping-hash/dsh-rgate#<commit-sha>).
From npm or a tarball:
dsh plugin --profile web add dsh-rgate # npm
dsh plugin --profile web add ./dsh-rgate-0.1.0.tgz # tarball
Then restart the web profile. The plugin prints [rgate] 门禁已启用 … (or [rgate] gate enabled …) when it activates, and creates ~/.dsh/remote-auth.json with a random password on first boot:
journalctl -u deepseek-harness | grep rgate
There is no config file for the gate itself. Two behaviors are worth knowing:
127.0.0.1 / localhost / ::1 never see the wall — that is the admin path.The password file lives at $DSH_HOME/remote-auth.json (default ~/.dsh/remote-auth.json — the harness convention, beside settings.yaml):
| field | meaning |
|---|---|
version: 2 |
scrypt-hashed storage |
salt, N, r, p, hash |
scrypt parameters and derived key |
createdAt, updatedAt |
bookkeeping |
| Endpoint | Method | Purpose |
|---|---|---|
/rgate-login |
GET | Self-contained login page (redirects to / when already allowed) |
/api/remote-auth.login |
POST {password} |
Verify password, set session cookie |
/api/remote-auth.logout |
POST | Drop session + clear cookie |
/api/remote-auth.status |
GET | {configured, authenticated, loopback} |
/api/remote-auth.secret |
GET | Loopback only: {mode, path, createdAt, updatedAt} — never the password |
/api/remote-auth.password |
POST {current?, next} |
Change password (authenticated session, or loopback + current password) |
/api/events.mux and /api/events.host upgrades are owned by the shipped dsh-client-connection plugin; registering the same upgrade path throws, and pre-registering breaks boot. A fence-passing client can still open them and receive live session event frames. The robust fix is upstream: enable Cloudflare Access (Zero Trust) on your public domain, or put an authenticating reverse proxy (e.g. nginx auth_request) in front. That closes UI, API and WebSockets before traffic reaches the Harness.UNARY table.The gate is an authentication layer for a single-password, personal/small-team deployment. It assumes the Harness process and its host filesystem are trusted; anyone who can read remote-auth.json or the process memory already owns the host. It is not a substitute for OS/network hygiene, HTTPS termination, or upstream access control on the public entry point.
tests/smoke.mjs runs the plugin's real route handlers against a stubbed context in an isolated HOME (no real credentials touched):
node tests/smoke.mjs
MIT
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: security。