Skip to content

Migrate secrets to Fnox (replace .env.submit + optional .env) #51

@sm17p

Description

@sm17p

Summary

Adopt the fnox CLI for secret injection and profiles. Migrate sensitive variables from .env.submit (Chrome Web Store / Firefox AMO publish credentials) and optional .env (e.g. WXT_GA_API_SECRET for the WXT build) so secrets can be encrypted in fnox.toml (or provider-backed) instead of local dotenv files.

Background

  • WXT exposes only WXT_* / VITE_* to import.meta.env (WXT env docs). Example: WXT_GA_API_SECRET in src/app.config.ts.
  • .env.submit is for store submission (CHROME_*, FIREFOX_*, etc.) — not bundled in the extension; consumed by submit/CI tooling. It is gitignored (.env*).
  • Fnox injects env via fnox exec -- <command> or shell integration; use profiles (e.g. dev vs submit/production) per Fnox profiles.

Proposed work

  1. Install fnox, fnox init, optional age encryption; optionally pin CLI in mise.toml.
  2. Inventory: map .env.submit keys vs WXT_* build vars; assign Fnox profiles (e.g. submit for store creds, default/dev for GA).
  3. Migrate: fnox set per profile; configure FNOX_IF_MISSING for CI (env reference).
  4. Scripts: wrap submit/release and dev/build commands with fnox exec --profile … -- or document fnox activate for shells.
  5. CI: add FNOX_AGE_KEY / FNOX_AGE_KEY_FILE; run submit/build with the right profile.
  6. Docs: AGENTS.md + update .cursor/skills/ if package.json scripts or release steps change (skill maintenance).
  7. Cleanup: stop relying on a populated local .env.submit; optional .env.example with names only.

Verification

  • Submit flow gets the same env names as before via Fnox.
  • pnpm build / pnpm dev still receive WXT_GA_API_SECRET when required.
  • E2E unchanged (CI only unless we add vars).
  • Zips do not leak submit secrets (wxt.config already excludes *.env*).

Risks

  • Contributor onboarding: document Fnox vs optional .env.example.
  • Avoid dual maintenance of .env.submit and Fnox after migration.
  • If .env.submit was ever exposed, rotate store credentials at Google/Mozilla.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions