X-Git-Url: http://git.ipfire.org/?p=ddns.git;a=blobdiff_plain;f=src%2Fddns%2Fproviders.py;h=828787872c185f50dd4766f17c7f1a41dfc3f91b;hp=2c30d42976059a84af947c67da0fcd5371b3e465;hb=9db9ea2539cfdeac4d12efad06156d34cf87bba1;hpb=f77e6bc92825d65e881d5dc7fc443139278c0d5f diff --git a/src/ddns/providers.py b/src/ddns/providers.py index 2c30d42..8287878 100644 --- a/src/ddns/providers.py +++ b/src/ddns/providers.py @@ -2,7 +2,7 @@ ############################################################################### # # # ddns - A dynamic DNS client for IPFire # -# Copyright (C) 2012 IPFire development team # +# Copyright (C) 2012-2017 IPFire development team # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # @@ -400,6 +400,8 @@ class DDNSProtocolDynDNS2(object): raise DDNSInternalServerError(_("DNS error encountered")) elif output == "badagent": raise DDNSBlockedError + elif output == "badip": + raise DDNSBlockedError # If we got here, some other update error happened. raise DDNSUpdateError(_("Server response: %s") % output) @@ -828,6 +830,24 @@ class DDNSProviderDuckDNS(DDNSProtocolDynDNS2, DDNSProvider): url = "https://www.duckdns.org/nic/update" +class DDNSProviderDyFi(DDNSProtocolDynDNS2, DDNSProvider): + handle = "dy.fi" + name = "dy.fi" + website = "https://www.dy.fi/" + protocols = ("ipv4",) + + # Information about the format of the request is to be found + # https://www.dy.fi/page/clients?lang=en + # https://www.dy.fi/page/specification?lang=en + + url = "http://www.dy.fi/nic/update" + + # Please only send automatic updates when your IP address changes, + # or once per 5 to 6 days to refresh the address mapping (they will + # expire if not refreshed within 7 days). + holdoff_days = 6 + + class DDNSProviderDynDNS(DDNSProtocolDynDNS2, DDNSProvider): handle = "dyndns.org" name = "Dyn" @@ -841,6 +861,19 @@ class DDNSProviderDynDNS(DDNSProtocolDynDNS2, DDNSProvider): url = "https://members.dyndns.org/nic/update" +class DDNSProviderDomainOffensive(DDNSProtocolDynDNS2, DDNSProvider): + handle = "do.de" + name = "Domain-Offensive" + website = "https://www.do.de/" + protocols = ("ipv6", "ipv4") + + # Detailed information about the request and response codes + # are available on the providers webpage. + # https://www.do.de/wiki/FlexDNS_-_Entwickler + + url = "https://ddns.do.de/" + + class DDNSProviderDynU(DDNSProtocolDynDNS2, DDNSProvider): handle = "dynu.com" name = "Dynu" @@ -1271,6 +1304,19 @@ class DDNSProviderNOIP(DDNSProtocolDynDNS2, DDNSProvider): return data +class DDNSProviderNowDNS(DDNSProtocolDynDNS2, DDNSProvider): + handle = "now-dns.com" + name = "NOW-DNS" + website = "http://now-dns.com/" + protocols = ("ipv6", "ipv4") + + # Information about the format of the request is to be found + # but only can be accessed by register an account and login + # https://now-dns.com/?m=api + + url = "https://now-dns.com/update" + + class DDNSProviderNsupdateINFO(DDNSProtocolDynDNS2, DDNSProvider): handle = "nsupdate.info" name = "nsupdate.info" @@ -1452,6 +1498,41 @@ class DDNSProviderSelfhost(DDNSProtocolDynDNS2, DDNSProvider): return data +class DDNSProviderServercow(DDNSProvider): + handle = "servercow.de" + name = "servercow.de" + website = "https://servercow.de/" + protocols = ("ipv4", "ipv6") + + url = "https://www.servercow.de/dnsupdate/update.php" + can_remove_records = False + + def update_protocol(self, proto): + data = { + "ipaddr" : self.get_address(proto), + "hostname" : self.hostname, + "username" : self.username, + "pass" : self.password, + } + + # Send request to provider + response = self.send_request(self.url, data=data) + + # Read response + output = response.read() + + # Server responds with OK if update was successful + if output.startswith("OK"): + return + + # Catch any errors + elif output.startswith("FAILED - Authentication failed"): + raise DDNSAuthenticationError + + # If we got here, some other update error happened + raise DDNSUpdateError(output) + + class DDNSProviderSPDNS(DDNSProtocolDynDNS2, DDNSProvider): handle = "spdns.org" name = "SPDYN"