Skip to content

Add server-managed local password sign-in - #450

Open
akashanil-dev wants to merge 4 commits into
DuskBotAI:devfrom
akashanil-dev:feat/self-hosted-passwords
Open

akashanil-dev wants to merge 4 commits into
DuskBotAI:devfrom
akashanil-dev:feat/self-hosted-passwords

Conversation

@akashanil-dev

@akashanil-dev akashanil-dev commented Nov 29, 2026 •

Copy link
Copy Markdown

What and why

Self-hosted operators can now give allow-listed people a local password without depending on dusk.bot or an email service. duskbot access add EMAIL --password and duskbot access password EMAIL use hidden terminal prompts. Credentials use the requested scrypt parameters (N=32768, r=8, p=1, 16-byte salt, 64-byte key), owner-only files and timing-safe comparison. Passwords accept at least 12 characters and up to 1 KB of UTF-8 input.

The single new JSON route, POST /api/auth/password, shares the existing per-address lockout, performs hash work for missing credentials, and returns the same refusal for unknown addresses and incorrect passwords. It issues existing local sessions with allow-list roles. Password resets and access removal revoke the relevant account sessions and stream tickets; independent pairings keep their existing management.

The existing /pair form gains one password field, enabled only after a password is configured. Pairing and email codes remain available. Recovery stays in the server terminal. There is no self-registration, recovery mail, OIDC or account-management page, and no new runtime dependency.

Related follow-up: browser sign-out

I included a browser Sign out action because a person who signs into a shared self-hosted server also needs to end that session from the same browser. It reuses the existing logout endpoint and confirmation-dialog component, revokes only that browser session, and returns to /pair. This is a session-lifecycle follow-up beyond the first-PR checklist, called out separately for review; it does not add another authentication or credential-management flow.

Closes #438. Implements the requested scope.

Rebase and review status

Target: dev, as requested by the maintainer. Rebased onto 82cca0699240dd8524703efeb8690293370d64e5; head bcd0b38d3a34b3ffc28da8303b88b9a0705790a3. All four password-branch patches are unchanged by the rebase. The UI follow-up remains separate in #451.

The maintainer's dedicated security review of the password route and session handling is still required before merging. Local tests do not replace that review.

Tested upstream base: 82cca0699240dd8524703efeb8690293370d64e5. Upstream advanced during verification; both branches also merge cleanly with dev at d012e49af2f620ac4b0b502b6d78e53fc46cabb4. That newer tip was a mergeability check, not the runtime test base.

How it was checked after the rebase

  • Standalone password branch: 188 tests passed across nine files, covering the credential store, hidden CLI prompts, JSON route, lockout, equal-work refusal, allow-list roles, session revocation and browser sign-out. Typecheck, lint, locale checks, and 12 documentation/source guard tests also passed on that branch.
  • The initial CLI startup fixture hit the real-engine safety guard on the host executable path. The same failure occurred on unchanged dev; rerunning with Node in an isolated executable directory passed all 188 tests, with the guard still enabled. This standalone pass used Node 26.12.0; the combined browser and Electron checks used Node 24.21.0.
  • On the combined head, typecheck, lint and locale validation passed. The renderer build and packaged-server build/smoke test also passed, including bundled startup, proxy paths, MCP, CLI, encrypted backup, container lifecycle and desktop compile-cache checks.
  • The full Electron suite passed on Node 24.21.0 (the CI major version): 2,282 passed, eight skipped. An earlier Node 26 run failed the unchanged download-resume test; the whole file and then the whole suite passed on Node 24.
  • Broker tests: 113 passed. No new dependency or lockfile change was introduced by either feature branch.
  • Fresh synthetic Chrome fixtures passed wrong-password refusal, successful login, cookie sessions, browser sign-out, and rejection of the revoked cookie. An initial concurrent run timed out creating a Chrome tab; the sequential rerun passed without changing product code.
  • The full root pnpm test gate has not been run to completion after this rebase. These results are the focused checks and separate gates listed here, not a claim that the whole root suite is green.

The earlier combined revision was tested on an isolated ARM64 deployment through Coolify, including a real Codex reply. The rebased revision has not been deployed; hosted instances were left unchanged during this update. Public evidence is exclusively synthetic local fixtures.

Reproduction commands and fixture setup: local-passwords verification.

  • Typecheck and lint pass
  • Complete pnpm test gate passes
  • New behavior has tests
  • No secrets, personal deployment data or local paths in feature diffs or screenshots
  • Reviewed immutable before/after screenshots attached

Before / after screenshots

Before: dev at 82cca0699240dd8524703efeb8690293370d64e5. After: password head bcd0b38d3a34b3ffc28da8303b88b9a0705790a3. Synthetic fixtures only; images are on separate orphan qa-assets branches and not in the feature diff.

Sign-in and pairing — light and dark
Theme / view Before After
light sign-in pair light before email pair light after password
dark sign-in pair dark before email pair dark after password
light pairing pair light before pairing pair light after pairing
dark pairing pair dark before pairing pair dark after pairing

@SiddDevZ

SiddDevZ commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Thank you for the careful work and the verification notes. Two things before this can go in: please retarget it to dev (main is for releases only) and rebase, since dev has moved a lot since f9fc4ea. It also adds a new password sign-in route and session handling, so it needs a dedicated security review by the maintainer before merging. Leaving it open for that.

@akashanil-dev
akashanil-dev force-pushed the feat/self-hosted-passwords branch from 454c913 to bcd0b38 Compare December 3, 2026 06:21
@akashanil-dev
akashanil-dev changed the base branch from main to dev December 3, 2026 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Self-hosted authentication without the dusk.bot account service

2 participants