fix(deploy): add Tauri webview origins to the compose BUZZ_CORS_ORIGINS default - #2888
fix(deploy): add Tauri webview origins to the compose BUZZ_CORS_ORIGINS default#2888nscheifler wants to merge 1 commit into
Conversation
…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
d799620 to
631a846
Compare
|
Independently hit this on Desktop 0.5.0 (report above was 0.4.26) and can confirm the fix. One addition: the impact is broader than "Join an existing community" — it also breaks invite minting from the desktop app.
Concrete symptom, with Preflight returns 200 but omits |
Summary
The compose template
deploy/compose/.env.examplesetsBUZZ_CORS_ORIGINSto one public domain. The webview of the desktop app has a different origin. The origin istauri://localhoston macOS and Linux. The origin ishttp://tauri.localhoston Windows.The relay reads
BUZZ_CORS_ORIGINSas a comma-separated list of exact origins (crates/buzz-relay/src/config.rs;build_cors_layerincrates/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 fromcurl. Thus the relay seems healthy, and the CORS cause is hard to find.This change:
BUZZ_CORS_ORIGINSindeploy/compose/.env.example.deploy/compose/README.md.Related issue
Fixes #2872.
The closest existing PRs (not duplicates):
BUZZ_CORS_ORIGINSto the root.env.example. It does not change the value in the compose template. The two changes are compatible.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/composeand Caddy TLS.Load failed.tauri://localhost,http://tauri.localhosttoBUZZ_CORS_ORIGINS. Restart the relay.