Skip to content
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

feat(alerting): make authentication optional for email provider #608

Merged
merged 7 commits into from
Nov 4, 2023
Merged

feat(alerting): make authentication optional for email provider #608

merged 7 commits into from
Nov 4, 2023

Conversation

calvinhenderson
Copy link
Contributor

Summary

#607

Checklist

  • Tested and/or added tests to validate that the changes work as intended, if applicable.
  • Updated documentation in README.md, if applicable.

@calvinhenderson
Copy link
Contributor Author

I noticed an issue where emails are rejected when using a non-local smtp server due to the from hostname being set to localhost. I updated the gomail.Dialer initialization to set the LocalName attribute to the From domain when disabling auth. This resolved the issue and email alerts are now working correctly utilizing the Gmail SMTP relay.

README.md Outdated
| `alerting.email.host` | Host of the mail server (e.g. `smtp.gmail.com`) | Required `""` |
| `alerting.email.port` | Port the mail server is listening to (e.g. `587`) | Required `0` |
| `alerting.email.to` | Email(s) to send the alerts to | Required `""` |
| `alerting.email.disable-authentictaion` | Disables authentication. Useful for SMTP relays using IP-based authentication | `false` |
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
| `alerting.email.disable-authentictaion` | Disables authentication. Useful for SMTP relays using IP-based authentication | `false` |
| `alerting.email.disable-authentication` | Disables authentication. Useful for SMTP relays using IP-based authentication | `false` |

Copy link
Owner

Choose a reason for hiding this comment

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

Is this really necessary though? Could we not just check if alerting.email.password is blank, and if it is, assume that the authn is disabled?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, I suggested that as an alternative in #607. I just wasn’t sure if that should be the default behavior. If you’re okay with that being the case then I can change it!

@TwiN TwiN changed the title feat: make authentication optional for email alert provider feat(alerting): make authentication optional for email provider Nov 3, 2023
@TwiN TwiN added the area/alerting Related to alerting label Nov 3, 2023
@codecov-commenter
Copy link

codecov-commenter commented Nov 4, 2023

Codecov Report

Attention: 13 lines in your changes are missing coverage. Please review.

Comparison is base (c6515c4) 79.31% compared to head (45e8e3e) 79.10%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #608      +/-   ##
==========================================
- Coverage   79.31%   79.10%   -0.21%     
==========================================
  Files          58       58              
  Lines        4650     4662      +12     
==========================================
  Hits         3688     3688              
- Misses        780      792      +12     
  Partials      182      182              
Files Coverage Δ
alerting/provider/email/email.go 57.14% <7.14%> (-11.83%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@TwiN TwiN merged commit de7256e into TwiN:master Nov 4, 2023
2 checks passed
@TwiN
Copy link
Owner

TwiN commented Nov 4, 2023

Excellent work @calvinhenderson, thank you for contributing!

MelvinTo added a commit to MelvinTo/gatus that referenced this pull request Nov 10, 2023
* 'master' of https://github.com/TwiN/gatus: (97 commits)
  docs: add instruction to install as binary (TwiN#615)
  feat(alerting): make authentication optional for email provider (TwiN#608)
  feat(alerting): Add gotify provider (TwiN#605)
  chore(deps): bump github.com/coreos/go-oidc/v3 from 3.6.0 to 3.7.0 (TwiN#604)
  chore(deps): bump github.com/valyala/fasthttp from 1.49.0 to 1.50.0 (TwiN#594)
  Feat/modify discord title (TwiN#602)
  ui: Fix issue back button appearing over title when logo is too small
  feat(alerting): Add AWS SES Alerting Provider (TwiN#579)
  chore(deps): bump github.com/wcharczuk/go-chart/v2 from 2.1.0 to 2.1.1 (TwiN#591)
  ci: Increase timeout-minutes for test workflow to 10 minutes
  ui: Use localStorage instead of sessionStorage for refresh interval + collapsed groups
  ui(settings): Fix refresh interval padding
  chore(deps): bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (TwiN#586)
  chore(deps): bump modernc.org/sqlite from 1.24.0 to 1.26.0 (TwiN#585)
  fix: Support hexadecimal integers in conditions (TwiN#563)
  chore(deps): Bump github.com/TwiN/whois to v1.1.7
  chore(deps): Bump github.com/TwiN/whois to v1.1.7
  fix(alerting): Add support for client.insecure in email alerting provider (TwiN#583)
  chore(deps): bump github.com/gofiber/fiber/v2 from 2.46.0 to 2.49.2 (TwiN#584)
  docs: Clean up list of sponsors
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/alerting Related to alerting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants