From f1c737c0ed2e73022b08d478848db98f2f9abeb9 Mon Sep 17 00:00:00 2001 From: Christof Weniger Date: Tue, 7 Jan 2020 17:35:37 +0100 Subject: [PATCH] add ddns Provider key-systems.net Hi, sorry for the long delay. It's the time of the year, where I think it might be easier to just move in with the childrens doctor instead of daily vists :-( Michael thank you for your pointers and reviews. Reviewed-by: Michael Tremer Signed-off-by: Stefan Schantl --- README | 1 + src/ddns/providers.py | 45 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/README b/README index c75c448..b6decb3 100644 --- a/README +++ b/README @@ -72,6 +72,7 @@ SUPPORTED PROVIDERS: inwx.com|de|at|ch|es itsdns.de joker.com + key-systems.net loopia.se myonlineportal.net namecheap.com diff --git a/src/ddns/providers.py b/src/ddns/providers.py index 7a1d97c..1263a80 100644 --- a/src/ddns/providers.py +++ b/src/ddns/providers.py @@ -1188,6 +1188,51 @@ class DDNSProviderJoker(DDNSProtocolDynDNS2, DDNSProvider): url = "https://svc.joker.com/nic/update" +class DDNSProviderKEYSYSTEMS(DDNSProvider): + handle = "key-systems.net" + name = "dynamicdns.key-systems.net" + website = "https://domaindiscount24.com/" + protocols = ("ipv4",) + + # There are only information provided by the domaindiscount24 how to + # perform an update with HTTP APIs + # https://www.domaindiscount24.com/faq/dynamic-dns + # examples: https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=auto + # https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=213.x.x.x&mx=213.x.x.x + + url = "https://dynamicdns.key-systems.net/update.php" + can_remove_records = False + + def update_protocol(self, proto): + address = self.get_address(proto) + data = { + "hostname" : self.hostname, + "password" : self.password, + "ip" : address, + } + + # Send update to the server. + response = self.send_request(self.url, data=data) + + # Get the full response message. + output = response.read().decode() + + # Handle success messages. + if "code = 200" in output: + return + + # Handle error messages. + if "abuse prevention triggered" in output: + raise DDNSAbuseError + elif "invalid password" in output: + raise DDNSAuthenticationError + elif "Authorization failed" in output: + raise DDNSRequestError(_("Invalid hostname specified")) + + # If we got here, some other update error happened. + raise DDNSUpdateError + + class DDNSProviderGoogle(DDNSProtocolDynDNS2, DDNSProvider): handle = "domains.google.com" name = "Google Domains" -- 2.39.2