dsh-admin-gate
Password gate in front of the DeepSeek Harness web UI: admins sign in with a password stored only as a scrypt salted hash, and guests enter without one but are held to an allowlist of /api endpoints and agent tools; several admin accounts may exist, each with its own password; three modes (admin-only, guest, open), and closing guest entry drops every guest already inside; conversation ownership is recorded per sessionId so each account sees only its own conversations, with list and search filtering rather than refusing so "exists but you cannot see it" never leaks. The gate is enforced on the host, not in the page: connection.admit, admitConnection and authorizeIndex decide who a visitor is and issue a Peer carrying that identity, connection/request answers 401 or 403, WebSocket streams are checked when they open, and tools.guard() keeps guest-triggered agent turns inside the tool allowlist. The gate page and its JSON API are mounted at /admin-gate, outside /api, so they do not depend on the harness cookie; because webServer routes get no Host or Origin admission from DSH, every gate request is checked against connection.isTrusted first, so a cross-site page cannot drive the passwordless login endpoint or use it as a password oracle. Five failed logins within ten minutes lock the door for five minutes, and state is written to a temporary file and renamed so an interrupted write cannot leave a half-written JSON. The default allowlists deliberately exclude session/prompt and the read, bash and write tools, since those run as the owner.
Overview
Password gate in front of the DeepSeek Harness web UI: admins sign in with a password stored only as a scrypt salted hash, and guests enter without one but are held to an allowlist of /api endpoints and agent tools; several admin accounts may exist, each with its own password; three modes (admin-only, guest, open), and closing guest entry drops every guest already inside; conversation ownership is recorded per sessionId so each account sees only its own conversations, with list and search filtering rather than refusing so "exists but you cannot see it" never leaks. The gate is enforced on the host, not in the page: connection.admit, admitConnection and authorizeIndex decide who a visitor is and issue a Peer carrying that identity, connection/request answers 401 or 403, WebSocket streams are checked when they open, and tools.guard() keeps guest-triggered agent turns inside the tool allowlist. The gate page and its JSON API are mounted at /admin-gate, outside /api, so they do not depend on the harness cookie; because webServer routes get no Host or Origin admission from DSH, every gate request is checked against connection.isTrusted first, so a cross-site page cannot drive the passwordless login endpoint or use it as a password oracle. Five failed logins within ten minutes lock the door for five minutes, and state is written to a temporary file and renamed so an interrupted write cannot leave a half-written JSON. The default allowlists deliberately exclude session/prompt and the read, bash and write tools, since those run as the owner.
Installation
Version compatibility
Compatibility is unconfirmed. Check the project documentation for supported versions.
Installation notes
- May run terminal commands