Skip to content

docs: document BUZZ_CORS_ORIGINS and Tauri webview origins in .env.example - #2617

Open
suhaskashyaps wants to merge 1 commit into
block:mainfrom
suhaskashyaps:docs-cors-tauri-origins
Open

docs: document BUZZ_CORS_ORIGINS and Tauri webview origins in .env.example#2617
suhaskashyaps wants to merge 1 commit into
block:mainfrom
suhaskashyaps:docs-cors-tauri-origins

Conversation

@suhaskashyaps

Copy link
Copy Markdown

Summary

Documents the BUZZ_CORS_ORIGINS relay setting in .env.example, including the Tauri desktop webview origins that must be allowlisted for the desktop app's HTTP API calls to work.

Motivation

Self-hosting Buzz behind a reverse proxy, we set BUZZ_CORS_ORIGINS=https://<our-domain> and the desktop app's invite minting failed with WebKit's "Load failed", while WebSocket chat kept working. Root cause: the desktop webview's origin (tauri://localhost) was not in the allowlist, so the browser engine blocked the HTTP endpoints (/api/invites, moderation) at preflight.

The relay code already notes this in a doc comment (crates/buzz-relay/src/config.rs), but .env.example, the file operators actually copy, has no mention of BUZZ_CORS_ORIGINS at all. This fills that gap where operators will actually see it.

What changed

.env.example: 7 comment lines in the Relay section documenting BUZZ_CORS_ORIGINS:

  • comma-separated format
  • permissive default when unset (dev mode)
  • the desktop webview origins that must be included: tauri://localhost (macOS/Linux) and http://tauri.localhost (Windows)
  • invalid values are rejected rather than treated as permissive

Verification

Docs-only change; no code paths touched.

  • Reproduced live on our deployment: OPTIONS /api/invites preflight with Origin: tauri://localhost returned no access-control-allow-origin until the origin was added to BUZZ_CORS_ORIGINS; the desktop invite flow then worked.
  • Claims cross-checked against code: build_cors_layer in crates/buzz-relay/src/router.rs (permissive when unset; empty non-permissive layer when values fail to parse), crates/buzz-relay/src/config.rs (comma-separated parsing), desktop/src-tauri/src/media_proxy.rs (accepted webview origins tauri://localhost and http://tauri.localhost).
  • The Windows origin is derived from media_proxy.rs and Tauri v2's default (useHttpsScheme unset = http://tauri.localhost), not live-verified on Windows. It would be https://tauri.localhost only if useHttpsScheme: true were set, which this app does not do.

Notes

🤖 Generated with Claude Code

…ample

Setting BUZZ_CORS_ORIGINS to only the public origin blocks the desktop
app's HTTP API calls (invites, moderation) with a CORS network error,
while WebSocket traffic keeps working. The webview origins that must be
allowlisted are tauri://localhost (macOS/Linux) and http://tauri.localhost
(Windows, per media_proxy.rs and Tauri v2's http default). The relay code
documents this in a doc comment (config.rs), but .env.example, the file
operators actually copy, had no mention of the variable.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant