fix(worker): forward DATABASE_SSL and DATABASE_CA_CERT to worker containers#992
Merged
zbigniewsobiecki merged 1 commit intodevfrom Mar 23, 2026
Merged
Conversation
…ainers Worker containers were missing DATABASE_SSL and DATABASE_CA_CERT env vars, causing `self-signed certificate in certificate chain` SSL errors during loadConfig() at worker startup. The router had DATABASE_SSL=false set but buildWorkerEnvWithProjectId() only forwarded DATABASE_URL, so workers always defaulted to rejectUnauthorized: true. Also extracts all optional env-var forwarding into appendOptionalEnvVars() to fix a pre-existing noExcessiveCognitiveComplexity lint warning that our new if-branches pushed over the threshold. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
buildWorkerEnvWithProjectId()forwardedDATABASE_URLbut notDATABASE_SSL/DATABASE_CA_CERT, so every worker container started withrejectUnauthorized: trueregardless of the router's SSL config — causingself-signed certificate in certificate chaincrashes duringloadConfig()at worker startup.SENTRY_DSN,CLAUDE_CODE_OAUTH_TOKEN, etc.appendOptionalEnvVars()helper to resolve a pre-existingnoExcessiveCognitiveComplexitylint warning (score was 15, now 16 with our additions — extracting to a helper drops the main function to ~9).Call chain fixed
Test plan
forwards DATABASE_SSL when set,omits DATABASE_SSL when not set,forwards DATABASE_CA_CERT when setnpm test)npm run lint— no warningsnpm run typecheck— cleanself-signed certificateSentry event fires[Worker] Loaded projects configshould appear (indicatingloadConfig()succeeded)🤖 Generated with Claude Code