Skip to content

Always serve the web UI: remove the web.enabled switch - #698

Merged
schmitch merged 1 commit into
mainfrom
schmitch/web-always-on-652
Oct 29, 2026
Merged

schmitch merged 1 commit into
mainfrom
schmitch/web-always-on-652

Conversation

@schmitch

Copy link
Copy Markdown
Member

[web] enabled = false turned the web UI off, and with it the administration screens, the /invite page on which an invited user chooses their password, and the page that approves an npm login in the browser (cli_auth.rs answered 404 then). Forge is administered from the browser, so the switch only added a configuration in which features quietly went missing.

Changes

  • Always mounted: build_router installs the SPA fallback unconditionally. Without a built UI it still answers 404, as before.
  • npm web login: start_web_login no longer has the "logins approved in the browser need the web UI" 404.
  • Refused at startup: WebConfig keeps enabled only as a private removed_enabled: Option<bool>. This follows the pattern of server.max_upload_bytes: WebConfig accepts unknown keys, so without the field a headless deployment would quietly get a UI. Startup refuses false, from forge.toml or FORGE_WEB__ENABLED=false, naming the setting to remove. A leftover enabled = true is accepted. web.assets_dir is unchanged.
  • Samples and harnesses: 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 set web.enabled.
    • The test servers now start with the UI mounted. Without an explicit assets dir, the default web/dist resolves against crates/server, which holds no built UI, so the fallback answers 404.
    • The npm and telemetry web-login tests no longer need a fake index.html to get a web login started.
  • Docs: docs/npm.md and web/README.md drop the "needs [web] enabled" wording.
  • Changelog: docs/changes/2.2.0/652.upgrade.md says what to remove.

Tests

  • New config tests:
    • web_enabled_false_is_refused: enabled = false is refused; enabled = true and no [web] section are accepted.
    • web_enabled_false_variable_is_refused: the same through FORGE_WEB__ENABLED.
  • cargo fmt --check, cargo clippy -p forge-server --all-targets -D warnings and cargo xtask changelog --check pass.
  • .github/scripts/test-parallel.sh -p forge-server passes: 36 test binaries, 560 tests, 0 failures.
  • I did not run the raw/oci/npm e2e scripts or the Playwright suite locally; CI runs them. For those, the change only removes the [web] enabled lines.

Fixes #652


Generated by Claude Code

`[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
@schmitch
schmitch enabled auto-merge October 29, 2026 23:16
@schmitch
schmitch added this pull request to the merge queue Oct 29, 2026
Merged via the queue into main with commit 47efcaa Oct 29, 2026
20 checks passed
@schmitch
schmitch deleted the schmitch/web-always-on-652 branch October 29, 2026 23:37
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.

Always serve the web UI: remove the web.enabled switch

2 participants