Fixes freedns.afraid.org ddns provider

Message ID CAHoP+V_80YMyvMrkfOtCf1e7W8c2WBOAUejOZ+ZvUSTg5f_afQ@mail.gmail.com
State Superseded
Headers
Series Fixes freedns.afraid.org ddns provider |

Commit Message

Kashif Iftikhar Jan. 22, 2021, 12:59 p.m. UTC
  ------------------------BEGIN PATCH---------------------------
From ed8e4a9e53cbd24e4a0450e3a8aa1c12359cbe2e Mon Sep 17 00:00:00 2001
From: Kashif Iftikhar <kashif@compulife.com.pk>
Date: Fri, 22 Jan 2021 17:33:01 +0500
Subject: [PATCH 1/1] fixes freedns.afraid.org provider.

The URL for syncing had changed and now does not require sending the ip
with the request.

Signed-off-by: Kashif Iftikhar <kashif@compulife.com.pk>
---
 src/ddns/providers.py | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

         # Handle error codes.
--
2.25.1


------------------------END PATCH---------------------------

Regards.
Kashif Iftikhar
http://kashif.compulife.com.pk
  

Comments

Michael Tremer Jan. 22, 2021, 1:03 p.m. UTC | #1
Hello Kashif,

Thank you for your email.

If the data argument is no longer required, you should remove it entirely instead of just commenting it out.

Otherwise this looks good.

Best,
-Michael

> On 22 Jan 2021, at 12:59, Kashif Iftikhar <kashif@compulife.com.pk> wrote:
> 
> ------------------------BEGIN PATCH---------------------------
> From ed8e4a9e53cbd24e4a0450e3a8aa1c12359cbe2e Mon Sep 17 00:00:00 2001
> From: Kashif Iftikhar <kashif@compulife.com.pk>
> Date: Fri, 22 Jan 2021 17:33:01 +0500
> Subject: [PATCH 1/1] fixes freedns.afraid.org provider.
> 
> The URL for syncing had changed and now does not require sending the ip
> with the request.
> 
> Signed-off-by: Kashif Iftikhar <kashif@compulife.com.pk>
> ---
> src/ddns/providers.py | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/src/ddns/providers.py b/src/ddns/providers.py
> index 56e6620..6feef33 100644
> --- a/src/ddns/providers.py
> +++ b/src/ddns/providers.py
> @@ -1186,26 +1186,26 @@ class DDNSProviderFreeDNSAfraidOrg(DDNSProvider):
> 
>     # No information about the request or response could be found on the vendor
>     # page. All used values have been collected by testing.
> -    url = "https://freedns.afraid.org/dynamic/update.php"
> +    url = "https://sync.afraid.org/u/"
>     can_remove_records = False
>     supports_token_auth = True
> 
>     def update_protocol(self, proto):
> -        data = {
> -            "address" : self.get_address(proto),
> -        }
> +        # data = {
> +        #     "address" : self.get_address(proto),
> +        # }
> 
>         # Add auth token to the update url.
> -        url = "%s?%s" % (self.url, self.token)
> +        url = "%s%s/" % (self.url, self.token)
> 
>         # Send update to the server.
> -        response = self.send_request(url, data=data)
> +        response = self.send_request(url)
> 
>         # Get the full response message.
>         output = response.read().decode()
> 
>         # Handle success messages.
> -        if output.startswith("Updated") or "has not changed" in output:
> +        if output.startswith("Updated") or output.startswith("No IP
> change detected"):
>             return
> 
>         # Handle error codes.
> --
> 2.25.1
> 
> 
> ------------------------END PATCH---------------------------
> 
> Regards.
> Kashif Iftikhar
> http://kashif.compulife.com.pk
> _______________________________________________
> ddns mailing list
> ddns@lists.ipfire.org
> https://lists.ipfire.org/mailman/listinfo/ddns
  
Michael Tremer Jan. 25, 2021, 6:17 p.m. UTC | #2
Hi,

Thank you for updating the patch, but I think this is now what you wanted.

The data= argument is back again and so we will send some data to the server which the server won’t know what to do with.

You probably wanted to remove this, didn’t you?

-Michael

> On 22 Jan 2021, at 13:27, Kashif Iftikhar <kashif@compulife.com.pk> wrote:
> 
> Hello Michael,
> 
> Thank you for the feedback, I've sent updated (corrected) patch to ddns list.
> 
> On Fri, Jan 22, 2021 at 6:03 PM Michael Tremer
> <michael.tremer@ipfire.org> wrote:
>> 
>> Hello Kashif,
>> 
>> Thank you for your email.
>> 
>> If the data argument is no longer required, you should remove it entirely instead of just commenting it out.
>> 
>> Otherwise this looks good.
>> 
>> Best,
>> -Michael
>> 
>>> On 22 Jan 2021, at 12:59, Kashif Iftikhar <kashif@compulife.com.pk> wrote:
>>> 
>>> ------------------------BEGIN PATCH---------------------------
>>> From ed8e4a9e53cbd24e4a0450e3a8aa1c12359cbe2e Mon Sep 17 00:00:00 2001
>>> From: Kashif Iftikhar <kashif@compulife.com.pk>
>>> Date: Fri, 22 Jan 2021 17:33:01 +0500
>>> Subject: [PATCH 1/1] fixes freedns.afraid.org provider.
>>> 
>>> The URL for syncing had changed and now does not require sending the ip
>>> with the request.
>>> 
>>> Signed-off-by: Kashif Iftikhar <kashif@compulife.com.pk>
>>> ---
>>> src/ddns/providers.py | 14 +++++++-------
>>> 1 file changed, 7 insertions(+), 7 deletions(-)
>>> 
>>> diff --git a/src/ddns/providers.py b/src/ddns/providers.py
>>> index 56e6620..6feef33 100644
>>> --- a/src/ddns/providers.py
>>> +++ b/src/ddns/providers.py
>>> @@ -1186,26 +1186,26 @@ class DDNSProviderFreeDNSAfraidOrg(DDNSProvider):
>>> 
>>>    # No information about the request or response could be found on the vendor
>>>    # page. All used values have been collected by testing.
>>> -    url = "https://freedns.afraid.org/dynamic/update.php"
>>> +    url = "https://sync.afraid.org/u/"
>>>    can_remove_records = False
>>>    supports_token_auth = True
>>> 
>>>    def update_protocol(self, proto):
>>> -        data = {
>>> -            "address" : self.get_address(proto),
>>> -        }
>>> +        # data = {
>>> +        #     "address" : self.get_address(proto),
>>> +        # }
>>> 
>>>        # Add auth token to the update url.
>>> -        url = "%s?%s" % (self.url, self.token)
>>> +        url = "%s%s/" % (self.url, self.token)
>>> 
>>>        # Send update to the server.
>>> -        response = self.send_request(url, data=data)
>>> +        response = self.send_request(url)
>>> 
>>>        # Get the full response message.
>>>        output = response.read().decode()
>>> 
>>>        # Handle success messages.
>>> -        if output.startswith("Updated") or "has not changed" in output:
>>> +        if output.startswith("Updated") or output.startswith("No IP
>>> change detected"):
>>>            return
>>> 
>>>        # Handle error codes.
>>> --
>>> 2.25.1
>>> 
>>> 
>>> ------------------------END PATCH---------------------------
>>> 
>>> Regards.
>>> Kashif Iftikhar
>>> http://kashif.compulife.com.pk
>>> _______________________________________________
>>> ddns mailing list
>>> ddns@lists.ipfire.org
>>> https://lists.ipfire.org/mailman/listinfo/ddns
>> 
> 
> 
> -- 
> Kashif Iftikhar
> http://kashif.compulife.com.pk
  
Kashif Iftikhar Jan. 25, 2021, 6:49 p.m. UTC | #3
Hi,

I think you're looking at the older email. The updated patch I posted
does not have the data argument. Pasting it here again just for
reference

------------------------BEGIN PATCH---------------------------
>From ca4865f02594666fc7e1a4578db3465555aae860 Mon Sep 17 00:00:00 2001
From: Kashif Iftikhar <kashif at compulife.com.pk>
Date: Fri, 22 Jan 2021 18:24:03 +0500
Subject: [PATCH 1/1] fixes freedns.afraid.org provider.

The URL for syncing had changed and now does not require sending the ip
with the request.

Signed-off-by: Kashif Iftikhar <kashif at compulife.com.pk>
---
 src/ddns/providers.py | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/ddns/providers.py b/src/ddns/providers.py
index 56e6620..98d2747 100644
--- a/src/ddns/providers.py
+++ b/src/ddns/providers.py
@@ -1186,26 +1186,22 @@ class DDNSProviderFreeDNSAfraidOrg(DDNSProvider):

     # No information about the request or response could be found on the vendor
     # page. All used values have been collected by testing.
-    url = "https://freedns.afraid.org/dynamic/update.php"
+    url = "https://sync.afraid.org/u/"
     can_remove_records = False
     supports_token_auth = True

     def update_protocol(self, proto):
-        data = {
-            "address" : self.get_address(proto),
-        }
-
         # Add auth token to the update url.
-        url = "%s?%s" % (self.url, self.token)
+        url = "%s%s/" % (self.url, self.token)

         # Send update to the server.
-        response = self.send_request(url, data=data)
+        response = self.send_request(url)

         # Get the full response message.
         output = response.read().decode()

         # Handle success messages.
-        if output.startswith("Updated") or "has not changed" in output:
+        if output.startswith("Updated") or output.startswith("No IP
change detected"):
             return

         # Handle error codes.
  
Michael Tremer Jan. 25, 2021, 7:18 p.m. UTC | #4
Hello,

You might be right.

This one is the correct one:

  https://patchwork.ipfire.org/patch/3816/

@Stefan: Can you merge this and tag a release?

Best,
-Michael

> On 25 Jan 2021, at 18:49, Kashif Iftikhar <kashif@compulife.com.pk> wrote:
> 
> Hi,
> 
> I think you're looking at the older email. The updated patch I posted
> does not have the data argument. Pasting it here again just for
> reference
> 
> ------------------------BEGIN PATCH---------------------------
>> From ca4865f02594666fc7e1a4578db3465555aae860 Mon Sep 17 00:00:00 2001
> From: Kashif Iftikhar <kashif at compulife.com.pk>
> Date: Fri, 22 Jan 2021 18:24:03 +0500
> Subject: [PATCH 1/1] fixes freedns.afraid.org provider.
> 
> The URL for syncing had changed and now does not require sending the ip
> with the request.
> 
> Signed-off-by: Kashif Iftikhar <kashif at compulife.com.pk>
> ---
> src/ddns/providers.py | 12 ++++--------
> 1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/src/ddns/providers.py b/src/ddns/providers.py
> index 56e6620..98d2747 100644
> --- a/src/ddns/providers.py
> +++ b/src/ddns/providers.py
> @@ -1186,26 +1186,22 @@ class DDNSProviderFreeDNSAfraidOrg(DDNSProvider):
> 
>     # No information about the request or response could be found on the vendor
>     # page. All used values have been collected by testing.
> -    url = "https://freedns.afraid.org/dynamic/update.php"
> +    url = "https://sync.afraid.org/u/"
>     can_remove_records = False
>     supports_token_auth = True
> 
>     def update_protocol(self, proto):
> -        data = {
> -            "address" : self.get_address(proto),
> -        }
> -
>         # Add auth token to the update url.
> -        url = "%s?%s" % (self.url, self.token)
> +        url = "%s%s/" % (self.url, self.token)
> 
>         # Send update to the server.
> -        response = self.send_request(url, data=data)
> +        response = self.send_request(url)
> 
>         # Get the full response message.
>         output = response.read().decode()
> 
>         # Handle success messages.
> -        if output.startswith("Updated") or "has not changed" in output:
> +        if output.startswith("Updated") or output.startswith("No IP
> change detected"):
>             return
> 
>         # Handle error codes.
> -- 
> 2.25.1
> 
> 
> ------------------------END PATCH---------------------------
> 
> Regards.
> 
> On Mon, Jan 25, 2021 at 11:17 PM Michael Tremer
> <michael.tremer@ipfire.org> wrote:
>> 
>> Hi,
>> 
>> Thank you for updating the patch, but I think this is now what you wanted.
>> 
>> The data= argument is back again and so we will send some data to the server which the server won’t know what to do with.
>> 
>> You probably wanted to remove this, didn’t you?
>> 
>> -Michael
>> 
>>> On 22 Jan 2021, at 13:27, Kashif Iftikhar <kashif@compulife.com.pk> wrote:
>>> 
>>> Hello Michael,
>>> 
>>> Thank you for the feedback, I've sent updated (corrected) patch to ddns list.
>>> 
>>> On Fri, Jan 22, 2021 at 6:03 PM Michael Tremer
>>> <michael.tremer@ipfire.org> wrote:
>>>> 
>>>> Hello Kashif,
>>>> 
>>>> Thank you for your email.
>>>> 
>>>> If the data argument is no longer required, you should remove it entirely instead of just commenting it out.
>>>> 
>>>> Otherwise this looks good.
>>>> 
>>>> Best,
>>>> -Michael
>>>> 
>>>>> On 22 Jan 2021, at 12:59, Kashif Iftikhar <kashif@compulife.com.pk> wrote:
>>>>> 
>>>>> ------------------------BEGIN PATCH---------------------------
>>>>> From ed8e4a9e53cbd24e4a0450e3a8aa1c12359cbe2e Mon Sep 17 00:00:00 2001
>>>>> From: Kashif Iftikhar <kashif@compulife.com.pk>
>>>>> Date: Fri, 22 Jan 2021 17:33:01 +0500
>>>>> Subject: [PATCH 1/1] fixes freedns.afraid.org provider.
>>>>> 
>>>>> The URL for syncing had changed and now does not require sending the ip
>>>>> with the request.
>>>>> 
>>>>> Signed-off-by: Kashif Iftikhar <kashif@compulife.com.pk>
>>>>> ---
>>>>> src/ddns/providers.py | 14 +++++++-------
>>>>> 1 file changed, 7 insertions(+), 7 deletions(-)
>>>>> 
>>>>> diff --git a/src/ddns/providers.py b/src/ddns/providers.py
>>>>> index 56e6620..6feef33 100644
>>>>> --- a/src/ddns/providers.py
>>>>> +++ b/src/ddns/providers.py
>>>>> @@ -1186,26 +1186,26 @@ class DDNSProviderFreeDNSAfraidOrg(DDNSProvider):
>>>>> 
>>>>>   # No information about the request or response could be found on the vendor
>>>>>   # page. All used values have been collected by testing.
>>>>> -    url = "https://freedns.afraid.org/dynamic/update.php"
>>>>> +    url = "https://sync.afraid.org/u/"
>>>>>   can_remove_records = False
>>>>>   supports_token_auth = True
>>>>> 
>>>>>   def update_protocol(self, proto):
>>>>> -        data = {
>>>>> -            "address" : self.get_address(proto),
>>>>> -        }
>>>>> +        # data = {
>>>>> +        #     "address" : self.get_address(proto),
>>>>> +        # }
>>>>> 
>>>>>       # Add auth token to the update url.
>>>>> -        url = "%s?%s" % (self.url, self.token)
>>>>> +        url = "%s%s/" % (self.url, self.token)
>>>>> 
>>>>>       # Send update to the server.
>>>>> -        response = self.send_request(url, data=data)
>>>>> +        response = self.send_request(url)
>>>>> 
>>>>>       # Get the full response message.
>>>>>       output = response.read().decode()
>>>>> 
>>>>>       # Handle success messages.
>>>>> -        if output.startswith("Updated") or "has not changed" in output:
>>>>> +        if output.startswith("Updated") or output.startswith("No IP
>>>>> change detected"):
>>>>>           return
>>>>> 
>>>>>       # Handle error codes.
>>>>> --
>>>>> 2.25.1
>>>>> 
>>>>> 
>>>>> ------------------------END PATCH---------------------------
>>>>> 
>>>>> Regards.
>>>>> Kashif Iftikhar
>>>>> http://kashif.compulife.com.pk
>>>>> _______________________________________________
>>>>> ddns mailing list
>>>>> ddns@lists.ipfire.org
>>>>> https://lists.ipfire.org/mailman/listinfo/ddns
>>>> 
>>> 
>>> 
>>> --
>>> Kashif Iftikhar
>>> http://kashif.compulife.com.pk
>> 
> 
> 
> -- 
> Kashif Iftikhar
> http://kashif.compulife.com.pk
  

Patch

diff --git a/src/ddns/providers.py b/src/ddns/providers.py
index 56e6620..6feef33 100644
--- a/src/ddns/providers.py
+++ b/src/ddns/providers.py
@@ -1186,26 +1186,26 @@  class DDNSProviderFreeDNSAfraidOrg(DDNSProvider):

     # No information about the request or response could be found on the vendor
     # page. All used values have been collected by testing.
-    url = "https://freedns.afraid.org/dynamic/update.php"
+    url = "https://sync.afraid.org/u/"
     can_remove_records = False
     supports_token_auth = True

     def update_protocol(self, proto):
-        data = {
-            "address" : self.get_address(proto),
-        }
+        # data = {
+        #     "address" : self.get_address(proto),
+        # }

         # Add auth token to the update url.
-        url = "%s?%s" % (self.url, self.token)
+        url = "%s%s/" % (self.url, self.token)

         # Send update to the server.
-        response = self.send_request(url, data=data)
+        response = self.send_request(url)

         # Get the full response message.
         output = response.read().decode()

         # Handle success messages.
-        if output.startswith("Updated") or "has not changed" in output:
+        if output.startswith("Updated") or output.startswith("No IP
change detected"):
             return