Skip to content

fix(build): declare fork env vars in turbo globalEnv - #71

Merged
JOY (JOY) merged 1 commit into
mainfrom
dev
Sep 12, 2026
Merged

JOY (JOY) merged 1 commit into
mainfrom
dev

Conversation

@JOY

@JOY JOY (JOY) commented Sep 12, 2026

Copy link
Copy Markdown

Turbo 2.x defaults to strict env mode and only forwards variables listed in globalEnv to the task process. Every fork-added variable was missing, so next-server saw them as undefined even though docker exec printenv showed them set inside the container. Confirmed on production: 9 of 10 container processes had OIDC_CLIENT_ID, and the one that did not was next-server - /api/auth/providers returned only credentials and email, with dos-id absent. This silently disabled DOS.Me SSO, the Brevo and Crove CRM sync webhooks, and the dos-org-sync webhook, and made the new DATABASE_SSL_REJECT_UNAUTHORIZED and SSRF_ALLOW_PRIVATE_IPS flags unreadable.


Note

Low Risk
Config-only change to Turbo env forwarding; no application logic is modified, but missing vars in this list would silently break auth and webhooks again.

Overview
Turbo 2.x only injects environment variables that appear in globalEnv, so fork-specific secrets were present in the container but undefined inside the Next.js server process.

This change registers fifteen missing variables in turbo.json globalEnv: OIDC/DOS.Me login (OIDC_*, NEXT_PUBLIC_DOS_ID_LOGIN_ENABLED), Brevo and Crove CRM/webhook credentials (BREVO_*, CROVE_*), org sync (DOS_SYNC_WEBHOOK_SECRET), plus DATABASE_SSL_REJECT_UNAUTHORIZED and SSRF_ALLOW_PRIVATE_IPS. After the fix, build/runtime tasks can read them so DOS.Me SSO, signed webhook handlers, and DB/SSRF toggles behave as configured in production.

Reviewed by Cursor Bugbot for commit ccf9b85. Configure here.

Summary by CodeRabbit

  • Chores
    • Expanded environment configuration tracking for build and task caching.

…e runtime

Turbo 2.x defaults to strict env mode, which only forwards variables listed in globalEnv to the task process. Every fork-added variable was missing, so the next-server process saw them as undefined even though docker exec printenv showed them set. That silently disabled DOS.Me SSO (the provider gate never passed), the Brevo and Crove CRM sync webhooks (isConfigured false), the dos-org-sync webhook (secret unset, so it failed closed), and made the new TLS and SSRF opt-out flags unreadable. Declares the OIDC, CROVE_, BREVO_, DOS_, webhook-secret, DATABASE_SSL_REJECT_UNAUTHORIZED, SSRF_ALLOW_PRIVATE_IPS and NEXT_PUBLIC_DOS_ID_LOGIN_ENABLED variables.
@cursor

cursor Bot commented Sep 12, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_c056b6f9-a942-459d-95dd-3b9212dff853)

@JOY
JOY (JOY) merged commit 9b308e3 into main Sep 12, 2026
28 checks passed

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request updates the turbo.json configuration file to include several new environment variables, including Brevo, Crove, OIDC, and database SSL settings. Since there are no review comments, I have no feedback to provide.

@coderabbitai

coderabbitai Bot commented Sep 12, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 70ee08a1-395a-40e3-b96e-412bca08dba1

📥 Commits

Reviewing files that changed from the base of the PR and between 867f650 and ccf9b85.

📒 Files selected for processing (1)
  • turbo.json

📝 Walkthrough

Walkthrough

The Turbo configuration adds fifteen environment variable names to globalEnv. Turbo task caching now tracks these variables as global dependencies.

Changes

Turbo environment tracking

Layer / File(s) Summary
Add global environment variables
turbo.json
Adds fifteen Brevo, Crove, database, DOS, OIDC, and SSRF-related variables to the Turbo globalEnv array.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev

Warning

Some tools did not complete. Review the errors below.

🔧 Biome (2.5.10)
turbo.json

Biome could not lint this file: configuration resulted in errors. Check the repository's Biome configuration and plugins.


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

Comment @coderabbitai help to get the list of available commands.

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