feat(web): HTTP Basic auth for the page behind a tunnel - #1
Merged
Merged
Conversation
`webAuth: { user, password }` in foreman.json makes every route, the page
itself included, demand Basic credentials and drops the localhost-only Host
check, so a tunnel such as ngrok can reach the page. Absent, nothing changes.
`ctl` sends the credentials to the daemon too. The password is compared in
constant time and, like the Slack webhook, is never logged or served.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L7dDnwXgZhAo9E6fne4tQP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
webAuth: { user, password }inforeman.json(machine config, off-repo) enables HTTP Basic auth on the status page.GET /demands the credentials (401+WWW-Authenticate: Basic realm="foreman"), and the localhost-onlyHostcheck is dropped songrok http <webPort>can reach the page. Without it, behaviour is unchanged.foreman stop/go/model/capsend the credentials to the daemon.slackWebhookUrl.foreman.jsontable row.Test plan
pnpm typecheck,pnpm test(588 pass; 7 new insrc/config.test.ts,src/web.test.ts)webAuth, restart daemon,ngrok http 8090, browser prompts once,foreman stopstill worksNote:
pnpm lintreports three pre-existing errors onmain(src/ci.ts:24,src/pick.ts:119,src/web.html:120), not from this change.🤖 Generated with Claude Code
https://claude.ai/code/session_01L7dDnwXgZhAo9E6fne4tQP