-
-
Notifications
You must be signed in to change notification settings - Fork 144
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(provider): add netcup #361
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! 👍
I requested quite a bit of code changes, feel free to let me know if you don't have the time/will to do it and I can pick it up from your fork and finish it up myself as well, and you can test it after modifications. If you want to do it, feel free to comment and I'll wait for you no problem (I'm also moving out/in so quite busy over here)
08250d1
to
14ca260
Compare
@Azorimor I pushed changes fixing all the comments above, I have built the image |
Thanks for your feedback. I tested the changes and it did not work. Console Output: Running version unknown built on an unknown date (commit unknown)
[...]
💰 Help me? https://www.paypal.me/qmcgaw https://github.com/sponsors/qdm12
2022/10/03 11:12:24 INFO reading JSON config from file /workspace/data/config.json
2022/10/03 11:12:24 INFO Found single setting to update record
2022/10/03 11:12:24 INFO Reading history from database: domain xxxxx.xx host test
2022/10/03 11:12:24 INFO healthcheck server: listening on 127.0.0.1:9999
2022/10/03 11:12:24 INFO backup: disabled
2022/10/03 11:12:24 INFO http server: listening on :8000
2022/10/03 11:12:24 INFO IP address of test.xxxxx.xx is 185.yyy.yyy.192 and your IP address is yy.207.1yy.3xx
2022/10/03 11:12:24 INFO Updating record [domain: xxxxx.xx | host: test | provider: netcup | ip: ipv4 or ipv6] to use yy.207.1yy.3xx
2022/10/03 11:12:24 ERROR logging in: session received is empty I am currently bussy. I can look into this in 1-2 weeks. {
"serverrequestid": "3FWpNX0RgYY0RNI5=",
"clientrequestid": "",
"action": "login",
"status": "success",
"statuscode": 2000,
"shortmessage": "Login successful",
"longmessage": "Session has been created successful.",
"responsedata": {
"apisessionid": "NTg5MzI0MDDDN3Rmc3ZBbW9IYVRqR2JYYYYCUm1RSTUzMVUXXX"
}
} There is probably something wrong with handling the response data. I also tested, that the login does work (commonResponse for login request does contain |
Thanks for the feedback! Indeed, fixed in Azorimor@abf0a12 and re-pushed the image with tag |
Hey @Azorimor does the newer image work? I have a report from someone that the netcup log shows it works, but it actually fails and the returned IP address is the older one, not the newer one. Did you experience the same problem? |
abf0a12
to
28a8fd7
Compare
Hey @qdm12 first, thank you lots for this great piece of work!
Following project might have a solution https://github.com/Hentra/dyndns-netcup-go |
Hi @scrapix thanks for the feedback. I saw in the update response data from your logs there are two records: {"id":"${ID}","hostname":"@","type":"A","priority":"0","destination":"${0.0.0.0.-current-IP}","deleterecord":false,"state":"unknown"},
{"id":"${ID}","hostname":"@","type":"A","priority":"0","destination":"${1.2.1.2.-IP-savedAtNetcupCurrently}","deleterecord":false,"state":"yes"}, So it looks like it's adding the record twice, but with the new one in unknown state??? |
@qdm12 it did not update the records :/ the other project I've mentioned actually updates the records at (and can create new ones). While not supporting many different providers. |
28a8fd7
to
6d5b433
Compare
I believe I spotted a few JSON decoding programming errors (most likely in my refactor of this branch, so 100% my bad). These are fixed in f4714b6 largely thanks to the logs you attached! 👍 I re-pushed image |
I'll try asap again! |
Rebased it on the master branch |
I have been able to test it and it works just fine
The IP and domain have been changed for privacy reasons |
Awesome thanks @Assaro I'll rebase and merge it tomorrow! |
Signed-off-by: Azorimor <azorimor@gmail.com>
Signed-off-by: Azorimor <azorimor@gmail.com>
This PR adds basic support to use Netcup as provider (#282). The implementation only updates the IP of the given host. Additional settings (TTL, Retry, Refresh, ...) can be set manually in the netcup customercontrolpanel / dashboard.
All requests to the netcup api are send to the same endpoint. The different functions are defined by the body of the request. For example the following requests (and more) are necessary. (see doc) The requests are implemented in netcup/client.go.
Login (Create Session on server, which is valid for 15 minutes (logout not implemented, because 15 min as default seems ok))
body: