From e3525be05c19985ae97fe2035798eade9541d089 Mon Sep 17 00:00:00 2001 From: oaehmka <71215943+oaehmka@users.noreply.github.com> Date: Tue, 3 Jun 2025 16:32:05 +0200 Subject: [PATCH 1/2] deduplicate code --- src/usr/local/www/services_dyndns_edit.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/usr/local/www/services_dyndns_edit.php b/src/usr/local/www/services_dyndns_edit.php index 93638c0a83a..87de3633e00 100644 --- a/src/usr/local/www/services_dyndns_edit.php +++ b/src/usr/local/www/services_dyndns_edit.php @@ -663,6 +663,7 @@ function setVisible(service) { hideInput('zoneid', false); hideInput('ttl', false); break; + case "dnsmadeeasy": case "domeneshop": case "domeneshop-v6": case "dreamhost": @@ -670,6 +671,7 @@ function setVisible(service) { case "dyfi": case "nicru": case "nicru-v6": + case "strato": hideInput('mx', true); hideCheckbox('wildcard', true); break; @@ -709,11 +711,6 @@ function setVisible(service) { hideInput('zoneid', false); hideInput('ttl', false); break; - case "strato": - case "dnsmadeeasy": - hideInput('mx', true); - hideCheckbox('wildcard', true); - break; default: } } From 96e649aeebd0ac28c11d9e73487021b75dcf1987 Mon Sep 17 00:00:00 2001 From: oaehmka <71215943+oaehmka@users.noreply.github.com> Date: Tue, 3 Jun 2025 16:37:26 +0200 Subject: [PATCH 2/2] add infomaniak dyndns option (tested) --- src/etc/inc/dyndns.class | 13 +++++++++++++ src/etc/inc/services.inc | 4 ++-- src/usr/local/www/services_dyndns_edit.php | 1 + 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/etc/inc/dyndns.class b/src/etc/inc/dyndns.class index 050b3c228a7..07b73ab3b6d 100644 --- a/src/etc/inc/dyndns.class +++ b/src/etc/inc/dyndns.class @@ -65,6 +65,7 @@ * - HE.net Tunnelbroker IP update (ipv4.tunnelbroker.net) * - HN (hn.org) -- incomplete checking! * - Hover (www.hover.com) + * - Infomaniak (infomaniak.com) * - Loopia (loopia.se) * - LuaDNS (luadns.com) * - Name.com (name.com) @@ -134,6 +135,7 @@ * HE.net Tunnel - Last Tested: 28 June 2011 * HN.org - Last Tested: 12 July 2005 * Hover - Last Tested: 15 February 2017 + * Infomaniak - Last Tested: 03 June 2025 * Loopia - Last Tested: 21 August 2019 * LuaDNS - Last Tested: 20 March 2025 * Name.com - Last Tested: 5 Dec 2021 @@ -494,6 +496,7 @@ case 'he-net-v6': case 'hn': case 'hover': + case 'infomaniak': case 'linode': case 'linode-v6': case 'luadns': @@ -617,6 +620,13 @@ curl_setopt($ch, CURLOPT_URL, $server); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); break; + case 'infomaniak': + // see specification at https://faq.infomaniak.com/2376 + $needsIP = FALSE; + $server = 'https://infomaniak.com/nic/update'; + curl_setopt($ch, CURLOPT_USERPWD, "{$this->_dnsUser}:{$this->_dnsPass}"); + curl_setopt($ch, CURLOPT_URL, "{$server}?hostname={$this->_dnsHost}"); + break; // // Not yet ordered providers. // TODO: When editing a provider, move it above in a correct position. @@ -2153,6 +2163,9 @@ } break; // Providers in an alphabetical order. Add code for new providers below in a correct position. + case 'infomaniak': + // see specification at https://faq.infomaniak.com/2376 + // similar to dyfi, reusing their code case 'dyfi': // see specification at https://www.dy.fi/page/specification if (preg_match('/badauth/i', $data)) { diff --git a/src/etc/inc/services.inc b/src/etc/inc/services.inc index cc84d5e0dca..ca60004cab9 100644 --- a/src/etc/inc/services.inc +++ b/src/etc/inc/services.inc @@ -27,8 +27,8 @@ require_once('services_dhcp.inc'); -define('DYNDNS_PROVIDER_VALUES', 'all-inkl azure azurev6 citynetwork cloudflare cloudflare-v6 cloudns custom custom-v6 desec desec-v6 digitalocean digitalocean-v6 dnsexit dnsimple dnsimple-v6 dnsmadeeasy dnsomatic domeneshop domeneshop-v6 dreamhost dreamhost-v6 duiadns duiadns-v6 dyfi dyndns dyndns-custom dyndns-static dyns dynv6 dynv6-v6 easydns easydns-v6 eurodns freedns freedns-v6 freedns2 freedns2-v6 glesys gandi-livedns gandi-livedns-v6 godaddy godaddy-v6 googledomains gratisdns he-net he-net-v6 he-net-tunnelbroker hover linode linode-v6 loopia luadns luadns-v6 mythicbeasts mythicbeasts-v6 name.com name.com-v6 namecheap nicru nicru-v6 noip noip-v6 noip-free noip-free-v6 onecom onecom-v6 ods opendns ovh-dynhost route53 route53-v6 selfhost spdyn spdyn-v6 strato yandex yandex-v6 zoneedit porkbun porkbun-v6'); -define('DYNDNS_PROVIDER_DESCRIPTIONS', 'All-Inkl.com,Azure DNS,Azure DNS (v6),City Network,Cloudflare,Cloudflare (v6),ClouDNS,Custom,Custom (v6),deSEC,deSEC (v6),DigitalOcean,DigitalOcean (v6),DNSexit,DNSimple,DNSimple (v6),DNS Made Easy,DNS-O-Matic,Domeneshop,Domeneshop (v6),DreamHost,Dreamhost (v6),DuiaDns.net,DuiaDns.net (v6),DY.fi,DynDNS (dynamic),DynDNS (custom),DynDNS (static),DyNS,Dynv6,Dynv6 (v6),easyDNS,easyDNS (v6),Euro Dns,freeDNS,freeDNS (v6),freeDNS API Version 2, freeDNS API Version 2 (v6),GleSYS,Gandi LiveDNS,Gandi LiveDNS (v6),GoDaddy,GoDaddy (v6),Google Domains,GratisDNS,HE.net,HE.net (v6),HE.net Tunnelbroker,Hover,Linode,Linode (v6),Loopia,LuaDNS,LuaDNS (v6),Mythic Beasts,Mythic Beasts (v6),Name.com,Name.com (v6),Namecheap,NIC.RU,NIC.RU (v6),No-IP,No-IP (v6),No-IP (free),No-IP (free-v6),One.com,One.com (v6),ODS.org,OpenDNS,OVH DynHOST,Route 53,Route 53 (v6),SelfHost,SPDYN,SPDYN (v6),Strato,Yandex,Yandex (v6),ZoneEdit,Porkbun,Porkbun (v6)'); +define('DYNDNS_PROVIDER_VALUES', 'all-inkl azure azurev6 citynetwork cloudflare cloudflare-v6 cloudns custom custom-v6 desec desec-v6 digitalocean digitalocean-v6 dnsexit dnsimple dnsimple-v6 dnsmadeeasy dnsomatic domeneshop domeneshop-v6 dreamhost dreamhost-v6 duiadns duiadns-v6 dyfi dyndns dyndns-custom dyndns-static dyns dynv6 dynv6-v6 easydns easydns-v6 eurodns freedns freedns-v6 freedns2 freedns2-v6 glesys gandi-livedns gandi-livedns-v6 godaddy godaddy-v6 googledomains gratisdns he-net he-net-v6 he-net-tunnelbroker hover infomaniak linode linode-v6 loopia luadns luadns-v6 mythicbeasts mythicbeasts-v6 name.com name.com-v6 namecheap nicru nicru-v6 noip noip-v6 noip-free noip-free-v6 onecom onecom-v6 ods opendns ovh-dynhost route53 route53-v6 selfhost spdyn spdyn-v6 strato yandex yandex-v6 zoneedit porkbun porkbun-v6'); +define('DYNDNS_PROVIDER_DESCRIPTIONS', 'All-Inkl.com,Azure DNS,Azure DNS (v6),City Network,Cloudflare,Cloudflare (v6),ClouDNS,Custom,Custom (v6),deSEC,deSEC (v6),DigitalOcean,DigitalOcean (v6),DNSexit,DNSimple,DNSimple (v6),DNS Made Easy,DNS-O-Matic,Domeneshop,Domeneshop (v6),DreamHost,Dreamhost (v6),DuiaDns.net,DuiaDns.net (v6),DY.fi,DynDNS (dynamic),DynDNS (custom),DynDNS (static),DyNS,Dynv6,Dynv6 (v6),easyDNS,easyDNS (v6),Euro Dns,freeDNS,freeDNS (v6),freeDNS API Version 2, freeDNS API Version 2 (v6),GleSYS,Gandi LiveDNS,Gandi LiveDNS (v6),GoDaddy,GoDaddy (v6),Google Domains,GratisDNS,HE.net,HE.net (v6),HE.net Tunnelbroker,Hover,Infomaniak,Linode,Linode (v6),Loopia,LuaDNS,LuaDNS (v6),Mythic Beasts,Mythic Beasts (v6),Name.com,Name.com (v6),Namecheap,NIC.RU,NIC.RU (v6),No-IP,No-IP (v6),No-IP (free),No-IP (free-v6),One.com,One.com (v6),ODS.org,OpenDNS,OVH DynHOST,Route 53,Route 53 (v6),SelfHost,SPDYN,SPDYN (v6),Strato,Yandex,Yandex (v6),ZoneEdit,Porkbun,Porkbun (v6)'); /* implement ipv6 route advertising daemon */ function services_radvd_configure($blacklist = array()) { diff --git a/src/usr/local/www/services_dyndns_edit.php b/src/usr/local/www/services_dyndns_edit.php index 87de3633e00..70b8ca3f7ba 100644 --- a/src/usr/local/www/services_dyndns_edit.php +++ b/src/usr/local/www/services_dyndns_edit.php @@ -669,6 +669,7 @@ function setVisible(service) { case "dreamhost": case "dreamhost-v6": case "dyfi": + case "infomaniak": case "nicru": case "nicru-v6": case "strato":