]> git.ipfire.org Git - ddns.git/commitdiff
Add DNSmadeEasy as new provider.
authorMarco Götze <account@solariz.de>
Wed, 22 Apr 2015 18:36:07 +0000 (20:36 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Thu, 9 Jul 2015 19:27:41 +0000 (21:27 +0200)
Fixes #10811.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
README
ddns.conf.sample
src/ddns/providers.py

diff --git a/README b/README
index 4ae38831b3a8b3a8a334d7e07ed95b0ffecb6dff..9e924a18c6fdf524da6bd7f324dcff83fa013a4c 100644 (file)
--- a/README
+++ b/README
@@ -53,6 +53,7 @@ SUPPORTED PROVIDERS:
        ddnss.de
        dhs.org
        dns.lightningwirelabs.com
        ddnss.de
        dhs.org
        dns.lightningwirelabs.com
+       dnsmadeeasy.com
        dnspark.com
        domains.google.com
        domopoli.de
        dnspark.com
        domains.google.com
        domopoli.de
index 0cab89960cef51272cf92b12f2050ec164eec937..bc4231949ec92f7025b3f0a6ebf7af9b0c86ff6f 100644 (file)
 # username = user
 # password = pass
 
 # username = user
 # password = pass
 
+# [test.dnsmadeeasy.com]
+# provider = dnsmadeeasy.com
+# username = user
+# password = pass
+
 # [test.dtdns.org]
 # provider = dtdns.org
 # password = pass
 # [test.dtdns.org]
 # provider = dtdns.org
 # password = pass
index 9eaaa6ce5dd7d4072c91a2f47a869dce3e184389..e708fd648139b552a0ecc93aa8c18d771ae06ef7 100644 (file)
@@ -1552,6 +1552,54 @@ class DDNSProviderZoneedit(DDNSProvider):
                raise DDNSUpdateError
 
 
                raise DDNSUpdateError
 
 
+class DDNSProviderDNSmadeEasy(DDNSProvider):
+       handle    = "dnsmadeeasy.com"
+       name      = "DNSmadeEasy.com"
+       website   = "http://www.dnsmadeeasy.com/"
+       protocols = ("ipv4",)
+
+       # DNS Made Easy Nameserver Provider also offering Dynamic DNS
+       # Documentation can be found here:
+       # http://www.dnsmadeeasy.com/dynamic-dns/
+
+       url = "https://cp.dnsmadeeasy.com/servlet/updateip?"
+       can_remove_records = False
+
+       def update_protocol(self, proto):
+               data = {
+                       "ip" : self.get_address(proto),
+                       "id" : self.hostname,
+                       "username" : self.username,
+                       "password" : self.password,
+               }
+
+               # Send update to the server.
+               response = self.send_request(self.url, data=data)
+
+               # Get the full response message.
+               output = response.read()
+
+               # Handle success messages.
+               if output.startswith("success") or output.startswith("error-record-ip-same"):
+                       return
+
+               # Handle error codes.
+               if output.startswith("error-auth-suspend"):
+                       raise DDNSRequestError(_("Account has been suspended."))
+
+               elif output.startswith("error-auth-voided"):
+                       raise DDNSRequestError(_("Account has been revoked."))
+
+               elif output.startswith("error-record-invalid"):
+                       raise DDNSRequestError(_("Specified host does not exist."))
+
+               elif output.startswith("error-auth"):
+                       raise DDNSAuthenticationError
+
+               # If we got here, some other update error happened.
+               raise DDNSUpdateError(_("Server response: %s") % output)
+
+
 class DDNSProviderZZZZ(DDNSProvider):
        handle    = "zzzz.io"
        name      = "zzzz"
 class DDNSProviderZZZZ(DDNSProvider):
        handle    = "zzzz.io"
        name      = "zzzz"