Skip to content

Dashboard: automatic browser access, no token entry - #294

Closed
Coding-Dev-Tools wants to merge 1 commit into
feat/file-guard-protectionfrom
fix/automatic-browser-access
Closed

Coding-Dev-Tools wants to merge 1 commit into
feat/file-guard-protectionfrom
fix/automatic-browser-access

Conversation

@Coding-Dev-Tools

Copy link
Copy Markdown
Owner

Why

Opening the dashboard from another machine asked a person to type ENGRAPHIS_API_TOKEN into a web form, and the Docker-host path could ask for it too. A deployment secret does not belong in a browser, and a single-user node should not gate its own human surface with a credential prompt.

What changed

Browsers never enter a token. The remote sign-in dialog and both window.prompt() token prompts are gone.

Automatic access is the default. POST /api/auth/local-session now mints the HttpOnly session for any same-origin browser request that reaches the deployment:

  • the dashboard's custom X-Engraphis-Browser-Session header is required;
  • Origin must exactly match a published Host — loopback, any literal address, single-label/mDNS (.local, .home.arpa), or the host in ENGRAPHIS_DASHBOARD_URL;
  • forwarding headers are honored only from a proxy listed in ENGRAPHIS_FORWARDED_ALLOW_IPS, and X-Forwarded-Proto decides the scheme behind that proxy.

That closes the Docker-host case (container-NAT peers) and every LAN/tunnel/Railway deployment without a form. Public hostnames must be configured via ENGRAPHIS_DASHBOARD_URL (the Railway template already sets it), which keeps DNS rebinding out.

Machine clients are unchanged. /api/* and /mcp still require Authorization: Bearer ENGRAPHIS_API_TOKEN.

Hardened mode remains available. Set ENGRAPHIS_BROWSER_AUTO_SESSION=0 to require a one-time link:

  • POST /api/auth/link (bearer-protected) mints a code signed with the token plus a per-process epoch;
  • engraphis-dashboard --link prints the link (railway run engraphis-dashboard --link on Railway, docker compose exec engraphis engraphis-dashboard --link in Compose);
  • the code travels only in a URL fragment, is single use, expires in 15 minutes, and buys a 12-hour session via POST /api/auth/handoff;
  • a server restart invalidates outstanding links.

Security posture

The dashboard's boundary is now the deployment's network reachability: whoever can open that origin gets this node's memories. That is the same trust model as the loopback quickstart, made explicit. SECURITY.md, docs/CONFIGURATION.md, docs/DOCKER.md, docs/HOSTING_RAILWAY.md, docs/AGENT_CONNECT.md, and .env.example document it, including the warning for public deployments.

Verification

  • python -m pytest tests/test_local_browser_access.py tests/test_local_auth_browser_session.py tests/test_dashboard_auth_placement.py tests/test_commercial_hardening.py tests/test_start_dashboard.py -q
  • python -m pytest tests/ -q
  • npx playwright test tests/e2e/ledger.spec.js tests/e2e/workspace-smoke.spec.js --project=chromium (64 passed)
  • ruff check ., python scripts/externalize_dashboard_assets.py, python scripts/check_commercial_manifest.py
  • Live smoke: mint link with --link, redeem for an HttpOnly cookie, authenticated /api/bootstrap 200, replay 401.

Stacked PR

This builds on feat/file-guard-protection (PR #289) because the Ledger assets and their tests live in that branch's state. Retarget to main once #289 lands.

Not done

No merge, deploy, or release. No credentials or generated databases are included.

Remove the browser token form and both window.prompt() token prompts. The
dashboard now mints its HttpOnly session for any same-origin browser request
that reaches it: loopback, a literal address, a single-label/mDNS name, or the
host in ENGRAPHIS_DASHBOARD_URL, still gated by the custom browser header, an
exact Origin/Host match, and a trusted-proxy check for forwarding headers.
That covers the Docker host, LAN, tunnel, and hosted deployments without a
credential prompt.

Machine clients and /mcp still require Authorization: Bearer
ENGRAPHIS_API_TOKEN. Set ENGRAPHIS_BROWSER_AUTO_SESSION=0 for a hardened
deployment: POST /api/auth/link (bearer-protected) and
engraphis-dashboard --link mint a single-use code, signed with the token plus
a per-process epoch, delivered in a URL fragment, valid for 15 minutes, and
redeemed at POST /api/auth/handoff for a 12-hour session.

Docs state the resulting boundary (the deployment's network reachability) and
the public-deployment warning. Tests cover automatic access, cross-site and
rebinding rejection, trusted-proxy handling, the link round trip, replay
rejection, and the CLI.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-31T06:50:41.197515Z
We couldn’t complete this review. Comment @codex review to try again.
ee77051 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@Coding-Dev-Tools

Copy link
Copy Markdown
Owner Author

Superseded by #296, which implements the same behavior directly on current main; this branch was stacked on the older \ eat/file-guard-protection\ tree. Closing to avoid duplicate review. The branch remains available if you want to compare implementations.

@Coding-Dev-Tools
Coding-Dev-Tools deleted the fix/automatic-browser-access branch November 1, 2026 09:08
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.

1 participant