mirror of
https://github.com/qdm12/ddns-updater.git
synced 2026-08-02 18:48:49 -04:00
Infomaniak.com support #17
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @WhistleMaster on GitHub (Feb 18, 2020).
Hi,
Thanks for the great work !
Would it be possible to add Infomaniak.com as a provider ? It gives the following HTTPS url to call with specific parameters to update a domain:
https://[USERNAME]:[PASSWORD]@[infomaniak.com/nic/update?hostname=[DOMAIN]&myip=[IP]Reference
Thanks !
@qdm12 commented on GitHub (Feb 18, 2020):
Hi there,
I'm currently refactoring the entire code base to be less spaghetti like, it should be done in 2-3 days. And I'll happily add that provider, thanks for the suggestion. It should be done this weekend the latest.
@WhistleMaster commented on GitHub (Feb 19, 2020):
Great ! Thanks !
@qdm12 commented on GitHub (Feb 22, 2020):
Do you mind trying with your browser to access, with your information:
https://username:password@infomaniak.com/nic/update?hostname=subdomain.yourdomain.com&myip=1.2.3.4
What's the answer like / status code? You can try doing it with Postman to see the status code.
I'm writing code for it, but it would be nice to know how to give feedback depending on the reply from their API. Thanks!
@qdm12 commented on GitHub (Feb 22, 2020):
Also there is a Docker image if you want to try it:
Documentation is here
@WhistleMaster commented on GitHub (Feb 23, 2020):
Thanks ! I tried a few cases to get the answer returned:
@qdm12 commented on GitHub (Feb 23, 2020):
Thanks, that should be integrated now. Plus you should be able to use the ip method
"provider"for Infomaniak.Please wait for the build to finish and then can you please try it?
I will then merge with the main code. Thanks again for testing the possible responses!
@WhistleMaster commented on GitHub (Feb 24, 2020):
I did some testing with the docker image but I get the following error:
I have the following config:
@qdm12 commented on GitHub (Feb 24, 2020):
Oops that's another update I made on the master branch, and didn't test it with no initial database (shame on me I should have unit tests). I'll fix it this evening. Probably add some tests too 😄
@qdm12 commented on GitHub (Feb 24, 2020):
It should be fixed now, I just pushed the
:infomaniakimage. It may showRunning version ? built on ? (commit ?)because I built it locally on the rush, although Travis is building an image which will replace it in ~20 minutes.Anyway, I just tried it and it works in all cases, thanks for letting me know it broke!
@WhistleMaster commented on GitHub (Feb 25, 2020):
Thanks, I've just tried the latest
:infomaniakimage but I get the following:@qdm12 commented on GitHub (Feb 25, 2020):
Ok really sorry, it seems I messed up my Git branches and erased the Infomaniak changes 😖
I was working on too many branches and merging them around, anyway.
Anyway I re-added them, and pushed the image (
:infomaniak) and tested it with dummy values and it seems to work with Infomaniak (telling me my domain does not exist aha)@WhistleMaster commented on GitHub (Feb 25, 2020):
Thanks !
This is what I have now:
2020-02-25T14:56:09.515Z ERROR infomaniak.com: bad request: conflict AAAA {"node_id": 0}@WhistleMaster commented on GitHub (Feb 25, 2020):
I know why I had the 'conflict AAAA'... I can configure either an IPv4 or an IPv6 on infomaniak.com dynamic dns and it seems that ddns-updater tries to pass an IPv6 instead of an IPv4 to infomaniak.com.
Is there a way to specify that as an option ? Thanks !
@qdm12 commented on GitHub (Feb 25, 2020):
Hm, is your ip_method set to provider?
Have you tried with google or opendns?
Sorry I merged the infomaniak PR to master already, there was a bug fix on the infomaniak branch i quickly needed on master.
Can you try going with your browser at https://diagnostic.opendns.com/myip does it give you an ipv6 address?
Maybe you only have an ipv6 address, explaining why the program doesn't find the ipv4 address?
I'll promptly add ipv6 support in that case.
EDIT: Also Infomaniak API is not really documented so it's hard to know if I can specify something else than A records. Maybe shoot them an email?
@WhistleMaster commented on GitHub (Feb 25, 2020):
I tried to change the ip method to "opendns", but I have the following error:
2020-02-25T15:00:13.970Z ERROR no public IP found at https://diagnostic.opendns.com/myip: %!s(<nil>) {"node_id": 0}I also tried to use "google" as ip method and strange thing... the IP updated on the dynamic domain is 66.249.72.11, which is a Google IP...
Manually going to opendns website gives me indeed an IPv6 IP.
@qdm12 commented on GitHub (Feb 25, 2020):
For google and opendns, the program really just downloads the page and searches for an ipv4 addresss.
OpenDNS returning an ipv6 address thus fail, that makes sense.
However, Google is returning me my correct IP address. Maybe they have their own IP address in the search result, but that's not the case when I'm testing here. What IP address does it show when you access https://google.com/search?q=ip?
And the provider method does not work? Because when you set
ip_methodtoprovider, no IP is sent to Infomaniak and they should handle finding your IP address themselves.You may be able to turn off ipv6 in your router as well, although ideally Infomaniak may support AAAA records and I could add support for ipv6.
EDIT/PS: I think I'm going to code my own IP address server to add an additional method for users of this container to determine their IP address. The choice is limited as most websites will block you if you ask for your IP address every 5 minutes.
@WhistleMaster commented on GitHub (Feb 26, 2020):
Google does not return anything in my case, guess because of the language used:
Infomaniak does indeed offer IPv6 AAAA support.
Another method to get the IP is using https://ifconfig.io and especially https://ifconfig.io/ip
I get the following error with
provider:2020-02-26T07:47:59.282Z ERROR infomaniak.com: bad request: conflict AAAA {"node_id": 0}@qdm12 commented on GitHub (Feb 26, 2020):
Damn Google. I was using Duckduckgo as well before they stopped showing your IP address. It's like finding your own name is the new gold.
I can add ifconfig for now, although they will likely block your requests after some time (the program even sends requests with random user agent strings to look more human), but we can try!
How can you specify to update the AAAA record instead of A record for Infomaniak? Maybe try figuring out how to update it manually with your browser?
Thanks
@WhistleMaster commented on GitHub (Feb 26, 2020):
With Infomaniak, you can specify either an IPv4 or an IPv6 with the
myipparameter.@qdm12 commented on GitHub (Feb 26, 2020):
Ok and updating Infomaniak manually without specifying your ipv6 address in the URL shows the same AAAA conflict error? (omit the
&myip=...parameter)Does it only work if you specify the IPv6 address in the URL?
@WhistleMaster commented on GitHub (Feb 26, 2020):
I got the same error by updating manually... and I figured out why... the first time you create the dynamic record on Infomaniak console, you have to tell that it will be an IPv6 IP or an IPv4.
I deleted the entry, created an new one and now the
providerip method works fine ! The IP displayed on the ddns-updater UI is incorrect though.@qdm12 commented on GitHub (Feb 26, 2020):
Ah ok great! Yes that's likely because ipv6 is not supported, but I'll add support for it at least for Infomaniak, like today/tomorrow. What ip does it show on the UI? An ipv4?
Anyway thanks for the digging!
@WhistleMaster commented on GitHub (Feb 26, 2020):
Strange thing, I get the google IP
66.249.72.11:And in the log I get every update the following:
2020-02-26T12:53:15.038Z WARN unhealthy: lookup IP address of REDACTED_DOMAIN is REDACTED_IPv6 instead of 66.249.72.11 {"node_id": 0}EDIT: removing
updates.jsonand restarting the container gives:And in the log:
2020-02-26T12:56:26.750Z WARN unhealthy: no set IP address found {"node_id": 0}@qdm12 commented on GitHub (Feb 26, 2020):
Yeah that makes sense, I'll fix it by adding ipv6 regex searching in the code. I'll try to do it this evening.
I'll also add ifconfig and a bunch of other ip methods with a cycle option to cycle between methods in order to avoid being blocked.
@qdm12 commented on GitHub (Feb 27, 2020):
Also the Google method was returning a Google IP address because the Google webpage actually contains multiple IP addresses. In my case, it's my IPv4, Google's IPv4 and 192.168.0.0 (whatever that is to them). If the first one is not IPv4, it uses the next one which is Google's. I'll remove the google method as it's quite unreliable / dangerous to use.
@qdm12 commented on GitHub (Feb 27, 2020):
So I made some adjustments, now you can
Feel free to try it (once the build is finished:
Let me know if it works out correctly with ipv6, and feel free to reopen the issue if it does not work.
@WhistleMaster commented on GitHub (Feb 28, 2020):
Working perfectly fine ! Thanks for the work !
I had an idea about that and I created another issue #38 to discuss it.