docs(env): note that / and /repos need BUZZ_SERVE_GIT_WEB_GUI - #3857
docs(env): note that / and /repos need BUZZ_SERVE_GIT_WEB_GUI#3857TheSeydiCharyyev wants to merge 2 commits into
Conversation
The BUZZ_WEB_DIR comment said setting it makes the relay serve "the web
frontend at / for browser requests". Setting it alone does not do that.
`should_serve_spa` in crates/buzz-relay/src/router.rs returns
`is_invite_landing_path(path) || (serve_git_web_gui && is_git_web_gui_path(path))`,
and `nip11_or_ws_handler` gates the `Accept: text/html` branch for / on the
same flag. `serve_git_web_gui` is read from BUZZ_SERVE_GIT_WEB_GUI and
defaults to false, so with only BUZZ_WEB_DIR set a browser hitting / gets the
NIP-11 document. The repo's own test says as much - router.rs has
`invite_is_always_served_but_git_gui_requires_opt_in`, asserting
`!should_serve_spa("/", false)` and `should_serve_spa("/", true)`.
Invite links do work with BUZZ_WEB_DIR alone, so the comment now says that
instead, and documents BUZZ_SERVE_GIT_WEB_GUI, which .env.example did not
mention at all. Wording follows the table already in TESTING.md, which
describes this correctly.
Fixes block#3815
Signed-off-by: Seydi Charyyev <seydi.charyev@gmail.com>
|
good doc catch. can you also mention it next to BUZZ_SERVE_GIT_WEB_GUI so both comments point at each other? |
Positional wording breaks if the lines ever move, so the BUZZ_WEB_DIR comment now names BUZZ_SERVE_GIT_WEB_GUI directly. Signed-off-by: Seydi Charyyev <seydi.charyev@gmail.com>
|
Both comments are already adjacent and point at each other — this PR adds the One thing worth taking from it though: the first block said "the flag below", which breaks if the lines ever move. Pushed For reference, |
Summary
The
BUZZ_WEB_DIRcomment in.env.examplesays that setting it makes the relay serve "the web frontend at/for browser requests". Setting it alone does not do that, so anyone following the file ends up with a relay that answers/with JSON and concludes the web bundle is broken.What the code actually does —
crates/buzz-relay/src/router.rs:nip11_or_ws_handlergates itsAccept: text/htmlbranch for/on the same flag, andserve_git_web_guiis read fromBUZZ_SERVE_GIT_WEB_GUIincrates/buzz-relay/src/config.rswith.unwrap_or(false). So with onlyBUZZ_WEB_DIRset, a browser requesting/gets the NIP-11 document./invite/{code}does work withBUZZ_WEB_DIRalone, sinceis_invite_landing_pathis checked unconditionally. The comment now says that, and documentsBUZZ_SERVE_GIT_WEB_GUI— which.env.exampledid not mention at all.The wording follows the table already in
TESTING.md, which describes both variables correctly today; this only brings.env.examplein line with it.Related issue
Fixes #3815. No open PR touches these lines — #3777 also edits
.env.example, but addsBUZZ_ADMIN_WEB_DIRin a different section.Testing
Documentation only; no code changes, so no behaviour to test. The claim is verified against the repository's own unit test rather than by reasoning alone —
crates/buzz-relay/src/router.rscontains:That test is exactly the behaviour the old comment contradicted.