From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonatan Schlag To: ddns@lists.ipfire.org Subject: [PATCH 1/2] Add new provider Servercow Date: Fri, 10 Feb 2017 15:37:47 +0100 Message-ID: <1486737468-22661-1-git-send-email-jonatan.schlag@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7869625407209558799==" List-Id: --===============7869625407209558799== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Tested-by: Jonatan Schlag Signed-off-by: Jonatan Schlag --- src/ddns/providers.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/ddns/providers.py b/src/ddns/providers.py index 2c30d42..01d7827 100644 --- a/src/ddns/providers.py +++ b/src/ddns/providers.py @@ -1452,6 +1452,41 @@ class DDNSProviderSelfhost(DDNSProtocolDynDNS2, DDNSPr= ovider): return data =20 =20 +class DDNSProviderServercow(DDNSProvider): + handle =3D "servercow.de" + name =3D "servercow.de" + website =3D "https://servercow.de/" + protocols =3D ("ipv4", "ipv6") + + url =3D "https://www.servercow.de/dnsupdate/update.php" + can_remove_records =3D False + + def update_protocol(self, proto): + data =3D { + "ipaddr" : self.get_address(proto), + "hostname" : self.hostname, + "username" : self.username, + "pass" : self.password, + } + + # Send request to provider + response =3D self.send_request(self.url, data=3Ddata) + + # Read response + output =3D 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 =3D "spdns.org" name =3D "SPDYN" --=20 2.7.4 --===============7869625407209558799==--