]> git.ipfire.org Git - oddments/ddns.git/commitdiff
Add all-inkl.com as new provider.
authorStefan Schantl <stefan.schantl@ipfire.org>
Tue, 17 Jun 2014 17:46:54 +0000 (19:46 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Thu, 19 Jun 2014 20:09:17 +0000 (22:09 +0200)
ddns.conf.sample
src/ddns/__init__.py
src/ddns/providers.py

index 1fb20719369c48fba26af6eeaa38bc1e248ea757..895b537e8692558f63202625bba5fc7a5fe6314d 100644 (file)
 # Accounts are its own sections.
 # These are some examples.
 
 # Accounts are its own sections.
 # These are some examples.
 
+# [test.all-inkl.com]
+# provider = all-inkl.com
+# username = user
+# password = pass
+
 # [test.dhs.org]
 # provider = dhs.org
 # username = user
 # [test.dhs.org]
 # provider = dhs.org
 # username = user
index bb9c748dfee40b20c9299a3515a51a25a9bd8868..5ed463651e01a56519786ea1be558246083efb0e 100644 (file)
@@ -91,6 +91,7 @@ class DDNSCore(object):
                        Simply registers all providers.
                """
                for provider in (
                        Simply registers all providers.
                """
                for provider in (
+                       DDNSProviderAllInkl,
                        DDNSProviderDHS,
                        DDNSProviderDNSpark,
                        DDNSProviderDtDNS,
                        DDNSProviderDHS,
                        DDNSProviderDNSpark,
                        DDNSProviderDtDNS,
index 85d3a370f463da0d155ca1304fd97b856ad5419f..f4944be255e808712ce239f5ccbe212567e6231d 100644 (file)
@@ -20,6 +20,7 @@
 ###############################################################################
 
 import logging
 ###############################################################################
 
 import logging
+import urllib2
 
 from i18n import _
 
 
 from i18n import _
 
@@ -167,6 +168,47 @@ class DDNSProvider(object):
                return self.core.system.get_address(proto)
 
 
                return self.core.system.get_address(proto)
 
 
+class DDNSProviderAllInkl(DDNSProvider):
+       INFO = {
+               "handle"    : "all-inkl.com",
+               "name"      : "All-inkl.com",
+               "website"   : "http://all-inkl.com/",
+               "protocols" : ["ipv4",]
+       }
+
+       # There are only information provided by the vendor how to
+       # perform an update on a FRITZ Box. Grab requried informations
+       # from the net.
+       # http://all-inkl.goetze.it/v01/ddns-mit-einfachen-mitteln/
+
+       url = "http://dyndns.kasserver.com"
+
+       def update(self):
+
+               # There is no additional data required so we directly can
+               # send our request.
+               try:
+                       # Send request to the server.
+                       response = self.send_request(self.url, username=self.username, password=self.password)
+
+                       # Handle 401 HTTP Header (Authentication Error)
+               except urllib2.HTTPError, e:
+                       if e.code == 401:
+                               raise DDNSAuthenticationError
+
+                       raise
+
+               # Get the full response message.
+               output = response.read()
+
+               # Handle success messages.
+               if output.startswith("good") or output.startswith("nochg"):
+                       return
+
+               # If we got here, some other update error happened.
+               raise DDNSUpdateError
+
+
 class DDNSProviderDHS(DDNSProvider):
        INFO = {
                "handle"    : "dhs.org",
 class DDNSProviderDHS(DDNSProvider):
        INFO = {
                "handle"    : "dhs.org",