From mboxrd@z Thu Jan  1 00:00:00 1970
From: Michael Tremer <michael.tremer@ipfire.org>
To: ddns@lists.ipfire.org
Subject: [PATCH] Add support for dy.fi
Date: Thu, 28 Jun 2018 12:01:53 +0100
Message-ID: <20180628110153.1776493-1-michael.tremer@ipfire.org>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============0556161998232606427=="
List-Id: <ddns.lists.ipfire.org>

--===============0556161998232606427==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

From: Mauno Pirnes <mauno.pirnes(a)kotinet.com>

DyFi is a provider from Finland that only allows to point dynamic
DNS records to IP addresses that are registered in Finland.

Signed-off-by: Michael Tremer <michael.tremer(a)ipfire.org>
---
 README                |  1 +
 src/ddns/providers.py | 20 ++++++++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/README b/README
index d1708584cb14..02ac926762ce 100644
--- a/README
+++ b/README
@@ -60,6 +60,7 @@ SUPPORTED PROVIDERS:
 	domopoli.de
 	dtdns.com
 	duckdns.org
+	dy.fi
 	dyndns.org
 	dyns.cx|net
 	dynu.com
diff --git a/src/ddns/providers.py b/src/ddns/providers.py
index ea723e591667..828787872c18 100644
--- a/src/ddns/providers.py
+++ b/src/ddns/providers.py
@@ -400,6 +400,8 @@ class DDNSProtocolDynDNS2(object):
 			raise DDNSInternalServerError(_("DNS error encountered"))
 		elif output =3D=3D "badagent":
 			raise DDNSBlockedError
+		elif output =3D=3D "badip":
+			raise DDNSBlockedError
=20
 		# If we got here, some other update error happened.
 		raise DDNSUpdateError(_("Server response: %s") % output)
@@ -828,6 +830,24 @@ class DDNSProviderDuckDNS(DDNSProtocolDynDNS2, DDNSProvi=
der):
 	url =3D "https://www.duckdns.org/nic/update"
=20
=20
+class DDNSProviderDyFi(DDNSProtocolDynDNS2, DDNSProvider):
+	handle    =3D "dy.fi"
+	name      =3D "dy.fi"
+	website   =3D "https://www.dy.fi/"
+	protocols =3D ("ipv4",)
+
+	# Information about the format of the request is to be found
+	# https://www.dy.fi/page/clients?lang=3Den
+	# https://www.dy.fi/page/specification?lang=3Den
+
+	url =3D "http://www.dy.fi/nic/update"
+
+	# Please only send automatic updates when your IP address changes,
+	# or once per 5 to 6 days to refresh the address mapping (they will
+	# expire if not refreshed within 7 days).
+	holdoff_days =3D 6
+
+
 class DDNSProviderDynDNS(DDNSProtocolDynDNS2, DDNSProvider):
 	handle    =3D "dyndns.org"
 	name      =3D "Dyn"
--=20
2.17.1


--===============0556161998232606427==--