Add TwoDNS as new provider.
authorStefan Schantl <stefan.schantl@ipfire.org>
Sat, 21 Jun 2014 14:56:13 +0000 (16:56 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Sat, 21 Jun 2014 14:56:13 +0000 (16:56 +0200)
ddns.conf.sample
src/ddns/__init__.py
src/ddns/providers.py

index 1fb2071..107acc8 100644 (file)
 # username = user
 # password = pass
 
+# [test.twodns.de]
+# provider = twodns.de
+# username = user
+# password = pass
+
 # [test.variomedia.de]
 # provider = variomedia.de
 # username = user
index bb9c748..18d89ec 100644 (file)
@@ -104,6 +104,7 @@ class DDNSCore(object):
                        DDNSProviderRegfish,
                        DDNSProviderSelfhost,
                        DDNSProviderSPDNS,
+                       DDNSProviderTwoDNS,
                        DDNSProviderVariomedia,
                ):
                        self.register_provider(provider)
index 85d3a37..fdc86c6 100644 (file)
@@ -668,6 +668,29 @@ class DDNSProviderSPDNS(DDNSProviderDynDNS):
        url = "https://update.spdns.de/nic/update"
 
 
+class DDNSProviderTwoDNS(DDNSProviderDynDNS):
+       INFO = {
+               "handle"    : "twodns.de",
+               "name"      : "TwoDNS",
+               "website"   : "http://www.twodns.de",
+               "protocols" : ["ipv4",]
+       }
+
+       # Detailed information about the request can be found here
+       # http://twodns.de/en/faqs
+       # http://twodns.de/en/api
+
+       url = "https://update.twodns.de/update"
+
+       def _prepare_request_data(self):
+               data = {
+                       "ip" : self.get_address("ipv4"),
+                       "hostname" : self.hostname
+               }
+
+               return data
+
+
 class DDNSProviderVariomedia(DDNSProviderDynDNS):
        INFO = {
                "handle"   : "variomedia.de",