summaryrefslogtreecommitdiffstats
path: root/src/etc
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-08-01 18:33:42 -0300
committerRenato Botelho <renato@netgate.com>2016-08-01 18:33:42 -0300
commit69176bedfa7a5b1fdd4679639e90a4d35428c8e6 (patch)
treeda201e5f84182b35fd1adc3be38cf3c579adbe5d /src/etc
parent317a06f29ee4aef002386c9f8cd161f38a3a30ac (diff)
parentb18e885cbcc719bf1d80f41e4afbc92de684ead5 (diff)
downloadpfsense-69176bedfa7a5b1fdd4679639e90a4d35428c8e6.zip
pfsense-69176bedfa7a5b1fdd4679639e90a4d35428c8e6.tar.gz
Merge pull request #3064 from phil-davis/cloudflare
Diffstat (limited to 'src/etc')
-rw-r--r--src/etc/inc/dyndns.class14
-rw-r--r--src/etc/inc/services.inc4
2 files changed, 13 insertions, 5 deletions
diff --git a/src/etc/inc/dyndns.class b/src/etc/inc/dyndns.class
index bd8fa05..41f3cc4 100644
--- a/src/etc/inc/dyndns.class
+++ b/src/etc/inc/dyndns.class
@@ -79,6 +79,7 @@
* - Custom DDNS (any URL)
* - Custom DDNS IPv6 (any URL)
* - CloudFlare (www.cloudflare.com)
+ * - CloudFlare IPv6 (www.cloudflare.com)
* - Eurodns (eurodns.com)
* - GratisDNS (gratisdns.dk)
* - City Network (citynetwork.se)
@@ -126,7 +127,8 @@
* SelfHost - Last Tested: 26 December 2011
* Amazon Route 53 - Last tested: 01 April 2012
* DNS-O-Matic - Last Tested: 9 September 2010
- * CloudFlare - Last Tested: 30 May 2013
+ * CloudFlare - Last Tested: 17 July 2016
+ * CloudFlare IPv6 - Last Tested: 17 July 2016
* Eurodns - Last Tested: 27 June 2013
* GratisDNS - Last Tested: 15 August 2012
* OVH DynHOST - Last Tested: NEVER
@@ -249,6 +251,7 @@
case 'custom-v6':
case 'spdyn-v6':
case 'freedns-v6':
+ case 'cloudflare-v6':
$this->_useIPv6 = true;
break;
default:
@@ -319,6 +322,7 @@
case 'he-net-tunnelbroker':
case 'route53':
case 'cloudflare':
+ case 'cloudflare-v6':
case 'eurodns':
case 'gratisdns':
case 'ovh-dynhost':
@@ -724,7 +728,10 @@
}
curl_setopt($ch, CURLOPT_URL, $server);
break;
+ case 'cloudflare-v6':
case 'cloudflare':
+ $isv6 = ($this->_dnsService === 'cloudflare-v6');
+ $recordType = $isv6 ? "AAAA" : "A";
$needsIP = TRUE;
$dnsServer ='api.cloudflare.com';
$dnsHost = str_replace(' ', '', $this->_dnsHost);
@@ -744,14 +751,14 @@
$output = json_decode(curl_exec($ch));
$zone = $output->result[0]->id;
if ($zone) { // If zone ID was found get host ID
- $getHostId = "https://{$dnsServer}/client/v4/zones/{$zone}/dns_records?name={$this->_dnsHost}";
+ $getHostId = "https://{$dnsServer}/client/v4/zones/{$zone}/dns_records?name={$this->_dnsHost}&type={$recordType}";
curl_setopt($ch, CURLOPT_URL, $getHostId);
$output = json_decode(curl_exec($ch));
$host = $output->result[0]->id;
if ($host) { // If host ID was found update host
$hostData = array(
"content" => "{$this->_dnsIP}",
- "type" => "A",
+ "type" => "{$recordType}",
"name" => "{$this->_dnsHost}"
);
$data_json = json_encode($hostData);
@@ -1320,6 +1327,7 @@
$status = $status_intro . $error_str . gettext("Result did not match.") . " [" . $data . "]";
}
break;
+ case 'cloudflare-v6':
case 'cloudflare':
$output = json_decode($data);
if ($output->result->content === $this->_dnsIP) {
diff --git a/src/etc/inc/services.inc b/src/etc/inc/services.inc
index 947ff98..3147c3a 100644
--- a/src/etc/inc/services.inc
+++ b/src/etc/inc/services.inc
@@ -55,8 +55,8 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-define('DYNDNS_PROVIDER_VALUES', 'citynetwork cloudflare custom custom-v6 dnsexit dnsimple dnsmadeeasy dnsomatic dyndns dyndns-custom dyndns-static dyns easydns eurodns freedns freedns-v6 glesys googledomains gratisdns he-net he-net-v6 he-net-tunnelbroker loopia namecheap noip noip-free ods opendns ovh-dynhost route53 selfhost spdyn spdyn-v6 zoneedit');
-define('DYNDNS_PROVIDER_DESCRIPTIONS', 'City Network,CloudFlare,Custom,Custom (v6),DNSexit,DNSimple,DNS Made Easy,DNS-O-Matic,DynDNS (dynamic),DynDNS (custom),DynDNS (static),DyNS,easyDNS,Euro Dns,freeDNS,freeDNS (v6),GleSYS,Google Domains,GratisDNS,HE.net,HE.net (v6),HE.net Tunnelbroker,Loopia,Namecheap,No-IP,No-IP (free),ODS.org,OpenDNS,OVH DynHOST,Route 53,SelfHost,SPDYN,SPDYN (v6),ZoneEdit');
+define('DYNDNS_PROVIDER_VALUES', 'citynetwork cloudflare cloudflare-v6 custom custom-v6 dnsexit dnsimple dnsmadeeasy dnsomatic dyndns dyndns-custom dyndns-static dyns easydns eurodns freedns freedns-v6 glesys googledomains gratisdns he-net he-net-v6 he-net-tunnelbroker loopia namecheap noip noip-free ods opendns ovh-dynhost route53 selfhost spdyn spdyn-v6 zoneedit');
+define('DYNDNS_PROVIDER_DESCRIPTIONS', 'City Network,CloudFlare,CloudFlare (v6),Custom,Custom (v6),DNSexit,DNSimple,DNS Made Easy,DNS-O-Matic,DynDNS (dynamic),DynDNS (custom),DynDNS (static),DyNS,easyDNS,Euro Dns,freeDNS,freeDNS (v6),GleSYS,Google Domains,GratisDNS,HE.net,HE.net (v6),HE.net Tunnelbroker,Loopia,Namecheap,No-IP,No-IP (free),ODS.org,OpenDNS,OVH DynHOST,Route 53,SelfHost,SPDYN,SPDYN (v6),ZoneEdit');
/* implement ipv6 route advertising daemon */
function services_radvd_configure($blacklist = array()) {
OpenPOWER on IntegriCloud