Message ID | 81dc1ed3-1179-42c6-784a-15f64a79508c@gmx.at |
---|---|
State | Dropped |
Headers |
Return-Path: <development-bounces@lists.ipfire.org> Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 47NvYw27Jcz43Tf for <patchwork@web04.haj.ipfire.org>; Thu, 28 Nov 2019 10:50:44 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 47NvYt2pXWz2Lp; Thu, 28 Nov 2019 10:50:42 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 47NvYt0rWfz2yBF; Thu, 28 Nov 2019 10:50:42 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 47NvYq5tnkz2xxq for <development@lists.ipfire.org>; Thu, 28 Nov 2019 10:50:39 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 47NvYq0X2Xz2Lp for <development@lists.ipfire.org>; Thu, 28 Nov 2019 10:50:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1574938218; bh=r1PSOniZvl9cmsfudw9K8eiPn8GTVl7Gwf/lUc8ahJk=; h=X-UI-Sender-Class:From:Subject:To:Date; b=F6p0FN+L/XS5BnCIvsqTVrcEO8Fn4aMIZ+uL4YsMH3bL9jLbaHBQa89BOZUpK1C0l a05ZLO9PM3HD0g3gtb9yDPeiFD36c2NTcAbqpxHzX3Z3Pbppm6YzE1/3JlIbWzPiLd xJkwpNAlQPHuasmJKYIenBb9GAcsc5K8/7IbkyJ8= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [10.50.100.33] ([91.112.5.67]) by mail.gmx.com (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MkHQh-1i7Ezs38ht-00kgF6 for <development@lists.ipfire.org>; Thu, 28 Nov 2019 11:45:09 +0100 From: Christof Weniger <ChristofWeniger@gmx.at> Subject: DDNS: add new Provider key-sytems.net (domaindiscount24) To: development@lists.ipfire.org Message-ID: <81dc1ed3-1179-42c6-784a-15f64a79508c@gmx.at> Date: Thu, 28 Nov 2019 11:45:08 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.1 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------26F1847DA41811B58B7322F2" Content-Language: en-US X-Provags-ID: V03:K1:kq1+nlMmZ4XHnfsv/wDPZMyxQDGiUnJEw6PkbRRIxoGCZNlgygs 5jakjvxsIyUgGULnyWQj3T48FGx+q0umg+foTwWcuo3tllF0zXvQjFcxPkGO2YFmigns2Lk 1MCxdrL62orCAvz/Lfs8gtPy6dxIV5TR+R2V2pjX8Br3Ox6qsfsK6OgwGY1OM73M/MVTaRY +OrbU4LovrDeuGmUpqzGg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:pfxJXcmUkHU=:tBPce2PQhXzJuWt8uXjWfy hAPzrOMhepZBEMLe9w/sDrZdj3tJenmzzA7Q5ixKiqLvsRqx1TS10p16ZBsgvQshYlonDPyf9 ymesW4Gg9VM6NJQguE7a497P5XYU2qodCswIHz2EmmRYyMlt+r8eVRKINJIqAmtQe66iDkK+z sFLKbdfF3UQ6eV7eKY96IXYVqMBtwT0mtEgdlHwOCe2WmlDIrrkECHTSOcXkgCQFU3qG54f/Q xRvfk5UVIliT5dKGi8jdnth8I/S2VOk4x8WEJjnU4DjG71xKvcqV3EzdgRvZammgivsuKaGIF Id1/VMvW6WIAy8AxR3mFRXeKYpiEH7+6nAG4EBwKOjdCwniPeb1+TmZ34o9D+UE3vLYv0YxP9 nuUE5z0gLIIREwHbylmnKubGwowUhHPo84ditgP01beWYuhmpsftrMUfAP6DkbxL1VIEDomr/ pUWC3LL3powMDDIyqZXUCT93dowivLzJ1wGBMLfzgqYFFk3NeRpi367QKUrqALxYcw61Yxj7Y ITvtc6BzYQiSd832QVddCzVNAtneeF3CxiukPwkJ6iT8jH6EpXPaqKXy28Sshnnj2oztBJOFM c68LRvdN2vZVa7EYWz3gXsdGx9vaCy1sAlnEcIiDnfN6QX5DpAh+DldLbMeUJjqGtrtNG8FAL dZ0MmMacafQUH3+8qZSk02FNAav7s11a0pH7mSLA3asLcDkOfZXK9RljHoKIW4PP+nn5eszsQ cg3gHAvXfUMg0BExXD8bnkU6zwtlX/OsfWQRs3Kt7G7xjAy1H9H/H4rZMtdDDS2lMn3GYecdw 41CSFkl7SaRzERIwiXPnZIEFGIGvJDSC6FG80zpjPypkcVvf+MBWMrhiyeW15XHnkf32a604L N3BK/oTGnLGf1X89MP/kBJSGd+idDfzjBjvNeF8Wg/bUNFGx8mOo/S+1zkmuTUxuRv3dRMhHI x/CpdSYpQHzQPMrSlpV8NtPklgksVikTVYlLVExV5YxSRud4bV9xDrDzknUGQSRUxCakq6JLx eFJP9skG3fEXnRwaGcy6B3IN/OrqmzNe8ZMXVmGvnhmKK2iOUbLW0WuHAuP3AKl3ukQbrU2vH Wa4dDUdvQnDcfOzhNo6fKThYKAcU/qdnN82unSlan9EdLsqAbjhj0LPe7CYdTnZqfpvszviW8 xSXlb1+Z3CK7GFQlX9f2BnQISTmINcQGNpPaTKrkaSHCqbkYRHXM2LozP8GJSZUeCVBDZb7la TtPpQXBENY0MliOx+fG5yjac2zQ0iPe1AXe8mRHOK7jrwdC7j4svXqU3Ey9I= Authentication-Results: mail01.ipfire.org; dkim=pass header.d=gmx.net header.s=badeba3b8450 header.b=F6p0FN+L; dmarc=none; spf=pass (mail01.ipfire.org: domain of ChristofWeniger@gmx.at designates 212.227.15.15 as permitted sender) smtp.mailfrom=ChristofWeniger@gmx.at X-Rspamd-Queue-Id: 47NvYq0X2Xz2Lp X-Spamd-Result: default: False [-3.40 / 11.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmx.net:s=badeba3b8450]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; FREEMAIL_FROM(0.00)[gmx.at]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/mixed,text/plain,text/x-patch]; PREVIOUSLY_DELIVERED(0.00)[development@lists.ipfire.org]; TO_DN_NONE(0.00)[]; HAS_ATTACHMENT(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; SENDER_REP_HAM(0.00)[asn: 8560(-0.19), country: DE(-0.01), ip: 212.227.15.15(0.00)]; DMARC_NA(0.00)[gmx.at]; R_SPF_ALLOW(-0.20)[+ip4:212.227.15.0/25]; DKIM_TRACE(0.00)[gmx.net:+]; MX_GOOD(-0.01)[cached: mx00.emig.gmx.net]; BAYES_HAM(-2.89)[99.52%]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:+]; FREEMAIL_ENVFROM(0.00)[gmx.at]; ASN(0.00)[asn:8560, ipnet:212.227.0.0/16, country:DE]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[212.227.15.15:from] X-Rspamd-Server: mail01.haj.ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk <development.lists.ipfire.org> List-Unsubscribe: <https://lists.ipfire.org/mailman/options/development>, <mailto:development-request@lists.ipfire.org?subject=unsubscribe> List-Archive: <http://lists.ipfire.org/pipermail/development/> List-Post: <mailto:development@lists.ipfire.org> List-Help: <mailto:development-request@lists.ipfire.org?subject=help> List-Subscribe: <https://lists.ipfire.org/mailman/listinfo/development>, <mailto:development-request@lists.ipfire.org?subject=subscribe> Errors-To: development-bounces@lists.ipfire.org Sender: "Development" <development-bounces@lists.ipfire.org> |
Series |
DDNS: add new Provider key-sytems.net (domaindiscount24)
|
|
Commit Message
Christof Weniger
Nov. 28, 2019, 10:45 a.m. UTC
Hi, I hope this is the correct way to submit this patch. https://www.domaindiscount24.com/ has its own ddns service runnning, which (for me) gets rid of the necessity of having to use an extra service for that. I tested the following patch on my system at home, and attached it to this mail. I started my quest at the community forum: https://community.ipfire.org/t/adding-new-ddns-provider/428/2 Christof
Comments
Hello Christof, > On 28 Nov 2019, at 10:45, Christof Weniger <ChristofWeniger@gmx.at> wrote: > > Hi, > > I hope this is the correct way to submit this patch. Yes, you found the right place. It would have been better to post the patch inline (and not as an attachment), so that I could have commented on it. > https://www.domaindiscount24.com/ has its own ddns service runnning, > which (for me) gets rid of the necessity of having to use an extra > service for that. > > I tested the following patch on my system at home, and attached it to > this mail. > > I started my quest at the community forum: > https://community.ipfire.org/t/adding-new-ddns-provider/428/2 > > Christof > > > > > > <add_key_systems_ddns.patch> I will make an exception here now and still give you my thoughts :) It looks like this is very close to the DynDNS protocol, so you can re-use that as some other providers do. Unfortunately this provider has no list of any possible responses - or maybe I have overlooked it. That can however be tested to check if those are still compatible with DynDNS. Finally, you are setting the IP addresses to “auto” which probably is not a good idea. I would prefer that it is explicitly being set. There is a function for it that finds out which one is the correct IP address. In the end I think this provider could look like “myonlineportal”: https://git.ipfire.org/?p=ddns.git;a=blob;f=src/ddns/providers.py;h=661fbcc57a5aecba0d958ec05c26296b3cef0d70;hb=HEAD#l1274 Best, -Michael
Hello Michael, after change to DynDNS class I got the following "DDNSUpdateError" Nov 28 13:42:17 minusrouter ddns[23192]: Dynamic DNS update for ovpn.XXXXX.YYY (dynamicdns.key-systems.net) failed: Nov 28 13:42:17 minusrouter ddns[23192]: DDNSUpdateError: The update could not be performed Nov 28 13:42:17 minusrouter ddns[23192]: Server response: [RESPONSE] code = 200 description = Command completed successfully queuetime = 0 runtime = 0.058 EOF The DynDNS2 code (generating the ERROR): class DDNSProviderKEYSYSTEMS(DDNSProtocolDynDNS2, DDNSProvider): handle = "dynamicdns.key-systems.net" name = "dynamicdns.key-systems.net" website = "https://domaindiscount24.com/" #protocols = ("ipv4",) # There are only information provided by the domaindiscount24 how to # perform an update with HTTP APIs # https://www.domaindiscount24.com/faq/dynamic-dns # examples: https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=auto # https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=213.x.x.x&mx=213.x.x.x url = "https://dynamicdns.key-systems.net/update.php" def prepare_request_data(self, proto): address = self.get_address(proto) data = { "hostname" : self.hostname, "password" : self.password, "ip" : address, "mx" : address, } return data The server response to a simple wget request was: [RESPONSE] code = 200 description = Command completed successfully queuetime = 0 runtime = 0.053 EOF The working code: class DDNSProviderKEYSYSTEMS(DDNSProvider): handle = "dynamicdns.key-systems.net" name = "dynamicdns.key-systems.net" website = "https://domaindiscount24.com/" protocols = ("ipv4",) # There are only information provided by the domaindiscount24 how to # perform an update with HTTP APIs # https://www.domaindiscount24.com/faq/dynamic-dns # examples: https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=auto # https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=213.x.x.x&mx=213.x.x.x url = "https://dynamicdns.key-systems.net/update.php" can_remove_records = False #def prepare_request_data(self, proto): def update_protocol(self, proto): address = self.get_address(proto) data = { "hostname" : self.hostname, "password" : self.password, "ip" : address, "mx" : address, } # Send update to the server. response = self.send_request(self.url, data=data) # Handle success messages. if response.code == 200: return # If we got here, some other update error happened. raise DDNSUpdateError #return data > Unfortunately this provider has no list of any possible responses - or maybe I have overlooked it. That can however be tested to check if those are still compatible with DynDNS. I couldn't find any more pointers on the providers page either, and for that testing I would have to dig in too deep (into the code and the protocols) for me to handle at the moment. (maybe next week/month). best Christof On 28/11/2019 12:20, Michael Tremer wrote: > Hello Christof, > >> On 28 Nov 2019, at 10:45, Christof Weniger <ChristofWeniger@gmx.at> wrote: >> >> Hi, >> >> I hope this is the correct way to submit this patch. > Yes, you found the right place. > > It would have been better to post the patch inline (and not as an attachment), so that I could have commented on it. > >> https://www.domaindiscount24.com/ has its own ddns service runnning, >> which (for me) gets rid of the necessity of having to use an extra >> service for that. >> >> I tested the following patch on my system at home, and attached it to >> this mail. >> >> I started my quest at the community forum: >> https://community.ipfire.org/t/adding-new-ddns-provider/428/2 >> >> Christof >> >> >> >> >> >> <add_key_systems_ddns.patch> > I will make an exception here now and still give you my thoughts :) > > It looks like this is very close to the DynDNS protocol, so you can re-use that as some other providers do. > > Unfortunately this provider has no list of any possible responses - or maybe I have overlooked it. That can however be tested to check if those are still compatible with DynDNS. > > Finally, you are setting the IP addresses to “auto” which probably is not a good idea. I would prefer that it is explicitly being set. There is a function for it that finds out which one is the correct IP address. > > In the end I think this provider could look like “myonlineportal”: https://git.ipfire.org/?p=ddns.git;a=blob;f=src/ddns/providers.py;h=661fbcc57a5aecba0d958ec05c26296b3cef0d70;hb=HEAD#l1274 > > Best, > -Michael <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> <div class="moz-cite-prefix">Hello Michael,<br> <br> after change to DynDNS class I got the following "DDNSUpdateError"<br> Nov 28 13:42:17 minusrouter ddns[23192]: Dynamic DNS update for ovpn.XXXXX.YYY (dynamicdns.key-systems.net) failed:<br> Nov 28 13:42:17 minusrouter ddns[23192]: DDNSUpdateError: The update could not be performed<br> Nov 28 13:42:17 minusrouter ddns[23192]: Server response: [RESPONSE] code = 200 description = Command completed successfully queuetime = 0 runtime = 0.058 EOF <br> <br> The DynDNS2 code (generating the ERROR):<br> <pre>class DDNSProviderKEYSYSTEMS(DDNSProtocolDynDNS2, DDNSProvider): handle = "dynamicdns.key-systems.net" name = "dynamicdns.key-systems.net" website = <a class="moz-txt-link-rfc2396E" href="https://domaindiscount24.com/">"https://domaindiscount24.com/"</a> #protocols = ("ipv4",) # There are only information provided by the domaindiscount24 how to # perform an update with HTTP APIs # <a class="moz-txt-link-freetext" href="https://www.domaindiscount24.com/faq/dynamic-dns">https://www.domaindiscount24.com/faq/dynamic-dns</a> # examples: <a class="moz-txt-link-freetext" href="https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=auto">https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=auto</a> # <a class="moz-txt-link-freetext" href="https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=213.x.x.x&mx=213.x.x.x">https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=213.x.x.x&mx=213.x.x.x</a> url = <a class="moz-txt-link-rfc2396E" href="https://dynamicdns.key-systems.net/update.php">"https://dynamicdns.key-systems.net/update.php"</a> def prepare_request_data(self, proto): address = self.get_address(proto) data = { "hostname" : self.hostname, "password" : self.password, "ip" : address, "mx" : address, } return data </pre> <br> The server response to a simple wget request was:<br> [RESPONSE]<br> code = 200<br> description = Command completed successfully<br> queuetime = 0<br> runtime = 0.053<br> EOF<br> <br> <br> The working code:<br> <br> <pre>class DDNSProviderKEYSYSTEMS(DDNSProvider): handle = "dynamicdns.key-systems.net" name = "dynamicdns.key-systems.net" website = <a class="moz-txt-link-rfc2396E" href="https://domaindiscount24.com/">"https://domaindiscount24.com/"</a> protocols = ("ipv4",) # There are only information provided by the domaindiscount24 how to # perform an update with HTTP APIs # <a class="moz-txt-link-freetext" href="https://www.domaindiscount24.com/faq/dynamic-dns">https://www.domaindiscount24.com/faq/dynamic-dns</a> # examples: <a class="moz-txt-link-freetext" href="https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=auto">https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=auto</a> # <a class="moz-txt-link-freetext" href="https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=213.x.x.x&mx=213.x.x.x">https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=213.x.x.x&mx=213.x.x.x</a> url = <a class="moz-txt-link-rfc2396E" href="https://dynamicdns.key-systems.net/update.php">"https://dynamicdns.key-systems.net/update.php"</a> can_remove_records = False #def prepare_request_data(self, proto): def update_protocol(self, proto): address = self.get_address(proto) data = { "hostname" : self.hostname, "password" : self.password, "ip" : address, "mx" : address, } # Send update to the server. response = self.send_request(self.url, data=data) # Handle success messages. if response.code == 200: return # If we got here, some other update error happened. raise DDNSUpdateError #return data </pre> <br> <pre class="moz-quote-pre" wrap=""><blockquote type="cite"><pre class="moz-quote-pre" wrap="">Unfortunately this provider has no list of any possible responses - or maybe I have overlooked it. That can however be tested to check if those are still compatible with DynDNS.</pre></blockquote>I couldn't find any more pointers on the providers page either, and for that testing I would have to dig in too deep (into the code and the protocols) for me to handle at the moment. (maybe next week/month). </pre> best<br> Christof<br> <br> On 28/11/2019 12:20, Michael Tremer wrote:<br> </div> <blockquote type="cite" cite="mid:4143661B-9526-49CE-AECD-7FD2E03D0DF7@ipfire.org"> <pre class="moz-quote-pre" wrap="">Hello Christof, </pre> <blockquote type="cite"> <pre class="moz-quote-pre" wrap="">On 28 Nov 2019, at 10:45, Christof Weniger <a class="moz-txt-link-rfc2396E" href="mailto:ChristofWeniger@gmx.at"><ChristofWeniger@gmx.at></a> wrote: Hi, I hope this is the correct way to submit this patch. </pre> </blockquote> <pre class="moz-quote-pre" wrap=""> Yes, you found the right place. It would have been better to post the patch inline (and not as an attachment), so that I could have commented on it. </pre> <blockquote type="cite"> <pre class="moz-quote-pre" wrap=""><a class="moz-txt-link-freetext" href="https://www.domaindiscount24.com/">https://www.domaindiscount24.com/</a> has its own ddns service runnning, which (for me) gets rid of the necessity of having to use an extra service for that. I tested the following patch on my system at home, and attached it to this mail. I started my quest at the community forum: <a class="moz-txt-link-freetext" href="https://community.ipfire.org/t/adding-new-ddns-provider/428/2">https://community.ipfire.org/t/adding-new-ddns-provider/428/2</a> Christof <add_key_systems_ddns.patch> </pre> </blockquote> <pre class="moz-quote-pre" wrap=""> I will make an exception here now and still give you my thoughts :) It looks like this is very close to the DynDNS protocol, so you can re-use that as some other providers do. Unfortunately this provider has no list of any possible responses - or maybe I have overlooked it. That can however be tested to check if those are still compatible with DynDNS. Finally, you are setting the IP addresses to “auto” which probably is not a good idea. I would prefer that it is explicitly being set. There is a function for it that finds out which one is the correct IP address. In the end I think this provider could look like “myonlineportal”: <a class="moz-txt-link-freetext" href="https://git.ipfire.org/?p=ddns.git;a=blob;f=src/ddns/providers.py;h=661fbcc57a5aecba0d958ec05c26296b3cef0d70;hb=HEAD#l1274">https://git.ipfire.org/?p=ddns.git;a=blob;f=src/ddns/providers.py;h=661fbcc57a5aecba0d958ec05c26296b3cef0d70;hb=HEAD#l1274</a> Best, -Michael</pre> </blockquote> <br> </body> </html>
Hi, Thanks for testing this. Looks like I was very wrong here. > On 28 Nov 2019, at 13:03, Christof Weniger <ChristofWeniger@gmx.at> wrote: > > Hello Michael, > > after change to DynDNS class I got the following "DDNSUpdateError" > Nov 28 13:42:17 minusrouter ddns[23192]: Dynamic DNS update for ovpn.XXXXX.YYY (dynamicdns.key-systems.net) failed: > Nov 28 13:42:17 minusrouter ddns[23192]: DDNSUpdateError: The update could not be performed > Nov 28 13:42:17 minusrouter ddns[23192]: Server response: [RESPONSE] code = 200 description = Command completed successfully queuetime = 0 runtime = 0.058 EOF > > The DynDNS2 code (generating the ERROR): > class DDNSProviderKEYSYSTEMS(DDNSProtocolDynDNS2, DDNSProvider): > handle = "dynamicdns.key-systems.net" > name = "dynamicdns.key-systems.net" > website = > "https://domaindiscount24.com/" > > #protocols = ("ipv4",) > > # There are only information provided by the domaindiscount24 how to > # perform an update with HTTP APIs > # > https://www.domaindiscount24.com/faq/dynamic-dns > > # examples: > https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=auto > > # > https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=213.x.x.x&mx=213.x.x.x > > > url = > "https://dynamicdns.key-systems.net/update.php" > > > def prepare_request_data(self, proto): > address = self.get_address(proto) > data = { > "hostname" : self.hostname, > "password" : self.password, > "ip" : address, > "mx" : address, I wouldn’t set the MX record here. First of all it should not contain an IP address and so it can be statically configured. I consider this being outside of the scope of ddns. > } > > return data > > > The server response to a simple wget request was: > [RESPONSE] > code = 200 > description = Command completed successfully > queuetime = 0 > runtime = 0.053 > EOF > > > The working code: > > class DDNSProviderKEYSYSTEMS(DDNSProvider): > handle = "dynamicdns.key-systems.net" > name = "dynamicdns.key-systems.net" > website = > "https://domaindiscount24.com/" > > protocols = ("ipv4",) > > # There are only information provided by the domaindiscount24 how to > # perform an update with HTTP APIs > # > https://www.domaindiscount24.com/faq/dynamic-dns > > # examples: > https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=auto > > # > https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=213.x.x.x&mx=213.x.x.x > > > url = > "https://dynamicdns.key-systems.net/update.php" > > can_remove_records = False > > #def prepare_request_data(self, proto): > def update_protocol(self, proto): > address = self.get_address(proto) > data = { > "hostname" : self.hostname, > "password" : self.password, > "ip" : address, > "mx" : address, See above. > } > > # Send update to the server. > response = self.send_request(self.url, data=data) > > # Handle success messages. > if response.code == 200: > return This is just very vage. > > # If we got here, some other update error happened. > raise DDNSUpdateError There must be other responses - one might hope. Did you check sending an incorrect password and do you get 401 or 403 at least? > > #return data > > >> Unfortunately this provider has no list of any possible responses - or maybe I have overlooked it. That can however be tested to check if those are still compatible with DynDNS. > I couldn't find any more pointers on the providers page either, and for that testing I would have to dig in too deep (into the code and the protocols) for me to handle at the moment. (maybe next week/month). Yes, so great to not have any documentation… -Michael > > > best > Christof > > On 28/11/2019 12:20, Michael Tremer wrote: >> Hello Christof, >> >> >>> On 28 Nov 2019, at 10:45, Christof Weniger <ChristofWeniger@gmx.at> >>> wrote: >>> >>> Hi, >>> >>> I hope this is the correct way to submit this patch. >>> >> Yes, you found the right place. >> >> It would have been better to post the patch inline (and not as an attachment), so that I could have commented on it. >> >> >>> https://www.domaindiscount24.com/ >>> has its own ddns service runnning, >>> which (for me) gets rid of the necessity of having to use an extra >>> service for that. >>> >>> I tested the following patch on my system at home, and attached it to >>> this mail. >>> >>> I started my quest at the community forum: >>> >>> https://community.ipfire.org/t/adding-new-ddns-provider/428/2 >>> >>> >>> Christof >>> >>> >>> >>> >>> >>> <add_key_systems_ddns.patch> >>> >> I will make an exception here now and still give you my thoughts :) >> >> It looks like this is very close to the DynDNS protocol, so you can re-use that as some other providers do. >> >> Unfortunately this provider has no list of any possible responses - or maybe I have overlooked it. That can however be tested to check if those are still compatible with DynDNS. >> >> Finally, you are setting the IP addresses to “auto” which probably is not a good idea. I would prefer that it is explicitly being set. There is a function for it that finds out which one is the correct IP address. >> >> In the end I think this provider could look like “myonlineportal”: >> https://git.ipfire.org/?p=ddns.git;a=blob;f=src/ddns/providers.py;h=661fbcc57a5aecba0d958ec05c26296b3cef0d70;hb=HEAD#l1274 >> >> >> Best, >> -Michael >> >
Hi, OK I removed the mx entry (I was not aware, that there can be a FQDN instead of an IP) I did some more tests and it seems the server always responds with HTTP 200 In error cases (wrong Password, wrong url) I got the following responses: * wrong url: Error: Permanent error in command 'UpdateDynamicDNS': Authorization failed * wrong password: Error: Permanent error in command 'UpdateDynamicDNS': Authorization failed; invalid password * after too many tries: Error: Permanent error in command 'UpdateDynamicDNS': Authorization failed; abuse prevention triggered; please wait 1763 seconds to resubmit the new patch: diff --git a/README b/README index c75c448..b6decb3 100644 --- a/README +++ b/README @@ -72,6 +72,7 @@ SUPPORTED PROVIDERS: inwx.com|de|at|ch|es itsdns.de joker.com + key-systems.net loopia.se myonlineportal.net namecheap.com diff --git a/src/ddns/providers.py b/src/ddns/providers.py index 661fbcc..f70f49a 100644 --- a/src/ddns/providers.py +++ b/src/ddns/providers.py @@ -1204,6 +1204,52 @@ class DDNSProviderJoker(DDNSProtocolDynDNS2, DDNSProvider): url = "https://svc.joker.com/nic/update" +class DDNSProviderKEYSYSTEMS(DDNSProvider): + handle = "key-systems.net" + name = "dynamicdns.key-systems.net" + website = "https://domaindiscount24.com/" + protocols = ("ipv4",) + + # There are only information provided by the domaindiscount24 how to + # perform an update with HTTP APIs + # https://www.domaindiscount24.com/faq/dynamic-dns + # examples: https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=auto + # https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=213.x.x.x&mx=213.x.x.x + + url = "https://dynamicdns.key-systems.net/update.php" + can_remove_records = False + + def update_protocol(self, proto): + address = self.get_address(proto) + data = { + "hostname" : self.hostname, + "password" : self.password, + "ip" : address, + } + + # 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 "code = 200" in output: + return + + # Handle error messages. + if "abuse prevention triggered" in output: + raise DDNSRequestError(_("Too many failed requests")) + if "invalid password" in output: + raise DDNSAuthenticationError + elif "Authorization failed" in output: + raise DDNSRequestError(_("Invalid hostname specified")) + + # If we got here, some other update error happened. + raise DDNSUpdateError + + + class DDNSProviderGoogle(DDNSProtocolDynDNS2, DDNSProvider): handle = "domains.google.com" name = "Google Domains" best Christof On 28/11/2019 14:35, Michael Tremer wrote: > Hi, > > Thanks for testing this. Looks like I was very wrong here. > >> On 28 Nov 2019, at 13:03, Christof Weniger <ChristofWeniger@gmx.at> wrote: >> >> Hello Michael, >> >> after change to DynDNS class I got the following "DDNSUpdateError" >> Nov 28 13:42:17 minusrouter ddns[23192]: Dynamic DNS update for ovpn.XXXXX.YYY (dynamicdns.key-systems.net) failed: >> Nov 28 13:42:17 minusrouter ddns[23192]: DDNSUpdateError: The update could not be performed >> Nov 28 13:42:17 minusrouter ddns[23192]: Server response: [RESPONSE] code = 200 description = Command completed successfully queuetime = 0 runtime = 0.058 EOF >> >> The DynDNS2 code (generating the ERROR): >> class DDNSProviderKEYSYSTEMS(DDNSProtocolDynDNS2, DDNSProvider): >> handle = "dynamicdns.key-systems.net" >> name = "dynamicdns.key-systems.net" >> website = >> "https://domaindiscount24.com/" >> >> #protocols = ("ipv4",) >> >> # There are only information provided by the domaindiscount24 how to >> # perform an update with HTTP APIs >> # >> https://www.domaindiscount24.com/faq/dynamic-dns >> >> # examples: >> https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=auto >> >> # >> https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=213.x.x.x&mx=213.x.x.x >> >> >> url = >> "https://dynamicdns.key-systems.net/update.php" >> >> >> def prepare_request_data(self, proto): >> address = self.get_address(proto) >> data = { >> "hostname" : self.hostname, >> "password" : self.password, >> "ip" : address, >> "mx" : address, > I wouldn’t set the MX record here. First of all it should not contain an IP address and so it can be statically configured. I consider this being outside of the scope of ddns. > >> } >> >> return data >> >> >> The server response to a simple wget request was: >> [RESPONSE] >> code = 200 >> description = Command completed successfully >> queuetime = 0 >> runtime = 0.053 >> EOF >> >> >> The working code: >> >> class DDNSProviderKEYSYSTEMS(DDNSProvider): >> handle = "dynamicdns.key-systems.net" >> name = "dynamicdns.key-systems.net" >> website = >> "https://domaindiscount24.com/" >> >> protocols = ("ipv4",) >> >> # There are only information provided by the domaindiscount24 how to >> # perform an update with HTTP APIs >> # >> https://www.domaindiscount24.com/faq/dynamic-dns >> >> # examples: >> https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=auto >> >> # >> https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=213.x.x.x&mx=213.x.x.x >> >> >> url = >> "https://dynamicdns.key-systems.net/update.php" >> >> can_remove_records = False >> >> #def prepare_request_data(self, proto): >> def update_protocol(self, proto): >> address = self.get_address(proto) >> data = { >> "hostname" : self.hostname, >> "password" : self.password, >> "ip" : address, >> "mx" : address, > See above. > >> } >> >> # Send update to the server. >> response = self.send_request(self.url, data=data) >> >> # Handle success messages. >> if response.code == 200: >> return > This is just very vage. > >> # If we got here, some other update error happened. >> raise DDNSUpdateError > There must be other responses - one might hope. > > Did you check sending an incorrect password and do you get 401 or 403 at least? > >> #return data >> >> >>> Unfortunately this provider has no list of any possible responses - or maybe I have overlooked it. That can however be tested to check if those are still compatible with DynDNS. >> I couldn't find any more pointers on the providers page either, and for that testing I would have to dig in too deep (into the code and the protocols) for me to handle at the moment. (maybe next week/month). > Yes, so great to not have any documentation… > > -Michael > >> >> best >> Christof >> >> On 28/11/2019 12:20, Michael Tremer wrote: >>> Hello Christof, >>> >>> >>>> On 28 Nov 2019, at 10:45, Christof Weniger <ChristofWeniger@gmx.at> >>>> wrote: >>>> >>>> Hi, >>>> >>>> I hope this is the correct way to submit this patch. >>>> >>> Yes, you found the right place. >>> >>> It would have been better to post the patch inline (and not as an attachment), so that I could have commented on it. >>> >>> >>>> https://www.domaindiscount24.com/ >>>> has its own ddns service runnning, >>>> which (for me) gets rid of the necessity of having to use an extra >>>> service for that. >>>> >>>> I tested the following patch on my system at home, and attached it to >>>> this mail. >>>> >>>> I started my quest at the community forum: >>>> >>>> https://community.ipfire.org/t/adding-new-ddns-provider/428/2 >>>> >>>> >>>> Christof >>>> >>>> >>>> >>>> >>>> >>>> <add_key_systems_ddns.patch> >>>> >>> I will make an exception here now and still give you my thoughts :) >>> >>> It looks like this is very close to the DynDNS protocol, so you can re-use that as some other providers do. >>> >>> Unfortunately this provider has no list of any possible responses - or maybe I have overlooked it. That can however be tested to check if those are still compatible with DynDNS. >>> >>> Finally, you are setting the IP addresses to “auto” which probably is not a good idea. I would prefer that it is explicitly being set. There is a function for it that finds out which one is the correct IP address. >>> >>> In the end I think this provider could look like “myonlineportal”: >>> https://git.ipfire.org/?p=ddns.git;a=blob;f=src/ddns/providers.py;h=661fbcc57a5aecba0d958ec05c26296b3cef0d70;hb=HEAD#l1274 >>> >>> >>> Best, >>> -Michael >>> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> <div class="moz-cite-prefix">Hi,<br> <br> OK I removed the mx entry (I was not aware, that there can be a FQDN instead of an IP)<br> <br> I did some more tests and it seems the server always responds with HTTP 200<br> <br> In error cases (wrong Password, wrong url) I got the following responses:<br> <ul> <li>wrong url:</li> </ul> <pre>Error: Permanent error in command 'UpdateDynamicDNS': Authorization failed </pre> <ul> <li>wrong password:</li> </ul> <pre>Error: Permanent error in command 'UpdateDynamicDNS': Authorization failed; invalid password </pre> <ul> <li>after too many tries:<br> </li> </ul> <pre>Error: Permanent error in command 'UpdateDynamicDNS': Authorization failed; abuse prevention triggered; please wait 1763 seconds to resubmit </pre> the new patch:<br> <pre>diff --git a/README b/README index c75c448..b6decb3 100644 --- a/README +++ b/README @@ -72,6 +72,7 @@ SUPPORTED PROVIDERS: inwx.com|de|at|ch|es itsdns.de joker.com + key-systems.net loopia.se myonlineportal.net namecheap.com diff --git a/src/ddns/providers.py b/src/ddns/providers.py index 661fbcc..f70f49a 100644 --- a/src/ddns/providers.py +++ b/src/ddns/providers.py @@ -1204,6 +1204,52 @@ class DDNSProviderJoker(DDNSProtocolDynDNS2, DDNSProvider): url = <a class="moz-txt-link-rfc2396E" href="https://svc.joker.com/nic/update">"https://svc.joker.com/nic/update"</a> +class DDNSProviderKEYSYSTEMS(DDNSProvider): + handle = "key-systems.net" + name = "dynamicdns.key-systems.net" + website = <a class="moz-txt-link-rfc2396E" href="https://domaindiscount24.com/">"https://domaindiscount24.com/"</a> + protocols = ("ipv4",) + + # There are only information provided by the domaindiscount24 how to + # perform an update with HTTP APIs + # <a class="moz-txt-link-freetext" href="https://www.domaindiscount24.com/faq/dynamic-dns">https://www.domaindiscount24.com/faq/dynamic-dns</a> + # examples: <a class="moz-txt-link-freetext" href="https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=auto">https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=auto</a> + # <a class="moz-txt-link-freetext" href="https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=213.x.x.x&mx=213.x.x.x">https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=213.x.x.x&mx=213.x.x.x</a> + + url = <a class="moz-txt-link-rfc2396E" href="https://dynamicdns.key-systems.net/update.php">"https://dynamicdns.key-systems.net/update.php"</a> + can_remove_records = False + + def update_protocol(self, proto): + address = self.get_address(proto) + data = { + "hostname" : self.hostname, + "password" : self.password, + "ip" : address, + } + + # 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 "code = 200" in output: + return + + # Handle error messages. + if "abuse prevention triggered" in output: + raise DDNSRequestError(_("Too many failed requests")) + if "invalid password" in output: + raise DDNSAuthenticationError + elif "Authorization failed" in output: + raise DDNSRequestError(_("Invalid hostname specified")) + + # If we got here, some other update error happened. + raise DDNSUpdateError + + + class DDNSProviderGoogle(DDNSProtocolDynDNS2, DDNSProvider): handle = "domains.google.com" name = "Google Domains" </pre> <pre> </pre> best<br> Christof<br> <br> On 28/11/2019 14:35, Michael Tremer wrote:<br> </div> <blockquote type="cite" cite="mid:A5EAE6C1-8701-45D8-B643-F83577552DC7@ipfire.org"> <pre class="moz-quote-pre" wrap="">Hi, Thanks for testing this. Looks like I was very wrong here. </pre> <blockquote type="cite"> <pre class="moz-quote-pre" wrap="">On 28 Nov 2019, at 13:03, Christof Weniger <a class="moz-txt-link-rfc2396E" href="mailto:ChristofWeniger@gmx.at"><ChristofWeniger@gmx.at></a> wrote: Hello Michael, after change to DynDNS class I got the following "DDNSUpdateError" Nov 28 13:42:17 minusrouter ddns[23192]: Dynamic DNS update for ovpn.XXXXX.YYY (dynamicdns.key-systems.net) failed: Nov 28 13:42:17 minusrouter ddns[23192]: DDNSUpdateError: The update could not be performed Nov 28 13:42:17 minusrouter ddns[23192]: Server response: [RESPONSE] code = 200 description = Command completed successfully queuetime = 0 runtime = 0.058 EOF The DynDNS2 code (generating the ERROR): class DDNSProviderKEYSYSTEMS(DDNSProtocolDynDNS2, DDNSProvider): handle = "dynamicdns.key-systems.net" name = "dynamicdns.key-systems.net" website = <a class="moz-txt-link-rfc2396E" href="https://domaindiscount24.com/">"https://domaindiscount24.com/"</a> #protocols = ("ipv4",) # There are only information provided by the domaindiscount24 how to # perform an update with HTTP APIs # <a class="moz-txt-link-freetext" href="https://www.domaindiscount24.com/faq/dynamic-dns">https://www.domaindiscount24.com/faq/dynamic-dns</a> # examples: <a class="moz-txt-link-freetext" href="https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=auto">https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=auto</a> # <a class="moz-txt-link-freetext" href="https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=213.x.x.x&mx=213.x.x.x">https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=213.x.x.x&mx=213.x.x.x</a> url = <a class="moz-txt-link-rfc2396E" href="https://dynamicdns.key-systems.net/update.php">"https://dynamicdns.key-systems.net/update.php"</a> def prepare_request_data(self, proto): address = self.get_address(proto) data = { "hostname" : self.hostname, "password" : self.password, "ip" : address, "mx" : address, </pre> </blockquote> <pre class="moz-quote-pre" wrap=""> I wouldn’t set the MX record here. First of all it should not contain an IP address and so it can be statically configured. I consider this being outside of the scope of ddns. </pre> <blockquote type="cite"> <pre class="moz-quote-pre" wrap=""> } return data The server response to a simple wget request was: [RESPONSE] code = 200 description = Command completed successfully queuetime = 0 runtime = 0.053 EOF The working code: class DDNSProviderKEYSYSTEMS(DDNSProvider): handle = "dynamicdns.key-systems.net" name = "dynamicdns.key-systems.net" website = <a class="moz-txt-link-rfc2396E" href="https://domaindiscount24.com/">"https://domaindiscount24.com/"</a> protocols = ("ipv4",) # There are only information provided by the domaindiscount24 how to # perform an update with HTTP APIs # <a class="moz-txt-link-freetext" href="https://www.domaindiscount24.com/faq/dynamic-dns">https://www.domaindiscount24.com/faq/dynamic-dns</a> # examples: <a class="moz-txt-link-freetext" href="https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=auto">https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=auto</a> # <a class="moz-txt-link-freetext" href="https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=213.x.x.x&mx=213.x.x.x">https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=213.x.x.x&mx=213.x.x.x</a> url = <a class="moz-txt-link-rfc2396E" href="https://dynamicdns.key-systems.net/update.php">"https://dynamicdns.key-systems.net/update.php"</a> can_remove_records = False #def prepare_request_data(self, proto): def update_protocol(self, proto): address = self.get_address(proto) data = { "hostname" : self.hostname, "password" : self.password, "ip" : address, "mx" : address, </pre> </blockquote> <pre class="moz-quote-pre" wrap=""> See above. </pre> <blockquote type="cite"> <pre class="moz-quote-pre" wrap=""> } # Send update to the server. response = self.send_request(self.url, data=data) # Handle success messages. if response.code == 200: return </pre> </blockquote> <pre class="moz-quote-pre" wrap=""> This is just very vage. </pre> <blockquote type="cite"> <pre class="moz-quote-pre" wrap=""> # If we got here, some other update error happened. raise DDNSUpdateError </pre> </blockquote> <pre class="moz-quote-pre" wrap=""> There must be other responses - one might hope. Did you check sending an incorrect password and do you get 401 or 403 at least? </pre> <blockquote type="cite"> <pre class="moz-quote-pre" wrap=""> #return data </pre> <blockquote type="cite"> <pre class="moz-quote-pre" wrap="">Unfortunately this provider has no list of any possible responses - or maybe I have overlooked it. That can however be tested to check if those are still compatible with DynDNS. </pre> </blockquote> <pre class="moz-quote-pre" wrap="">I couldn't find any more pointers on the providers page either, and for that testing I would have to dig in too deep (into the code and the protocols) for me to handle at the moment. (maybe next week/month). </pre> </blockquote> <pre class="moz-quote-pre" wrap=""> Yes, so great to not have any documentation… -Michael </pre> <blockquote type="cite"> <pre class="moz-quote-pre" wrap=""> best Christof On 28/11/2019 12:20, Michael Tremer wrote: </pre> <blockquote type="cite"> <pre class="moz-quote-pre" wrap="">Hello Christof, </pre> <blockquote type="cite"> <pre class="moz-quote-pre" wrap="">On 28 Nov 2019, at 10:45, Christof Weniger <a class="moz-txt-link-rfc2396E" href="mailto:ChristofWeniger@gmx.at"><ChristofWeniger@gmx.at></a> wrote: Hi, I hope this is the correct way to submit this patch. </pre> </blockquote> <pre class="moz-quote-pre" wrap="">Yes, you found the right place. It would have been better to post the patch inline (and not as an attachment), so that I could have commented on it. </pre> <blockquote type="cite"> <pre class="moz-quote-pre" wrap=""><a class="moz-txt-link-freetext" href="https://www.domaindiscount24.com/">https://www.domaindiscount24.com/</a> has its own ddns service runnning, which (for me) gets rid of the necessity of having to use an extra service for that. I tested the following patch on my system at home, and attached it to this mail. I started my quest at the community forum: <a class="moz-txt-link-freetext" href="https://community.ipfire.org/t/adding-new-ddns-provider/428/2">https://community.ipfire.org/t/adding-new-ddns-provider/428/2</a> Christof <add_key_systems_ddns.patch> </pre> </blockquote> <pre class="moz-quote-pre" wrap="">I will make an exception here now and still give you my thoughts :) It looks like this is very close to the DynDNS protocol, so you can re-use that as some other providers do. Unfortunately this provider has no list of any possible responses - or maybe I have overlooked it. That can however be tested to check if those are still compatible with DynDNS. Finally, you are setting the IP addresses to “auto” which probably is not a good idea. I would prefer that it is explicitly being set. There is a function for it that finds out which one is the correct IP address. In the end I think this provider could look like “myonlineportal”: <a class="moz-txt-link-freetext" href="https://git.ipfire.org/?p=ddns.git;a=blob;f=src/ddns/providers.py;h=661fbcc57a5aecba0d958ec05c26296b3cef0d70;hb=HEAD#l1274">https://git.ipfire.org/?p=ddns.git;a=blob;f=src/ddns/providers.py;h=661fbcc57a5aecba0d958ec05c26296b3cef0d70;hb=HEAD#l1274</a> Best, -Michael </pre> </blockquote> <pre class="moz-quote-pre" wrap=""> </pre> </blockquote> <pre class="moz-quote-pre" wrap=""> </pre> </blockquote> <br> </body> </html> diff --git a/README b/README index c75c448..b6decb3 100644 --- a/README +++ b/README @@ -72,6 +72,7 @@ SUPPORTED PROVIDERS: inwx.com|de|at|ch|es itsdns.de joker.com + key-systems.net loopia.se myonlineportal.net namecheap.com diff --git a/src/ddns/providers.py b/src/ddns/providers.py index 661fbcc..f70f49a 100644 --- a/src/ddns/providers.py +++ b/src/ddns/providers.py @@ -1204,6 +1204,52 @@ class DDNSProviderJoker(DDNSProtocolDynDNS2, DDNSProvider): url = "https://svc.joker.com/nic/update" +class DDNSProviderKEYSYSTEMS(DDNSProvider): + handle = "key-systems.net" + name = "dynamicdns.key-systems.net" + website = "https://domaindiscount24.com/" + protocols = ("ipv4",) + + # There are only information provided by the domaindiscount24 how to + # perform an update with HTTP APIs + # https://www.domaindiscount24.com/faq/dynamic-dns + # examples: https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=auto + # https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=213.x.x.x&mx=213.x.x.x + + url = "https://dynamicdns.key-systems.net/update.php" + can_remove_records = False + + def update_protocol(self, proto): + address = self.get_address(proto) + data = { + "hostname" : self.hostname, + "password" : self.password, + "ip" : address, + } + + # 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 "code = 200" in output: + return + + # Handle error messages. + if "abuse prevention triggered" in output: + raise DDNSRequestError(_("Too many failed requests")) + if "invalid password" in output: + raise DDNSAuthenticationError + elif "Authorization failed" in output: + raise DDNSRequestError(_("Invalid hostname specified")) + + # If we got here, some other update error happened. + raise DDNSUpdateError + + + class DDNSProviderGoogle(DDNSProtocolDynDNS2, DDNSProvider): handle = "domains.google.com" name = "Google Domains"
Hi, > On 28 Nov 2019, at 14:58, Christof Weniger <ChristofWeniger@gmx.at> wrote: > > Hi, > > OK I removed the mx entry (I was not aware, that there can be a FQDN instead of an IP) > > I did some more tests and it seems the server always responds with HTTP 200 That is horrible :) > In error cases (wrong Password, wrong url) I got the following responses: > • wrong url: > Error: Permanent error in command 'UpdateDynamicDNS': Authorization failed > > • wrong password: > Error: Permanent error in command 'UpdateDynamicDNS': Authorization failed; invalid password > > • after too many tries: > Error: Permanent error in command 'UpdateDynamicDNS': Authorization failed; abuse prevention triggered; please wait 1763 seconds to resubmit > > > > the new patch: > diff --git a/README b/README > index c75c448..b6decb3 100644 > --- a/README > +++ b/README > @@ -72,6 +72,7 @@ SUPPORTED PROVIDERS: > inwx.com|de|at|ch|es > itsdns.de > joker.com > + key-systems.net > loopia.se > myonlineportal.net > namecheap.com > diff --git a/src/ddns/providers.py b/src/ddns/providers.py > index 661fbcc..f70f49a 100644 > --- a/src/ddns/providers.py > +++ b/src/ddns/providers.py > @@ -1204,6 +1204,52 @@ class DDNSProviderJoker(DDNSProtocolDynDNS2, DDNSProvider): > url = > "https://svc.joker.com/nic/update" > > > > +class DDNSProviderKEYSYSTEMS(DDNSProvider): > + handle = "key-systems.net" > + name = "dynamicdns.key-systems.net" > + website = > "https://domaindiscount24.com/" > > + protocols = ("ipv4",) > + > + # There are only information provided by the domaindiscount24 how to > + # perform an update with HTTP APIs > + # > https://www.domaindiscount24.com/faq/dynamic-dns > > + # examples: > https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=auto > > + # > https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=213.x.x.x&mx=213.x.x.x > > + > + url = > "https://dynamicdns.key-systems.net/update.php" > > + can_remove_records = False > + > + def update_protocol(self, proto): > + address = self.get_address(proto) > + data = { > + "hostname" : self.hostname, > + "password" : self.password, > + "ip" : address, > + } > + > + # 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 "code = 200" in output: > + return > + > + # Handle error messages. > + if "abuse prevention triggered" in output: > + raise DDNSRequestError(_("Too many failed requests")) We have DDNSAbuseError which should be raised here. There is no need for any extra messages here. > + if "invalid password" in output: > + raise DDNSAuthenticationError This could be an elif as well. > + elif "Authorization failed" in output: > + raise DDNSRequestError(_("Invalid hostname specified")) Also it is very great that they are telling an attacker what they have guessed correctly. > + # If we got here, some other update error happened. > + raise DDNSUpdateError So this was an inline patch now. Good. It is very nice to be able to comment on individual sections and lines. However, there should be more meta information (like who sent the patch and a commit message). Did you ever use git send-email? https://wiki.ipfire.org/devel/submit-patches https://wiki.ipfire.org/devel/git/setup Best, -Michael > + > + > + > class DDNSProviderGoogle(DDNSProtocolDynDNS2, DDNSProvider): > handle = "domains.google.com" > name = "Google Domains" > > best > Christof > > On 28/11/2019 14:35, Michael Tremer wrote: >> Hi, >> >> Thanks for testing this. Looks like I was very wrong here. >> >> >>> On 28 Nov 2019, at 13:03, Christof Weniger <ChristofWeniger@gmx.at> >>> wrote: >>> >>> Hello Michael, >>> >>> after change to DynDNS class I got the following "DDNSUpdateError" >>> Nov 28 13:42:17 minusrouter ddns[23192]: Dynamic DNS update for ovpn.XXXXX.YYY (dynamicdns.key-systems.net) failed: >>> Nov 28 13:42:17 minusrouter ddns[23192]: DDNSUpdateError: The update could not be performed >>> Nov 28 13:42:17 minusrouter ddns[23192]: Server response: [RESPONSE] code = 200 description = Command completed successfully queuetime = 0 runtime = 0.058 EOF >>> >>> The DynDNS2 code (generating the ERROR): >>> class DDNSProviderKEYSYSTEMS(DDNSProtocolDynDNS2, DDNSProvider): >>> handle = "dynamicdns.key-systems.net" >>> name = "dynamicdns.key-systems.net" >>> website = >>> >>> "https://domaindiscount24.com/" >>> >>> >>> #protocols = ("ipv4",) >>> >>> # There are only information provided by the domaindiscount24 how to >>> # perform an update with HTTP APIs >>> # >>> >>> https://www.domaindiscount24.com/faq/dynamic-dns >>> >>> >>> # examples: >>> >>> https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=auto >>> >>> >>> # >>> >>> https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=213.x.x.x&mx=213.x.x.x >>> >>> >>> >>> url = >>> >>> "https://dynamicdns.key-systems.net/update.php" >>> >>> >>> >>> def prepare_request_data(self, proto): >>> address = self.get_address(proto) >>> data = { >>> "hostname" : self.hostname, >>> "password" : self.password, >>> "ip" : address, >>> "mx" : address, >>> >> I wouldn’t set the MX record here. First of all it should not contain an IP address and so it can be statically configured. I consider this being outside of the scope of ddns. >> >> >>> } >>> >>> return data >>> >>> >>> The server response to a simple wget request was: >>> [RESPONSE] >>> code = 200 >>> description = Command completed successfully >>> queuetime = 0 >>> runtime = 0.053 >>> EOF >>> >>> >>> The working code: >>> >>> class DDNSProviderKEYSYSTEMS(DDNSProvider): >>> handle = "dynamicdns.key-systems.net" >>> name = "dynamicdns.key-systems.net" >>> website = >>> >>> "https://domaindiscount24.com/" >>> >>> >>> protocols = ("ipv4",) >>> >>> # There are only information provided by the domaindiscount24 how to >>> # perform an update with HTTP APIs >>> # >>> >>> https://www.domaindiscount24.com/faq/dynamic-dns >>> >>> >>> # examples: >>> >>> https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=auto >>> >>> >>> # >>> >>> https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=213.x.x.x&mx=213.x.x.x >>> >>> >>> >>> url = >>> >>> "https://dynamicdns.key-systems.net/update.php" >>> >>> >>> can_remove_records = False >>> >>> #def prepare_request_data(self, proto): >>> def update_protocol(self, proto): >>> address = self.get_address(proto) >>> data = { >>> "hostname" : self.hostname, >>> "password" : self.password, >>> "ip" : address, >>> "mx" : address, >>> >> See above. >> >> >>> } >>> >>> # Send update to the server. >>> response = self.send_request(self.url, data=data) >>> >>> # Handle success messages. >>> if response.code == 200: >>> return >>> >> This is just very vage. >> >> >>> # If we got here, some other update error happened. >>> raise DDNSUpdateError >>> >> There must be other responses - one might hope. >> >> Did you check sending an incorrect password and do you get 401 or 403 at least? >> >> >>> #return data >>> >>> >>> >>>> Unfortunately this provider has no list of any possible responses - or maybe I have overlooked it. That can however be tested to check if those are still compatible with DynDNS. >>>> >>> I couldn't find any more pointers on the providers page either, and for that testing I would have to dig in too deep (into the code and the protocols) for me to handle at the moment. (maybe next week/month). >>> >> Yes, so great to not have any documentation… >> >> -Michael >> >> >>> >>> best >>> Christof >>> >>> On 28/11/2019 12:20, Michael Tremer wrote: >>> >>>> Hello Christof, >>>> >>>> >>>> >>>>> On 28 Nov 2019, at 10:45, Christof Weniger <ChristofWeniger@gmx.at> >>>>> >>>>> wrote: >>>>> >>>>> Hi, >>>>> >>>>> I hope this is the correct way to submit this patch. >>>>> >>>>> >>>> Yes, you found the right place. >>>> >>>> It would have been better to post the patch inline (and not as an attachment), so that I could have commented on it. >>>> >>>> >>>> >>>>> https://www.domaindiscount24.com/ >>>>> >>>>> has its own ddns service runnning, >>>>> which (for me) gets rid of the necessity of having to use an extra >>>>> service for that. >>>>> >>>>> I tested the following patch on my system at home, and attached it to >>>>> this mail. >>>>> >>>>> I started my quest at the community forum: >>>>> >>>>> >>>>> https://community.ipfire.org/t/adding-new-ddns-provider/428/2 >>>>> >>>>> >>>>> >>>>> Christof >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> <add_key_systems_ddns.patch> >>>>> >>>>> >>>> I will make an exception here now and still give you my thoughts :) >>>> >>>> It looks like this is very close to the DynDNS protocol, so you can re-use that as some other providers do. >>>> >>>> Unfortunately this provider has no list of any possible responses - or maybe I have overlooked it. That can however be tested to check if those are still compatible with DynDNS. >>>> >>>> Finally, you are setting the IP addresses to “auto” which probably is not a good idea. I would prefer that it is explicitly being set. There is a function for it that finds out which one is the correct IP address. >>>> >>>> In the end I think this provider could look like “myonlineportal”: >>>> >>>> https://git.ipfire.org/?p=ddns.git;a=blob;f=src/ddns/providers.py;h=661fbcc57a5aecba0d958ec05c26296b3cef0d70;hb=HEAD#l1274 >>>> >>>> >>>> >>>> Best, >>>> -Michael >>>> >>>> > > <add_key_systems_ddns.patch>
diff --git a/README b/README index c75c448..b6decb3 100644 --- a/README +++ b/README @@ -72,6 +72,7 @@ SUPPORTED PROVIDERS: inwx.com|de|at|ch|es itsdns.de joker.com + key-systems.net loopia.se myonlineportal.net namecheap.com diff --git a/src/ddns/providers.py b/src/ddns/providers.py index 661fbcc..ccbf5e5 100644 --- a/src/ddns/providers.py +++ b/src/ddns/providers.py @@ -1204,6 +1204,40 @@ class DDNSProviderJoker(DDNSProtocolDynDNS2, DDNSProvider): url = "https://svc.joker.com/nic/update" +class DDNSProviderKEYSYSTEMS(DDNSProvider): + handle = "dynamicdns.key-systems.net" + name = "dynamicdns.key-systems.net" + website = "https://domaindiscount24.com/" + protocols = ("ipv4",) + + # There are only information provided by the domaindiscount24 how to + # perform an update with HTTP APIs + # https://www.domaindiscount24.com/faq/dynamic-dns + # examples: https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=auto + # https://dynamicdns.key-systems.net/update.php?hostname=hostname&password=password&ip=213.x.x.x&mx=213.x.x.x + + url = "https://dynamicdns.key-systems.net/update.php" + can_remove_records = False + + def update_protocol(self, proto): + data = { + "hostname" : self.hostname, + "password" : self.password, + "ip" : "auto", + } + + # Send update to the server. + response = self.send_request(self.url, data=data) + + # Handle success messages. + if response.code == 200: + return + + # If we got here, some other update error happened. + raise DDNSUpdateError + + + class DDNSProviderGoogle(DDNSProtocolDynDNS2, DDNSProvider): handle = "domains.google.com" name = "Google Domains"