Skip to content

fix(deploy): add Tauri webview origins to the compose BUZZ_CORS_ORIGINS default#2888

Open
nscheifler wants to merge 1 commit into
block:mainfrom
nscheifler:fix/compose-cors-tauri-origins
Open

fix(deploy): add Tauri webview origins to the compose BUZZ_CORS_ORIGINS default#2888
nscheifler wants to merge 1 commit into
block:mainfrom
nscheifler:fix/compose-cors-tauri-origins

Conversation

@nscheifler

@nscheifler nscheifler commented Jul 25, 2026

Copy link
Copy Markdown

Summary

The compose template deploy/compose/.env.example sets BUZZ_CORS_ORIGINS to one public domain. The webview of the desktop app has a different origin. The origin is tauri://localhost on macOS and Linux. The origin is http://tauri.localhost on Windows.

The relay reads BUZZ_CORS_ORIGINS as a comma-separated list of exact origins (crates/buzz-relay/src/config.rs; build_cors_layer in crates/buzz-relay/src/router.rs). When the variable is set, the relay does not permit other origins. This design is correct, but the template value does not include the webview origins. Thus the desktop app cannot use the HTTP API of a relay that an operator deploys from the template.

The first failure that the user sees is in the "Join an existing community" flow. The flow stops and shows the error Load failed. At the same time, the relay replies correctly to a NIP-11 request from curl. Thus the relay seems healthy, and the CORS cause is hard to find.

This change:

  • Adds the two webview origins to the default value of BUZZ_CORS_ORIGINS in deploy/compose/.env.example.
  • Adds a comment to the same file. The comment tells the operator to keep the webview origins when they set their own domain.
  • Adds a note with the same requirement to the "Production notes" section of deploy/compose/README.md.

Related issue

Fixes #2872.

The closest existing PRs (not duplicates):

Testing

This is a change to a template and a document only. No code paths change, so there are no new tests.

We did the test on a live deployment: Buzz Desktop v0.4.26 on macOS, relay deployed with deploy/compose and Caddy TLS.

  1. Deploy the relay with the unmodified template value. The join flow fails with the error Load failed.
  2. Add tauri://localhost,http://tauri.localhost to BUZZ_CORS_ORIGINS. Restart the relay.
  3. Do the join flow again. The desktop app joins the community correctly.

@nscheifler
nscheifler requested a review from a team as a code owner July 25, 2026 20:05
…NS default

A relay deployed from deploy/compose blocks the desktop app at CORS
preflight: the template allowlists only the public domain, but the
desktop webview runs from tauri://localhost (macOS/Linux) or
http://tauri.localhost (Windows). "Join an existing community" then
fails with WebKit's generic "Load failed" while curl/NIP-11 succeed.

Ship the webview origins in the template default, tell operators to
keep them, and document the requirement in deploy/compose/README.md.

Fixes block#2872
@nscheifler
nscheifler force-pushed the fix/compose-cors-tauri-origins branch from d799620 to 631a846 Compare July 25, 2026 20:12
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.

[Bug] deploy/compose: default BUZZ_CORS_ORIGINS omits Tauri webview origins — desktop "Join an existing community" fails with "Load failed"

1 participant