Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

unckleg
Copy link

@unckleg unckleg commented Sep 17, 2025

✅ Checklist

  • I have followed every step in the contributing guide
  • The PR title follows the convention.
  • I ran and tested the code works

Testing

  1. Set up fresh v4-beta self-hosted deployment using docker-compose
  2. Configured .env with EMAIL_TRANSPORT=resend and valid Resend API key
  3. Before fix: Magic links appeared in docker logs, no emails received
  4. After fix: Magic links sent successfully via email
  5. Tested with both Resend and SMTP configurations
  6. Verified WHITELISTED_EMAILS properly restricts login access
  7. Confirmed GitHub OAuth works when AUTH_GITHUB variables are set

Changelog

Added missing environment variables to webapp service in docker-compose.yml:

  • Email transport configuration (EMAIL_TRANSPORT, FROM_EMAIL, REPLY_TO_EMAIL, RESEND_API_KEY)
  • SMTP configuration variables (commented by default)
  • Authentication variables (WHITELISTED_EMAILS, ADMIN_EMAILS, AUTH_GITHUB_CLIENT_ID/SECRET)
  • Slack integration variables (ORG_SLACK_INTEGRATION_CLIENT_ID/SECRET)
  • Alert email configuration (ALERT_FROM_EMAIL)

Screenshots

…pp service

Email configuration was silently failing because critical environment variables
were not being passed from .env to the webapp container, causing magic links
to be logged to console instead of sent via email.
Copy link

changeset-bot bot commented Sep 17, 2025

⚠️ No Changeset found

Latest commit: bf1bd83

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

coderabbitai bot commented Sep 17, 2025

Walkthrough

Added multiple environment variables to the webapp service in hosting/docker/webapp/docker-compose.yml for auth, email, Slack integration, and SMTP configuration: WHITELISTED_EMAILS, ADMIN_EMAILS, AUTH_GITHUB_CLIENT_ID, AUTH_GITHUB_CLIENT_SECRET, EMAIL_TRANSPORT, FROM_EMAIL, REPLY_TO_EMAIL, RESEND_API_KEY, SMTP_HOST, SMTP_PORT, SMTP_SECURE, SMTP_USER, SMTP_PASSWORD, ORG_SLACK_INTEGRATION_CLIENT_ID, ORG_SLACK_INTEGRATION_CLIENT_SECRET, ALERT_FROM_EMAIL. Retained INTERNAL_OTEL_TRACE_LOGGING_ENABLED with whitespace adjustment. Added a trailing newline at the end of the file.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title accurately and concisely summarizes the primary change—adding missing email and authentication environment variables to the webapp Docker service—and uses the conventional scope prefix "fix(docker)". The wording is relevant to the changeset and clear to reviewers; the trailing "
Description Check ✅ Passed The PR description closely follows the repository template by providing the checklist, detailed testing steps with results, and a clear changelog describing the added environment variables. It does omit the leading "Closes #" line from the template and leaves the Screenshots section empty, but the provided testing details and changelog make the description sufficiently informative for review.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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 and usage tips.

@unckleg unckleg changed the title fix(docker): add missing email and auth environment variables to webpp fix(docker): add missing email and auth environment variables to webapp | selfhoster Sep 17, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (5)
hosting/docker/webapp/docker-compose.yml (5)

79-79: Trim trailing whitespace.

There’s trailing whitespace at the end of Line 79.

-      INTERNAL_OTEL_TRACE_LOGGING_ENABLED: ${INTERNAL_OTEL_TRACE_LOGGING_ENABLED:-0}      
+      INTERNAL_OTEL_TRACE_LOGGING_ENABLED: ${INTERNAL_OTEL_TRACE_LOGGING_ENABLED:-0}

80-84: Quote list/secret envs to avoid YAML edge cases; confirm unset behavior.

  • Quoting prevents YAML from misinterpreting comma/boolean-like values and keeps empty values as empty strings.
  • Please confirm the app behavior when WHITELISTED_EMAILS/ADMIN_EMAILS are unset or empty (deny-all vs allow-all).
-      WHITELISTED_EMAILS: ${WHITELISTED_EMAILS}
-      ADMIN_EMAILS: ${ADMIN_EMAILS}
-      AUTH_GITHUB_CLIENT_ID: ${AUTH_GITHUB_CLIENT_ID}
-      AUTH_GITHUB_CLIENT_SECRET: ${AUTH_GITHUB_CLIENT_SECRET}
+      WHITELISTED_EMAILS: "${WHITELISTED_EMAILS}"
+      ADMIN_EMAILS: "${ADMIN_EMAILS}"
+      AUTH_GITHUB_CLIENT_ID: "${AUTH_GITHUB_CLIENT_ID}"
+      AUTH_GITHUB_CLIENT_SECRET: "${AUTH_GITHUB_CLIENT_SECRET}"

85-96: Mail config: quote values; reconcile “commented by default” claim for SMTP.

  • Quoting helps with numeric/boolean/env-substitution parsing (SMTP_PORT/SMTP_SECURE).
  • PR description says SMTP vars are “commented by default,” but they are active here. Either comment them out or update the PR text.

Quote values:

-      EMAIL_TRANSPORT: ${EMAIL_TRANSPORT}
-      FROM_EMAIL: ${FROM_EMAIL}
-      REPLY_TO_EMAIL: ${REPLY_TO_EMAIL}
-      RESEND_API_KEY: ${RESEND_API_KEY}
-      SMTP_HOST: ${SMTP_HOST}
-      SMTP_PORT: ${SMTP_PORT}
-      SMTP_SECURE: ${SMTP_SECURE}
-      SMTP_USER: ${SMTP_USER}
-      SMTP_PASSWORD: ${SMTP_PASSWORD}
+      EMAIL_TRANSPORT: "${EMAIL_TRANSPORT}"
+      FROM_EMAIL: "${FROM_EMAIL}"
+      REPLY_TO_EMAIL: "${REPLY_TO_EMAIL}"
+      RESEND_API_KEY: "${RESEND_API_KEY}"
+      SMTP_HOST: "${SMTP_HOST}"
+      SMTP_PORT: "${SMTP_PORT}"
+      SMTP_SECURE: "${SMTP_SECURE}"
+      SMTP_USER: "${SMTP_USER}"
+      SMTP_PASSWORD: "${SMTP_PASSWORD}"

If you want SMTP vars commented by default (per PR text), apply:

-      SMTP_HOST: "${SMTP_HOST}"
-      SMTP_PORT: "${SMTP_PORT}"
-      SMTP_SECURE: "${SMTP_SECURE}"
-      SMTP_USER: "${SMTP_USER}"
-      SMTP_PASSWORD: "${SMTP_PASSWORD}"
+#     SMTP_HOST: "${SMTP_HOST}"
+#     SMTP_PORT: "${SMTP_PORT}"
+#     SMTP_SECURE: "${SMTP_SECURE}"
+#     SMTP_USER: "${SMTP_USER}"
+#     SMTP_PASSWORD: "${SMTP_PASSWORD}"

97-100: Slack/Auth alert vars: confirm exact names and optionality.

Please verify the app reads these exact keys and that leaving them unset won’t block boot.

-      ORG_SLACK_INTEGRATION_CLIENT_ID: ${ORG_SLACK_INTEGRATION_CLIENT_ID}
-      ORG_SLACK_INTEGRATION_CLIENT_SECRET: ${ORG_SLACK_INTEGRATION_CLIENT_SECRET}
-      ALERT_FROM_EMAIL: ${ALERT_FROM_EMAIL}
+      ORG_SLACK_INTEGRATION_CLIENT_ID: "${ORG_SLACK_INTEGRATION_CLIENT_ID}"
+      ORG_SLACK_INTEGRATION_CLIENT_SECRET: "${ORG_SLACK_INTEGRATION_CLIENT_SECRET}"
+      ALERT_FROM_EMAIL: "${ALERT_FROM_EMAIL}"

80-101: Consider env_file or template doc updates for DX and safety.

  • With many envs, using an env_file (plus a committed .env.example) improves setup and reduces churn in compose.
  • Also add short docs indicating which vars are required vs optional per transport/provider.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9c08764 and bf1bd83.

📒 Files selected for processing (1)
  • hosting/docker/webapp/docker-compose.yml (2 hunks)
🔇 Additional comments (1)
hosting/docker/webapp/docker-compose.yml (1)

242-242: No-op formatting change looks fine.

EOF newline/name entry change is harmless.

@nicktrn
Copy link
Collaborator

nicktrn commented Sep 18, 2025

Thanks @unckleg - did you test what happens when people don't set these in their .env?

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.

2 participants