From e9b3ef9fff24fcfa401cf5c98c1ebcd7f4b6a0d7 Mon Sep 17 00:00:00 2001 From: Seydi Charyyev Date: Fri, 31 Jul 2026 09:45:11 +0500 Subject: [PATCH 1/2] docs(env): note that / and /repos need BUZZ_SERVE_GIT_WEB_GUI 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 #3815 Signed-off-by: Seydi Charyyev --- .env.example | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.env.example b/.env.example index b9bfcada0e..5dbb40770a 100644 --- a/.env.example +++ b/.env.example @@ -54,10 +54,16 @@ RELAY_URL=ws://localhost:3000 # Stable relay signing key. Set this in dev if you want REST-created forum posts # to keep resolving to the original author across relay restarts. # BUZZ_RELAY_PRIVATE_KEY=<32-byte hex private key> -# Optional: path to the web UI dist directory. When set, the relay serves -# the web frontend at / for browser requests. Leave unset for local dev -# (use `just web` for Vite HMR instead). +# Optional: path to the web UI dist directory. When set, the relay serves the +# invite landing bundle, so /invite/{code} works for browser requests. Leave +# unset for local dev (use `just web` for Vite HMR instead). # BUZZ_WEB_DIR=./web/dist +# Serving the bundle at / and /repos/... additionally requires the flag below; +# without it those paths answer with the NIP-11 document instead of the SPA. +# Set to `true` or `1` to expose the bundled Git repository browser. Has no +# effect unless BUZZ_WEB_DIR is set. Defaults to false; invite routes do not +# depend on this flag. +# BUZZ_SERVE_GIT_WEB_GUI=true # Shared Redis-backed admission limits. Defaults shown below; each value must # be a positive integer. From 5957f290d79c7eba9a93a557cf0743c090f0d0da Mon Sep 17 00:00:00 2001 From: Seydi Charyyev Date: Fri, 31 Jul 2026 13:51:01 +0500 Subject: [PATCH 2/2] docs(env): name the flag instead of pointing at "the flag below" 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 --- .env.example | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index 5dbb40770a..46b5496649 100644 --- a/.env.example +++ b/.env.example @@ -58,8 +58,9 @@ RELAY_URL=ws://localhost:3000 # invite landing bundle, so /invite/{code} works for browser requests. Leave # unset for local dev (use `just web` for Vite HMR instead). # BUZZ_WEB_DIR=./web/dist -# Serving the bundle at / and /repos/... additionally requires the flag below; -# without it those paths answer with the NIP-11 document instead of the SPA. +# Serving the bundle at / and /repos/... additionally requires +# BUZZ_SERVE_GIT_WEB_GUI; without it those paths answer with the NIP-11 +# document instead of the SPA. # Set to `true` or `1` to expose the bundled Git repository browser. Has no # effect unless BUZZ_WEB_DIR is set. Defaults to false; invite routes do not # depend on this flag.