Hotfix: forward OAuth env vars from .env to the app container#16
Conversation
There was a problem hiding this comment.
rainxchzed has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ✨ 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 |
Production app boots in a crash loop after #15 merged:
validateProductionEnvrejects the deploy becauseOAUTH_CLIENT_ID,OAUTH_CLIENT_SECRET,OAUTH_SERVICE_TOKEN,OAUTH_SERVICE_ALLOWED_HOSTS, andOAUTH_WEB_CALLBACK_URLare missing from the container's environment — even though they exist in/opt/github-store-backend/.env.Root cause:
docker-compose.prod.ymluses an explicitenvironment:map per-service (notenv_file:).${VAR}substitution at compose-parse-time only inlines variables that are listed in the map. PR #15 added the 5 new env vars tovalidateProductionEnv+.env.examplebut not to the prod compose file.This hotfix:
GITHUB_OAUTH_CLIENT_IDmapping withOAUTH_CLIENT_ID(renamed in Real auth: /v1/oauth/{state,exchange,handoff/{id}} with PKCE-S256, S2S guard, atomic getDel #15)appservice'senvironment:blockOAUTH_CLEANUP_DISABLEDkill-switch passthrough (${OAUTH_CLEANUP_DISABLED:-}so an empty.envline is fine)Dev
docker-compose.ymlintentionally untouched —APP_ENV != productionthere, sovalidateProductionEnvis a no-op and the legacy minimal env config still works for local dev.Verification
Empty because the laptop has no
.env; on the VPS those slots fill from/opt/github-store-backend/.env.After this lands and auto-deploy fires, the app boots once the operator restarts the container with
--force-recreate(or the deploy workflow does that automatically by virtue of compose detecting the file change).