镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

feat(dev): read BUZZ_ settings from .env.local into the desktop launch environment - #2254

Merged
loganj merged 4 commits into
mainfrom
loganj/env-local-build-inputs
Nov 3, 2026
Merged

loganj merged 4 commits into
mainfrom
loganj/env-local-build-inputs

Conversation

@loganj

@loganj loganj commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

🤖

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:

BUZZ_DEV_VIEWER=
BUZZ_BUILDERLAB_URL=
BUZZ_BUILD_FEDERATED_IDENTITY_CONFIG='{"version":1,"id":"bb-block",...}'

🤖 Generated with Claude Code

loganj and others added 4 commits November 3, 2026 08:35
…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
loganj marked this pull request as ready for review November 3, 2026 20:07
@loganj
loganj requested a review from a team as a code owner November 3, 2026 20:07

@kalvinnchau kalvinnchau left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 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.

@loganj
loganj merged commit f5c0dd0 into main Nov 3, 2026
40 checks passed
@loganj
loganj deleted the loganj/env-local-build-inputs branch November 3, 2026 20:51
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>
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.

2 participants