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: Add [DOMAIN_EXPIRATION] placeholder for monitoring domain expiration using WHOIS #325

Merged
merged 5 commits into from
Sep 7, 2022

Conversation

TwiN
Copy link
Owner

@TwiN TwiN commented Sep 5, 2022

Summary

Closes #133

This feature allows users to monitor domain expiration by leveraging the WHOIS protocol through the TwiN/whois library.

Here's an example of what an endpoint configured to monitor

endpoints:
  - name: check-domain-expiration
    url: "https://example.org"
    interval: 1h
    conditions:
      - "[DOMAIN_EXPIRATION] > 720h"

Checklist

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

@TwiN TwiN added the feature New feature or request label Sep 5, 2022
@codecov-commenter
Copy link

codecov-commenter commented Sep 6, 2022

Codecov Report

Merging #325 (2d2b464) into master (4857b43) will decrease coverage by 0.07%.
The diff coverage is 80.00%.

@@            Coverage Diff             @@
##           master     #325      +/-   ##
==========================================
- Coverage   82.97%   82.89%   -0.08%     
==========================================
  Files          54       54              
  Lines        3864     3899      +35     
==========================================
+ Hits         3206     3232      +26     
- Misses        514      518       +4     
- Partials      144      149       +5     
Impacted Files Coverage Δ
core/result.go 100.00% <ø> (ø)
core/endpoint.go 74.77% <72.22%> (-1.35%) ⬇️
core/condition.go 97.94% <100.00%> (+0.06%) ⬆️
storage/store/sql/specific_sqlite.go 82.60% <100.00%> (+0.79%) ⬆️
storage/store/sql/sql.go 80.38% <100.00%> (+0.02%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Comment on lines -254 to -263
if endpoint.DNS != nil {
result.Hostname = strings.TrimSuffix(endpoint.URL, ":53")
} else {
urlObject, err := url.Parse(endpoint.URL)
if err != nil {
result.AddError(err.Error())
return
}
result.Hostname = urlObject.Hostname()
}
Copy link
Owner Author

Choose a reason for hiding this comment

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

That didn't belong there in the first place, not sure why I put that there.

@TwiN TwiN merged commit 0148483 into master Sep 7, 2022
@TwiN TwiN deleted the domain-expiration branch September 7, 2022 01:22
TwiN added a commit that referenced this pull request Sep 7, 2022
…doesn't already exist

This will prevent temporary issues with the parsing of old results that would otherwise
have a value of NULL for domain_expiration

Fixes an issue introduced by #325
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: Support retrieving domain expiration date via WHOIS
2 participants