Uh oh!
There was an error while loading. Please reload this page.
feat(shared): decompose SMTP_CONNECTION_URL into individual env vars - #1002
Conversation
This comment has been minimized.
This comment has been minimized.
Caution Review failedPull request was closed or merged during review WalkthroughThis PR introduces support for configuring SMTP via individual environment variables (SMTP_HOST, SMTP_PORT, SMTP_USERNAME, SMTP_PASSWORD) as an alternative to SMTP_CONNECTION_URL. A new utility function constructs SMTP connection URLs from individual variables when the monolithic connection string is unavailable. Documentation and email-sending code paths are updated accordingly. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes Possibly related PRs
🚥 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)
📝 Coding Plan
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 |
Add support for configuring SMTP via individual environment variables (SMTP_HOST, SMTP_PORT, SMTP_USERNAME, SMTP_PASSWORD) similar to how DATABASE_URL can be decomposed. Create getSMTPConnectionURL() helper in new smtp.ts module that constructs the connection URL, maintaining backward compatibility with SMTP_CONNECTION_URL. Update entrypoint.sh, auth.ts, and actions.ts to use the new helper. Decomposition is supported both at the shell level (entrypoint.sh) and TypeScript level (smtp.ts). Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
b1f4b9b to
cafbb23Compare… decomposed vars Move SMTP URL construction entirely into getSMTPConnectionURL() in TypeScript. When using decomposed env vars, all four (SMTP_HOST, SMTP_PORT, SMTP_USERNAME, SMTP_PASSWORD) are now required. Logs an error listing missing vars if incomplete. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
Add support for configuring SMTP via individual environment variables (SMTP_HOST, SMTP_PORT, SMTP_USERNAME, SMTP_PASSWORD) as an alternative to providing the full SMTP_CONNECTION_URL. This mirrors how DATABASE_URL can be decomposed into separate components.
Changes
packages/shared/src/smtp.tswithgetSMTPConnectionURL()helper that constructs the connection URL, maintaining backward compatibilitypackages/shared/src/env.server.tsto define the new SMTP environment variablesentrypoint.shto support SMTP URL construction at the shell levelpackages/web/src/auth.tsandpackages/web/src/actions.tsto use the new helper functionFixes SOU-637
Summary by CodeRabbit
New Features
Documentation