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 Dynu.com #285

Merged
merged 9 commits into from
Feb 5, 2022
Merged

Add support for Dynu.com #285

merged 9 commits into from
Feb 5, 2022

Conversation

msxdan
Copy link
Contributor

@msxdan msxdan commented Dec 31, 2021

Added support for dynu. I could only test IPv4 as my ISP doesn't provide me an IPv6 but I added the right param to the query so it should work as good as IPv4 does.

image
image

Closes #222, #237, #263, #269

Copy link
Owner

@qdm12 qdm12 left a comment

Choose a reason for hiding this comment

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

Nice, thanks for the contribution!!! Especially on new year, impressive 🎉 !

Just a few nit-picking comments

internal/settings/providers/dynu/provider.go Outdated Show resolved Hide resolved
internal/settings/providers/dynu/provider.go Outdated Show resolved Hide resolved
case len(p.password) == 0:
return errors.ErrEmptyPassword
case p.host == "*":
return errors.ErrHostWildcard
Copy link
Owner

Choose a reason for hiding this comment

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

Wildcards are not supported then right? Are custom hosts (i.e. a.example.com) supported?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I use @ or * it updates all DDNS IPs for my domains on Dynu, * doesn't update subdomains of a concrete domain, so *.domain.com updates domain.com but not subdomain.domain.com

There's an alias (subdomain) parameter that could be used to update a concrete subdomain, to update a bunch of domains and subdomains in one call there's an optional parameter called location which could be used if configured in Dynu, would be similar to * but you have to set your domains and subdomains to a group in dynu.

I'm adding more features to support all these parameters, I'll update the pull as soon as I finish.

Copy link
Owner

Choose a reason for hiding this comment

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

If I use @ or * it updates all DDNS IPs for my domains on Dynu, * doesn't update subdomains of a concrete domain, so *.domain.com updates domain.com but not subdomain.domain.com

I'm a bit confused here.
Correct me if I'm wrong:

  • @ for domain.com updates only domain.com but not `sub.domain.com
  • * for domain.com updates domain.com, domain2.com but not sub.domain.com

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, @ does nothing really, if you don't set the hostname or if it's not a valid hostname for your user it will update all records for your domains that don't have a group assigned.

* doesn't acts like a wildcard, you can use it in the hostname but it will update only the domain.com and not sub.domain.com

internal/settings/providers/dynu/provider.go Outdated Show resolved Hide resolved
@msxdan
Copy link
Contributor Author

msxdan commented Jan 5, 2022

I finally added support for most options on Dynu, feel free to review and give any advices about code

image

Example usage: (Comments are for reference)

{
    "settings": [
        { // Subdomain update [any.host.dynu.net]
            "provider": "dynu",
            "domain": "dynu.net",
            "host": "host",
            "alias": "any",
            "username" : "user",
            "password": "63a9f0ea7bb98050796b649e85481845",
            "ip_version": "ipv4",
            "provider_ip": true
        },
        { // Subdomain update [www.host.dynu.net]
            "provider": "dynu",
            "domain": "dynu.net",
            "host": "host",
            "alias": "www",
            "username" : "user",
            "password": "63a9f0ea7bb98050796b649e85481845",
            "ip_version": "ipv4",
            "provider_ip": true
        },
        { // domain update [host.dynu.net]
            "provider": "dynu",
            "domain": "dynu.net",
            "host": "host",
            "alias": "",
            "username" : "user",
            "password": "63a9f0ea7bb98050796b649e85481845",
            "ip_version": "ipv4",
            "provider_ip": true
        },
        { // Group update [host.dynu.net | group=work]
            "provider": "dynu",
            "domain": "dynu.net",
            "host": "host",
            "alias": "",
            "location": "work",
            "username" : "user",
            "password": "63a9f0ea7bb98050796b649e85481845",
            "ip_version": "ipv4",
            "provider_ip": true
        },
        { // Update all domains you have in dynu that doesn't belongs to any group
            "provider": "dynu",
            "domain": "host.dynu.net",
            "host": "@",
            "username" : "user",
            "password": "63a9f0ea7bb98050796b649e85481845",
            "ip_version": "ipv4",
            "provider_ip": true
        }
    ]
}

@msxdan msxdan requested a review from qdm12 January 5, 2022 23:40
internal/settings/providers/dynu/provider.go Outdated Show resolved Hide resolved
internal/settings/providers/dynu/provider.go Outdated Show resolved Hide resolved
internal/settings/providers/dynu/provider.go Outdated Show resolved Hide resolved
case len(p.password) == 0:
return errors.ErrEmptyPassword
case p.host == "*":
return errors.ErrHostWildcard
Copy link
Owner

Choose a reason for hiding this comment

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

If I use @ or * it updates all DDNS IPs for my domains on Dynu, * doesn't update subdomains of a concrete domain, so *.domain.com updates domain.com but not subdomain.domain.com

I'm a bit confused here.
Correct me if I'm wrong:

  • @ for domain.com updates only domain.com but not `sub.domain.com
  • * for domain.com updates domain.com, domain2.com but not sub.domain.com

@msxdan
Copy link
Contributor Author

msxdan commented Jan 6, 2022

I removed the mess with extra params and simplified the usage, adding only an extra parameter for the group.

image

{
    "settings": [
        {
            "provider": "dynu",
            "domain": "dom.dynu.net",
            "host": "@",
            "username" : "user",
            "password": "<md5hash>",
            "ip_version": "ipv4",
            "provider_ip": false
        },
        {
            "provider": "dynu",
            "domain": "dom.dynu.net",
            "host": "www", // Subdomain
            "username" : "user",
            "password": "<md5hash>",
            "ip_version": "ipv4",
            "provider_ip": false
        },
        {
            "provider": "dynu",
            "domain": "dom.dynu.net",
            "host": "any", // Subdomain
            "username" : "user",
            "password": "<md5hash>",
            "ip_version": "ipv4",
            "provider_ip": false
        },
        {
            "provider": "dynu",
            "domain": "dom2.dynu.net",
            "host": "sub",
            "group": "work", // It will check the subdomain IP and update the group
            "username" : "user",
            "password": "<md5hash>",
            "ip_version": "ipv4",
            "provider_ip": false
        }
    ]
}

@msxdan msxdan requested a review from qdm12 January 6, 2022 15:05
@msxdan
Copy link
Contributor Author

msxdan commented Jan 20, 2022

Any news about these changes? I'm currently using it and it's working fine, we could merge it into master if you agree

Copy link
Owner

@qdm12 qdm12 left a comment

Choose a reason for hiding this comment

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

Sorry for the delay this got lost in my emails 😢
Just a few comments and let's merge this ASAP 😉
Thanks again for your work!

internal/settings/providers/dynu/provider.go Outdated Show resolved Hide resolved
internal/settings/providers/dynu/provider.go Show resolved Hide resolved
internal/settings/providers/dynu/provider.go Outdated Show resolved Hide resolved
internal/settings/providers/dynu/provider.go Outdated Show resolved Hide resolved
internal/settings/providers/dynu/provider.go Outdated Show resolved Hide resolved
@C-SELLERS
Copy link

Just built and am using an image of this branch for Dynu as well, everything seems to working fine. Thanks guys 😁

@msxdan
Copy link
Contributor Author

msxdan commented Feb 5, 2022

Done!

@qdm12 qdm12 merged commit 5b426af into qdm12:master Feb 5, 2022
@qdm12
Copy link
Owner

qdm12 commented Feb 5, 2022

Awesome thanks for your work and dedication @msxdan

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.

Provider: dynu.com
3 participants