Repository navigation
feat(dev): read BUZZ_ settings from .env.local into the desktop launch environment - #2254
Merged
Merged
Conversation
…onment `just desktop` and `just desktop-bundle` now give Tauri, Cargo and the native app every BUZZ_ value Vite resolves from .env.local and its mode files. Process values still win, including an explicit empty value. Native build inputs such as BUZZ_BUILD_FEDERATED_IDENTITY_CONFIG were read only from the process environment, so a descriptor in .env.local was silently ignored and produced a non-FI build. Each launcher forwarded only BUZZ_DEV_VIEWER. Names without the BUZZ_ prefix stay out: .env.local can hold unrelated credentials, and agent processes remove only BUZZ_ and NOSTR_ names from the app's environment. Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Logan Johnson <loganj@squareup.com>
Vite expands $VAR even inside single quotes and also reads mode files. The native build reads only repository-root .env.local and keeps single-quoted dollars literal, so a launch value from Vite could silently override what Cargo and the frontend Builderlab reader already used. Parse .env.local with node:util parseEnv instead. The viewer pin keeps Vite's effective value, which is what the frontend uses. Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Logan Johnson <loganj@squareup.com>
Native dotenvy expands unquoted and double-quoted values; the launcher never does. Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Logan Johnson <loganj@squareup.com>
BUZZ_UPDATER_* stay process-environment only, as documented: a debug bundle must not register the updater from .env.local. Document that a .env.local value also beats a Vite mode file for the dev frontend, and that values follow parseEnv, not dotenvy. Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Logan Johnson <loganj@squareup.com>
loganj
marked this pull request as ready for review
November 3, 2026 20:07
kalvinnchau
approved these changes
Nov 3, 2026
kalvinnchau
left a comment
Contributor
There was a problem hiding this comment.
🤖 Reviewed; no actionable defects found. Launcher integration and environment-boundary checks passed, with passing JavaScript/Vitest CI at this head. Native desktop launch, Tauri/Cargo compilation through the launchers, and packaged OS environment inheritance remain unverified.
dr0uleau
added a commit
that referenced
this pull request
Nov 4, 2026
Co-authored-by: Codex <noreply@openai.com> * origin/main: (327 commits) feat(bestie): remove your Bestie, and let remote agents be Bestie after a warning (#2041) feat(messages): open the sender's profile from the byline name (#2253) feat(native-mcp): one-command launcher and MCP registration for agent driving (#2272) perf(composer): stop per-keystroke chip re-renders and reparses in long rich drafts (#2251) fix(agents): prevent history from forging prompt requests (#2223) Enable automatic key backup in preview releases (#2325) feat(read-state): n-blob NIP-RS sync with a 30-day floor, frontier only (#1286) feat(huddles): provide read-only huddleStatus for optional consumers (#2327) feat(search): show verified names in people search (#2322) Fix voice-note sending and restore waveform previews (#2283) Preserve Solo queued messages across restarts (#1704) feat(plugins): resolve attachment renderers by order, like panels and links (#2284) fix(channels): keep muted DM names from becoming bold (#2184) fix: command-click opening desktop message links in the browser (#2288) AIDA-2390: Explain oversized paste rejection (#2271) AIDA-2399: Make failed uploads easy to retry or remove (#2265) AIDA-2338: Keep sidebar headings readable at large sizes (#2263) chore(plugins): export added-tool types and clarify upload docs (#2292) feat(solo): open chats for community viewing (#2107) feat(dev): read BUZZ_ settings from .env.local into the desktop launch environment (#2254) ... Signed-off-by: Daniel Rouleau <drouleau@squareup.com> # Conflicts: # docs/browser-testing.md # docs/local-artifact-storage.md # src/app/services.ts # src/features/artifact-storage/service.test.ts # src/features/artifact-storage/service.ts # src/features/artifact-storage/store.ts # src/features/communities/service.ts # tests/browser/artifact-storage.spec.mjs # tests/integration/browser-ci.test.mjs
arividar
pushed a commit
to minniai/minni-buzz-app
that referenced
this pull request
Nov 4, 2026
…h environment (block#2254) 🤖 ## Summary - Settings in `.env.local` now reach the native desktop build. You can put the federated identity (FI, "sign in with your organization") deployment descriptor there, and plain `just desktop` produces an FI build. Before this change, you had to put it in front of every `just desktop` command. A descriptor in `.env.local` was ignored without a warning, and the result was a non-FI build: Settings → Identity showed no organization sign-in. - `just desktop` and `just desktop-bundle` now add every `BUZZ_`-prefixed value from the repository-root `.env.local` to the environment of Tauri, Cargo and the native app. A value set in the shell still wins, including an explicit empty value such as `BUZZ_DEV_VIEWER=`. ## Details - One helper, `launchEnvironment` in `scripts/desktop-config.mjs`, builds the environment for both launchers. It reads `.env.local` with Node's `parseEnv`, the same parser as the frontend's Builderlab URL reader: `$VAR` is never expanded, quoted or not, so a `$` in a URL or in the descriptor JSON stays as written. Like the native build, it ignores Vite's `.env` and mode files (`.env.development` and similar). Vite's own loader would have expanded `$VAR` even in single-quoted values and let mode files override `.env.local`, which would change values the native build already reads today. - Before this change, `desktop-dev.mjs` forwarded only `BUZZ_DEV_VIEWER`. It still passes the frontend's effective pin, from Vite's loader, to native agent starts. An unpinned launch still passes an explicit empty pin. - The Vite dev server inherits this environment, so in `just desktop` a `.env.local` value now also beats the same name in a Vite mode file for the frontend. Frontend and native therefore agree. - Only `BUZZ_` names are loaded, except the release-only `BUZZ_UPDATER_*` inputs, which stay process-environment only. `.env.local` can hold unrelated credentials. Agent processes remove only `BUZZ_` and `NOSTR_` names from the app's environment (`src-tauri/src/host_process.rs`), so other names would reach them. `BUZZ_` values do reach some of the app's child processes, so they must stay public configuration, as the configuration docs already require. - Direct `pnpm tauri build` and `cargo` runs do not change. Release builds still supply their inputs through the process environment. - `docs/configuration.md` describes the launch environment. `.env.example` shows an FI descriptor line. Example `.env.local` for the Block deployment: ```sh BUZZ_DEV_VIEWER= BUZZ_BUILDERLAB_URL= BUZZ_BUILD_FEDERATED_IDENTITY_CONFIG='{"version":1,"id":"bb-block",...}' ``` 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Logan Johnson <loganj@squareup.com> Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖
Summary
.env.localnow reach the native desktop build. You can put the federated identity (FI, "sign in with your organization") deployment descriptor there, and plainjust desktopproduces an FI build. Before this change, you had to put it in front of everyjust desktopcommand. A descriptor in.env.localwas ignored without a warning, and the result was a non-FI build: Settings → Identity showed no organization sign-in.just desktopandjust desktop-bundlenow add everyBUZZ_-prefixed value from the repository-root.env.localto the environment of Tauri, Cargo and the native app. A value set in the shell still wins, including an explicit empty value such asBUZZ_DEV_VIEWER=.Details
launchEnvironmentinscripts/desktop-config.mjs, builds the environment for both launchers. It reads.env.localwith Node'sparseEnv, the same parser as the frontend's Builderlab URL reader:$VARis never expanded, quoted or not, so a$in a URL or in the descriptor JSON stays as written. Like the native build, it ignores Vite's.envand mode files (.env.developmentand similar). Vite's own loader would have expanded$VAReven in single-quoted values and let mode files override.env.local, which would change values the native build already reads today.desktop-dev.mjsforwarded onlyBUZZ_DEV_VIEWER. It still passes the frontend's effective pin, from Vite's loader, to native agent starts. An unpinned launch still passes an explicit empty pin.just desktopa.env.localvalue now also beats the same name in a Vite mode file for the frontend. Frontend and native therefore agree.BUZZ_names are loaded, except the release-onlyBUZZ_UPDATER_*inputs, which stay process-environment only..env.localcan hold unrelated credentials. Agent processes remove onlyBUZZ_andNOSTR_names from the app's environment (src-tauri/src/host_process.rs), so other names would reach them.BUZZ_values do reach some of the app's child processes, so they must stay public configuration, as the configuration docs already require.pnpm tauri buildandcargoruns do not change. Release builds still supply their inputs through the process environment.docs/configuration.mddescribes the launch environment..env.exampleshows an FI descriptor line.Example
.env.localfor the Block deployment:BUZZ_DEV_VIEWER= BUZZ_BUILDERLAB_URL= BUZZ_BUILD_FEDERATED_IDENTITY_CONFIG='{"version":1,"id":"bb-block",...}'🤖 Generated with Claude Code