# Handle error codes.
if output == "badauth":
raise DDNSAuthenticationError
- elif output == "aduse":
+ elif output == "abuse":
raise DDNSAbuseError
elif output == "notfqdn":
raise DDNSRequestError(_("No valid FQDN was given."))
raise DDNSInternalServerError
elif output == "dnserr":
raise DDNSInternalServerError(_("DNS error encountered."))
+ elif output == "badagent":
+ raise DDNSBlockedError
# If we got here, some other update error happened.
raise DDNSUpdateError(_("Server response: %s") % output)
url = "http://dyndns.domopoli.de/nic/update"
+class DDNSProviderDynsNet(DDNSProvider):
+ handle = "dyns.net"
+ name = "DyNS"
+ website = "http://www.dyns.net/"
+ protocols = ("ipv4",)
+
+ # There is very detailed informatio about how to send the update request and
+ # the possible response codes. (Currently we are using the v1.1 proto)
+ # http://www.dyns.net/documentation/technical/protocol/
+
+ url = "http://www.dyns.net/postscript011.php"
+
+ def update(self):
+ data = {
+ "ip" : self.get_address("ipv4"),
+ "host" : 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("200"):
+ return
+
+ # Handle error codes.
+ if output.startswith("400"):
+ raise DDNSRequestError(_("Malformed request has been sent."))
+ elif output.startswith("401"):
+ raise DDNSAuthenticationError
+ elif output.startswith("402"):
+ raise DDNSRequestError(_("Too frequent update requests have been sent."))
+ elif output.startswith("403"):
+ raise DDNSInternalServerError
+
+ # If we got here, some other update error happened.
+ raise DDNSUpdateError(_("Server response: %s") % output)
+
+
class DDNSProviderEnomCom(DDNSResponseParserXML, DDNSProvider):
handle = "enom.com"
name = "eNom Inc."
class DDNSProviderNsupdateINFO(DDNSProtocolDynDNS2, DDNSProvider):
handle = "nsupdate.info"
name = "nsupdate.info"
- website = "http://www.nsupdate.info/"
+ website = "http://nsupdate.info/"
protocols = ("ipv6", "ipv4",)
# Information about the format of the HTTP request can be found
- # after login on the provider user intrface and here:
+ # after login on the provider user interface and here:
# http://nsupdateinfo.readthedocs.org/en/latest/user.html
# Nsupdate.info uses the hostname as user part for the HTTP basic auth,
url = "https://update.spdns.de/nic/update"
+ @property
+ def username(self):
+ return self.get("username") or self.hostname
+
+ @property
+ def password(self):
+ return self.get("username") or self.token
+
class DDNSProviderStrato(DDNSProtocolDynDNS2, DDNSProvider):
handle = "strato.com"
# If we got here, some other update error happened.
raise DDNSUpdateError
+
+
+class DDNSProviderZZZZ(DDNSProvider):
+ handle = "zzzz.io"
+ name = "zzzz"
+ website = "https://zzzz.io"
+ protocols = ("ipv4",)
+
+ # Detailed information about the update request can be found here:
+ # https://zzzz.io/faq/
+
+ # Details about the possible response codes have been provided in the bugtracker:
+ # https://bugzilla.ipfire.org/show_bug.cgi?id=10584#c2
+
+ url = "https://zzzz.io/api/v1/update"
+
+ def update(self):
+ data = {
+ "ip" : self.get_address("ipv4"),
+ "token" : self.token,
+ }
+
+ # zzzz uses the host from the full hostname as part
+ # of the update url.
+ host, domain = self.hostname.split(".", 1)
+
+ # Add host value to the update url.
+ url = "%s/%s" % (self.url, host)
+
+ # Send update to the server.
+ try:
+ response = self.send_request(url, data=data)
+
+ # Handle error codes.
+ except DDNSNotFound:
+ raise DDNSRequestError(_("Invalid hostname specified"))
+
+ # Handle success messages.
+ if response.code == 200:
+ return
+
+ # If we got here, some other update error happened.
+ raise DDNSUpdateError