[SOLVED] Dyndns for provider Loopia broken

Started by magnust, November 15, 2017, 12:52:05 PM

Previous topic - Next topic
November 15, 2017, 12:52:05 PM Last Edit: November 22, 2017, 06:06:28 AM by franco
Hi all!

I'm a long time user of pfsense now switching over to opnsense.

The service "loopia" in dyndns is not handling wildcards properly which makes the call to update the ip instead ending up erasing the CNAME in loopias end rendering our web site unreachable.



Here's the code AFAIK in /usr/local/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc

case 'loopia':
   curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
   curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser.':'.$this->_dnsPass);
   curl_setopt($ch, CURLOPT_URL, 'https://dns.loopia.se/XDynDNSServer/XDynDNS.php?hostname='.$this->_dnsHost.'&myip='.$this->_dnsIP);
   break;


As you can see it doesn't even check the wildcard setting.

An important note: This functionality is broken in pfsense since many years back but due to a different problem in that code. More info here https://forum.pfsense.org/index.php?topic=138826

What is the best way to get this into a todo fix list?




PS: I can't find any way to edit files from the web GUI, am I blind or is there no such option?

Hi Magnust,

There is no file editor on the GUI, only able to change files from the console or SSH.

Typically, broken or new dyndns, I ask for a test account access to fix the issue(s) or others provide patches themselves via GitHub, whatever works best. In one instance we did this for 2 Chinese providers. It was fun to get those working without being able to understand any of their documentation. :)

In any case, very willing to look at it. For account details, just message me via PM.


Cheers,
Franco

Hey, great if it could be added/changed to this. This code is tested and works fine with Loopia and wildcard on or off:

case 'loopia':
    if (isset($this->_dnsWildcard) && $this->_dnsWildcard == TRUE) $this->_dnsWildcard = "ON"; else $this->_dnsWildcard = "OFF";            
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser.':'.$this->_dnsPass);
    curl_setopt($ch, CURLOPT_URL, 'https://dns.loopia.se/XDynDNSServer/XDynDNS.php?hostname='.$this->_dnsHost.'&myip='.$this->_dnsIP . '&wildcard='.$this->_dnsWildcard);
    break;



Note! This commonly used line below should not be used, it's been tested and does NOT work:
if (isset($this->_dnsWildcard) && $this->_dnsWildcard != "OFF") $this->_dnsWildcard = "ON";

This line is tested and DOES work:
if (isset($this->_dnsWildcard) && $this->_dnsWildcard == TRUE) $this->_dnsWildcard = "ON"; else $this->_dnsWildcard = "OFF";

More on this issue if interested found here: https://forum.pfsense.org/index.php?topic=138826


Thanks!!!




PS:
Here's how Loopia REALLY wants us to update their DynDNS:
https://support.loopia.se/wp-content/uploads/2017/02/dyndns_loopia.py_.txt

Can you try this patch? https://github.com/opnsense/plugins/commit/8b663af

Apply from the console with:

# opnsense-patch -c plugins 8b663af


Cheers,
Franco

 ;D

Works like a charm. Tried with both wildcard on and off and everything updates as it should. Beatiful!

Thank you!!!

Hi magnust,

The update is not in 17.7.8 today, but will follow in 17.7.9, so you may need to apply the patch manually again.

Thank you for the report and testing!


Cheers,
Franco


FWIW, your modifications will not be overwritten by the 17.7.8 upgrade. I tested this to make sure. :)


Cheers,
Franco

November 22, 2017, 02:06:02 PM #8 Last Edit: November 22, 2017, 04:40:55 PM by magnust
Ah! Making my life easy are you   ;D




EDIT: Can confirm, the edit wasn't removed by 17.7.8