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

Add support for .CZ and .ME domain expiration parsing #993

Open
Listat90 opened this issue Feb 5, 2025 · 2 comments
Open

Add support for .CZ and .ME domain expiration parsing #993

Listat90 opened this issue Feb 5, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@Listat90
Copy link

Listat90 commented Feb 5, 2025

Describe the bug

Gatus does not correctly parse expiration dates for .CZ and .ME domains, causing [DOMAIN_EXPIRATION] to return incorrect or invalid values. This affects domain expiration monitoring by triggering false alerts or failing to detect actual expiration dates.

What do you see?

For .CZ and .ME domains, Gatus returns incorrect values:

  1. my_example.cz (.CZ domain)
    WHOIS response:
    whois my_example.cz | grep -i expire expire: 16.10.2025

Gatus results:
❌ - [DOMAIN_EXPIRATION] (-9223372036854) > 720h (2592000000)

  1. my_example.me (.ME domain)
    WHOIS response:
    whois my_example.me | grep Expiry Registry Expiry Date: 2026-05-11T02:24:08Z

Gatus results:
❌ - [DOMAIN_EXPIRATION] (0) > 720h (2592000000)

What do you expect to see?

Gatus should correctly parse expiration dates for .CZ and .ME domains and return the actual number of hours or days until expiration, instead of incorrect negative or zero values.

List the steps that must be taken to reproduce this issue

Add a .CZ or .ME domain to the Gatus configuration for [DOMAIN_EXPIRATION] monitoring.
Start Gatus and wait for it to fetch WHOIS data.
Observe the logs and alerts for the incorrect expiration values.

Version

v5.15.0

Additional information

It looks like Gatus does not handle .CZ and .ME expiration date formats correctly. Similar to how .UK is handled in (https://github.com/TwiN/whois/blob/master/whois.go), support for .CZ and .ME should be added:

`case strings.HasSuffix(domain, ".cz"):
response.ExpirationDate, _ = time.Parse("02.01.2006", value)

case strings.HasSuffix(domain, ".me"):
response.ExpirationDate, _ = time.Parse(time.RFC3339, value)
`

This should correctly parse expiration dates for .CZ (DD.MM.YYYY) and .ME (YYYY-MM-DDTHH:MM:SSZ).

@Listat90 Listat90 added the bug Something isn't working label Feb 5, 2025
@TwiN
Copy link
Owner

TwiN commented Feb 6, 2025

Support for TLDs is done through github.com/TwiN/whois

Feel free to submit a pull request on that repo & I'll review and merge it.

@TwiN
Copy link
Owner

TwiN commented Feb 11, 2025

TwiN/whois#24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants