Skip to content

fix: remove defaults for CODER_EMAIL_ options #15482

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 11 commits into from

Conversation

DanielleMaywood
Copy link
Contributor

Fixes #15480

The defaults in $CODER_EMAIL_SMARTHOST, $CODER_EMAIL_HELLO, and $CODER_EMAIL_FORCE_TLS override values set with the (now deprecated) $CODER_NOTIFICATIONS_EMAIL_SMARTHOST, $CODER_NOTIFICATIONS_EMAIL_HELLO, and $CODER_NOTIFICATIONS_EMAIL_FORCE_TLS environment variables.

This fixes that by removing the defaults. The defaults are helpful for local dev setups but for any serious deployment these will likely be changed anyways so this shouldn't cause any issues for customers existing deployments.

@DanielleMaywood DanielleMaywood force-pushed the dm-fix-defaults-notifications branch from 738dceb to 19398cc Compare November 12, 2024 13:44
@DanielleMaywood
Copy link
Contributor Author

If coder/serpent#23 gets merged (and released), this would fix the issue encountered here.

@DanielleMaywood DanielleMaywood marked this pull request as ready for review November 13, 2024 10:24
Copy link
Contributor

@dannykopping dannykopping left a comment

Choose a reason for hiding this comment

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

Thanks for this! A couple minor points but otherwise LGTM.

@@ -1038,7 +1037,6 @@ when required by your organization's security policy.`,
Description: "The hostname identifying the SMTP server.",
Flag: "email-hello",
Env: "CODER_EMAIL_HELLO",
Default: "localhost",
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can keep this one. This will break existing installations if not explicitly defined.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm happy to do this although an issue with keeping this one is if someone has set CODER_NOTIFICATIONS_EMAIL_HELLO then we will be changing it back to "localhost" for them.

Copy link
Contributor

Choose a reason for hiding this comment

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

If we wait until coder/serpent#23 is merged then that won't be the case, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

correct

Copy link
Member

Choose a reason for hiding this comment

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

I managed to solve the only open question I had for coder/serpent#23 and I'm pretty happy with it. We've increased test coverage and all coder/coder tests are passing.

Basically just waiting for an approve, so do you want to go ahead with this PR @DanielleMaywood or do we go with coder/serpent#23? I didn't review yet, but if you want this merged I can do a quick review.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we go with coder/serpent#23 first, as that is a prerequisite to get this to behave how we want.

Copy link
Member

Choose a reason for hiding this comment

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

PS. Another neat change in 23 is that you can define the same default on both the current and the deprecated option (should help with docs), and if they diverge it'll be detected as an error.

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like you have two reviewers for that PR already, but do shout if need another 👍

@DanielleMaywood
Copy link
Contributor Author

Closing as scope changed. #15476 has fixed the original issue here (by updating to a new version of coder/serpent).

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.

CODER_NOTIFICATIONS_EMAIL_SMARTHOST's value is never used
3 participants