chore(env): harmonize example env files and fix OSV findings#142
chore(env): harmonize example env files and fix OSV findings#142gaboesquivel merged 2 commits intomainfrom
Conversation
- Add env-files cursor rule, block-secret-files/gitleaks/trufflehog patterns - API: .env.defaults.example, .env.test.example; remove .env-sample - Web/mobile/docu: aligned .env.*.example and docs - pnpm overrides + @next/eslint-plugin-next for flatted, h3, next, socket.io-parser, undici
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (3)
WalkthroughThis PR standardizes environment file naming conventions across the monorepo by introducing a new Cursor rule that enforces Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
.trufflehogignore (1)
11-13: Pattern is redundant but adds clarity.The new pattern
.*\.env\.[^/]+\.example$is technically redundant with the existing.*\.example$pattern on line 11, which already matches any file ending in.example. However, keeping the explicit pattern documents the intended convention for env templates, so this is acceptable.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.trufflehogignore around lines 11 - 13, The pattern ".*\.env\.[^/]+\.example$" is redundant because ".*\.example$" already matches any file ending in ".example"; either remove the redundant pattern to simplify the file or keep it but add an inline comment clarifying it's intentionally explicit for env template files; update the .trufflehogignore so it contains only ".*\.example$" (if removing) or keep both and add a comment like "# explicit env template pattern" next to ".*\.env\.[^/]+\.example$" to document intent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/web/README.md`:
- Line 98: The README references a non-existent `.env.local.example`; fix by
either adding a `.env.local.example` in apps/web containing example keys and
default values matching the schema in lib/env.ts (use the variable names and
expected formats from lib/env.ts) or edit apps/web/README.md to remove the
reference and instead point to lib/env.ts for the required environment variables
and examples; update the README line "Optional environment variables (see
`.env.local.example`):" to either reference the new example file or to say "see
lib/env.ts" so developers know where to find the env schema.
In `@docs/plans/env-file-harmonization.md`:
- Line 62: The documentation contains an absolute local path
"/home/gabo/code/vencura" which is machine-specific and should be removed;
update the reference implementation line to use a relative or generic path
(e.g., "repo-root" or "<your-repo-path>") and keep the file references
(apps/api/.env.defaults.example, .cursor/rules/base/env-files.mdc,
scripts/block-secret-files.mjs, web/mathler/mobile docu env files) so the
reference is portable and no local environment details are exposed.
In `@scripts/README.md`:
- Line 72: The .trufflehogignore file currently contains overbroad patterns
'.*\.example$' and '.*\.sample$' that exclude any .example/.sample files (not
just .env variants); remove those two catch-all patterns from .trufflehogignore
and instead explicitly allow only the intended env exceptions referenced in
README.md (the specific entries for .env.<qualifier>.example, .env.schema, and
.env.{development,staging,production,test}), then update .trufflehogignore so it
only lists those explicit .env variants and ensure README.md line mentioning
`.env` exceptions remains consistent with the tightened ignore rules.
---
Nitpick comments:
In @.trufflehogignore:
- Around line 11-13: The pattern ".*\.env\.[^/]+\.example$" is redundant because
".*\.example$" already matches any file ending in ".example"; either remove the
redundant pattern to simplify the file or keep it but add an inline comment
clarifying it's intentionally explicit for env template files; update the
.trufflehogignore so it contains only ".*\.example$" (if removing) or keep both
and add a comment like "# explicit env template pattern" next to
".*\.env\.[^/]+\.example$" to document intent.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 7c244ad2-3d2b-407d-a272-790d6d8347ba
⛔ Files ignored due to path filters (12)
apps/api/.env-sampleis excluded by!**/.env*apps/api/.env.defaults.exampleis excluded by!**/.env*apps/api/.env.test.exampleis excluded by!**/.env*apps/docu/.env.defaults.exampleis excluded by!**/.env*apps/docu/.env.developmentis excluded by!**/.env*apps/mobile/.env.defaults.exampleis excluded by!**/.env*apps/mobile/.env.exampleis excluded by!**/.env*apps/web/.env.developmentis excluded by!**/.env*apps/web/.env.local.exampleis excluded by!**/.env*apps/web/.env.productionis excluded by!**/.env*apps/web/.env.stagingis excluded by!**/.env*pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml,!**/pnpm-lock.yaml
📒 Files selected for processing (15)
.cursor/rules/base/env-files.mdc.gitleaks.toml.trufflehogignoreapps/api/README.mdapps/docu/content/docs/architecture/security.mdxapps/docu/content/docs/development/index.mdxapps/docu/package.jsonapps/mobile/README.mdapps/web/README.mdapps/web/package.jsondocs/plans/env-file-harmonization.mdpackage.jsonscripts/README.mdscripts/block-secret-files.mjstools/eslint/package.json
- Restrict .trufflehogignore to committed env template paths - Align scripts/README with block-secret-files and TruffleHog - Clarify apps/web README env docs; remove docs/plans plan file
Summary by CodeRabbit
Documentation
Chores