refactor: nuxt config split and project config polish#60
Conversation
📝 WalkthroughWalkthroughThe PR updates project configuration and environment setup: environment variable examples now omit sensitive defaults (admin credentials, JWT secret), debug flags are annotated with ChangesConfiguration and Setup Updates
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Review rate limit: 4/5 reviews remaining, refill in 12 minutes. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
nuxt.config.ts (1)
5-57:⚠️ Potential issue | 🟠 Major | ⚡ Quick winRemove hardcoded auth fallbacks from
runtimeConfig.
adminUsername,adminPassword, andjwtSecretstill have fixed defaults. If env vars are missing, the app silently falls back to predictable credentials/signing secret, which is a production security risk.Suggested change
runtimeConfig: { - adminPassword: '123', - adminUsername: 'admin', - jwtSecret: 'tryUJ0zQbstPbTOrezme+Fv+KndzDNRx5lmSeelr2ial2/2yV8HqLeQ2felJafqf', + adminPassword: '', + adminUsername: '', + jwtSecret: '',Also add a startup/auth-path guard that throws when these values are empty, so misconfiguration fails fast instead of weakening auth. As per coding guidelines: “Runtime env vars configured via
.envfile.”🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@nuxt.config.ts` around lines 5 - 57, Replace the hardcoded fallbacks in configBase.runtimeConfig (adminUsername, adminPassword, jwtSecret) so they are sourced from environment variables (e.g., process.env.ADMIN_USERNAME, process.env.ADMIN_PASSWORD, process.env.JWT_SECRET) instead of fixed literals; do not supply predictable defaults. Add a startup guard (e.g., a small validate function invoked when exporting the Nuxt config or in a top-level init step) that checks configBase.runtimeConfig.adminUsername, adminPassword and jwtSecret and throws an error if any are missing/empty to fail fast on misconfiguration. Ensure you update references to runtimeConfig in the export so the values flow correctly into Nuxt at runtime.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@nuxt.config.ts`:
- Around line 5-57: Replace the hardcoded fallbacks in configBase.runtimeConfig
(adminUsername, adminPassword, jwtSecret) so they are sourced from environment
variables (e.g., process.env.ADMIN_USERNAME, process.env.ADMIN_PASSWORD,
process.env.JWT_SECRET) instead of fixed literals; do not supply predictable
defaults. Add a startup guard (e.g., a small validate function invoked when
exporting the Nuxt config or in a top-level init step) that checks
configBase.runtimeConfig.adminUsername, adminPassword and jwtSecret and throws
an error if any are missing/empty to fail fast on misconfiguration. Ensure you
update references to runtimeConfig in the export so the values flow correctly
into Nuxt at runtime.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 3cfa1b67-993b-4679-a2c2-3624efe1cd04
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml,!pnpm-lock.yaml
📒 Files selected for processing (4)
.env.exampledocs/setup-local.mdnuxt.config.tspackage.json
💤 Files with no reviewable changes (1)
- docs/setup-local.md
Summary by CodeRabbit
Configuration
falseinstead oftruein configuration examples.Documentation
Refactor