Skip to content

Keep .env.local and VITE_* variables out of the site build - #52

Merged
nimble-turtle merged 1 commit into
mainfrom
dev/signed-build-env-local-ed27c3
Nov 25, 2026
Merged

nimble-turtle merged 1 commit into
mainfrom
dev/signed-build-env-local-ed27c3

Conversation

@nimble-turtle

Copy link
Copy Markdown
Contributor

The signed build and the deploy's build must match byte for byte, but VITE_DEBUG came from an untracked .env.local on the signing machine and from the server's environment, so they matched only by coincidence. vite build now ignores .env files and VITE_* variables and pins VITE_DEBUG to "false", like the offline build; yarn dev still reads .env.local. Tested with a new vite.config.test.ts, the full suite, typecheck and lint, and by building locally with no .env.local and with hostile .env.local and shell values: both reproduce all 51 files of the current signed manifest, so no re-sign is needed.

Signing builds on the signing laptop and the deploy builds again, and the
two must match byte for byte. VITE_DEBUG came from the laptop's untracked
.env.local and from the server's environment, which matched only by
coincidence; a build without it turned on debug logging and matched no
signature. vite build now reads no .env file and no VITE_* variable and
pins VITE_DEBUG to "false", as the offline build already does. yarn dev
still reads .env.local.

A clean build and one with hostile .env.local and shell values both
reproduce the current signed manifest exactly, so no re-sign is needed.
@coderabbitai

coderabbitai Bot commented Nov 25, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 57 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 91269de6-16d8-4319-8e79-208423a487c8
Commits

Reviewing files that changed from the base of the PR and between 90be6c1 and 3ec83b8.

Files selected for processing: 6

  • .env.local.example
  • AGENTS.md
  • README.md
  • lib/log.ts
  • vite.config.mts
  • vite.config.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@nimble-turtle
nimble-turtle enabled auto-merge (squash) November 25, 2026 21:21
@nimble-turtle
nimble-turtle merged commit 264bcac into main Nov 25, 2026
2 checks passed
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