Repository navigation
Always serve the web UI: remove the web.enabled switch - #698
Merged
Merged
Conversation
`[web] enabled = false` turned the web UI off, and with it the administration screens, the page on which an invited user chooses their password and the page that approves an `npm login` in the browser (which then answered 404). Forge is administered from the browser, so the switch only added a configuration in which features quietly went missing. The SPA fallback is now always mounted, and the web login of `npm login` no longer has a "no web UI" 404. `web.enabled` is kept in `WebConfig` only to refuse `false` at startup (`FORGE_WEB__ENABLED` included), naming the setting to remove, so a headless deployment learns of the change instead of quietly getting a UI; a leftover `true` is accepted. `web.assets_dir` stays. The sample configurations, the CI e2e scripts, the Playwright harness and the server's test harness no longer set it: the test servers start with the web UI mounted, from a `web/dist` that holds no built UI in a test, so the fallback answers 404 as before. Fixes #652 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012e6DJZDaP6c2gEFqFeJ8ZP
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.
[web] enabled = falseturned the web UI off, and with it the administration screens, the/invitepage on which an invited user chooses their password, and the page that approves annpm loginin the browser (cli_auth.rsanswered 404 then). Forge is administered from the browser, so the switch only added a configuration in which features quietly went missing.Changes
build_routerinstalls the SPA fallback unconditionally. Without a built UI it still answers 404, as before.start_web_loginno longer has the "logins approved in the browser need the web UI" 404.WebConfigkeepsenabledonly as a privateremoved_enabled: Option<bool>. This follows the pattern ofserver.max_upload_bytes:WebConfigaccepts unknown keys, so without the field a headless deployment would quietly get a UI. Startup refusesfalse, fromforge.tomlorFORGE_WEB__ENABLED=false, naming the setting to remove. A leftoverenabled = trueis accepted.web.assets_diris unchanged.forge.toml,forge.toml.example,docker/forge.docker.toml,.env.example, the raw/oci/npm e2e scripts, the Playwright harness (web/e2e/harness.ts) and the server's test harness no longer setweb.enabled.web/distresolves againstcrates/server, which holds no built UI, so the fallback answers 404.index.htmlto get a web login started.docs/npm.mdandweb/README.mddrop the "needs[web] enabled" wording.docs/changes/2.2.0/652.upgrade.mdsays what to remove.Tests
web_enabled_false_is_refused:enabled = falseis refused;enabled = trueand no[web]section are accepted.web_enabled_false_variable_is_refused: the same throughFORGE_WEB__ENABLED.cargo fmt --check,cargo clippy -p forge-server --all-targets -D warningsandcargo xtask changelog --checkpass..github/scripts/test-parallel.sh -p forge-serverpasses: 36 test binaries, 560 tests, 0 failures.[web] enabledlines.Fixes #652
Generated by Claude Code