Project

General

Profile

« Previous | Next » 

Revision 745d3779

Added by Wagner Sartori Junior almost 8 years ago

dyndns: Adding support for ClouDNS (https://www.cloudns.net)

View differences:

src/etc/inc/dyndns.class
62 62
	 *    - DuiaDNS IPv6 (www.duiadns.net)
63 63
	 *    - Hover (www.hover.com)
64 64
	 *    - DreamHost DNS (www.dreamhost.com)
65
	 *    - ClouDNS (www.cloudns.net)
65 66
	 * +----------------------------------------------------+
66 67
	 *  Requirements:
67 68
	 *    - PHP version 4.0.2 or higher with the CURL Library and the PCRE Library
......
118 119
	 *  Hover           - Last Tested: 15 February 2017
119 120
	 *  DreamHost       - Last Tested: 30 April 2017
120 121
	 *  DreamHost IPv6  - Not Yet Tested
122
	 *  ClouDNS         - Last Tested: 22 August 2017
121 123
	 * +====================================================+
122 124
	 *
123 125
	 * @author 	E.Kristensen
......
226 228
				if (!$dnsZoneID) $this->_error(8);
227 229
				if (!$dnsTTL) $this->_error(9);
228 230
				break;
231
			case 'cloudns':
232
				if (!$dnsUser) $this->_error(3);
233
				if (!$dnsPass) $this->_error(4);
234
				if (!$dnsHost) $this->_error(5);
235
				if (!$dnsDomain) $this->_error(5);
236
				if (!$dnsTTL) $this->_error(9);
237
				break;
229 238
			case 'custom':
230 239
				if (!$dnsUpdateURL) $this->_error(7);
231 240
				break;
......
327 336
					case 'spdyn':
328 337
					case 'spdyn-v6':
329 338
					case 'all-inkl':
339
					case 'cloudns':
330 340
					case 'hover':
331 341
						$this->_update();
332 342
						if ($this->_dnsDummyUpdateDone == true) {
......
909 919
					curl_setopt($ch, CURLOPT_URL, $server . $port);
910 920
					curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
911 921
					break;
922
				case 'cloudns':
923
					/* Uses ClouDNS REST API
924
					   Requires auth-id or sub-auth-id or sub-auth-user */
925
					// Step 1: Find the Record ID
926
					$url = 'https://api.cloudns.net/dns/records.json';
927
					$post_data['auth-id'] = $this->_dnsUser;
928
					$post_data['auth-password'] = $this->_dnsPass;
929
					$post_data['domain-name'] = $this->_dnsDomain;
930
					$post_data['host'] = $this->_dnsHost;
931
					$post_data['type'] = 'a';
932
					curl_setopt($ch, CURLOPT_URL, $url);
933
					curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
934
					$output = json_decode(curl_exec($ch));
935
					$recordID = key(get_object_vars($output));
936

  
937
					// Step 2: Set the record
938
					$needsIP = TRUE;
939
					$url = 'https://api.cloudns.net/dns/mod-record.json';
940
					$post_data = array();
941
					$post_data['auth-id'] = $this->_dnsUser;
942
					$post_data['auth-password'] = $this->_dnsPass;
943
					$post_data['domain-name'] = $this->_dnsDomain;
944
					$post_data['record-id'] = $recordID;
945
					$post_data['host'] = $this->_dnsHost;
946
					$post_data['record'] = $this->_dnsIP;
947
					$post_data['ttl'] = $this->_dnsTTL;
948
					curl_setopt($ch, CURLOPT_URL, $url);
949
					curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
950
					break;
951

  
912 952
				default:
913 953
					break;
914 954
			}
......
1768 1808
						$this->_debug($data);
1769 1809
					}
1770 1810
					break;
1811
				case 'cloudns':
1812
					$result = json_decode($data, true);
1813
					if ($result['status'] == 'Success') {
1814
						$successful_update = true;
1815
					} else {
1816
						log_error($result['status'] . "(" . $result['statusDescription'] . ")");
1817
					}
1818
					break;
1771 1819
				case 'dreamhost':
1772 1820
				case 'dreamhost-v6':
1773 1821
					$result = json_decode($data,true);
src/etc/inc/globals.inc
205 205
	"descr" => 'Default Check IP Service'
206 206
);
207 207

  
208
$dyndns_split_domain_types = array("namecheap", "cloudflare", "cloudflare-v6", "gratisdns");
208
$dyndns_split_domain_types = array("namecheap", "cloudflare", "cloudflare-v6", "gratisdns", "cloudns");
209 209
?>
src/etc/inc/services.inc
23 23
 * limitations under the License.
24 24
 */
25 25

  
26
define('DYNDNS_PROVIDER_VALUES', 'all-inkl citynetwork cloudflare cloudflare-v6 custom custom-v6 dnsexit dnsimple dnsmadeeasy dnsomatic dreamhost dreamhost-v6 duiadns duiadns-v6 dyndns dyndns-custom dyndns-static dyns easydns eurodns freedns freedns-v6 glesys googledomains gratisdns he-net he-net-v6 he-net-tunnelbroker hover loopia namecheap noip noip-free ods opendns ovh-dynhost route53 selfhost spdyn spdyn-v6 zoneedit');
27
define('DYNDNS_PROVIDER_DESCRIPTIONS', 'All-Inkl.com,City Network,CloudFlare,CloudFlare (v6),Custom,Custom (v6),DNSexit,DNSimple,DNS Made Easy,DNS-O-Matic,DreamHost,Dreamhost (v6),DuiaDns.net,DuiaDns.net (v6),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,Hover,Loopia,Namecheap,No-IP,No-IP (free),ODS.org,OpenDNS,OVH DynHOST,Route 53,SelfHost,SPDYN,SPDYN (v6),ZoneEdit');
26
define('DYNDNS_PROVIDER_VALUES', 'all-inkl citynetwork cloudflare cloudflare-v6 cloudns custom custom-v6 dnsexit dnsimple dnsmadeeasy dnsomatic dreamhost dreamhost-v6 duiadns duiadns-v6 dyndns dyndns-custom dyndns-static dyns easydns eurodns freedns freedns-v6 glesys googledomains gratisdns he-net he-net-v6 he-net-tunnelbroker hover loopia namecheap noip noip-free ods opendns ovh-dynhost route53 selfhost spdyn spdyn-v6 zoneedit');
27
define('DYNDNS_PROVIDER_DESCRIPTIONS', 'All-Inkl.com,City Network,CloudFlare,CloudFlare (v6),ClouDNS,Custom,Custom (v6),DNSexit,DNSimple,DNS Made Easy,DNS-O-Matic,DreamHost,Dreamhost (v6),DuiaDns.net,DuiaDns.net (v6),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,Hover,Loopia,Namecheap,No-IP,No-IP (free),ODS.org,OpenDNS,OVH DynHOST,Route 53,SelfHost,SPDYN,SPDYN (v6),ZoneEdit');
28 28

  
29 29
/* implement ipv6 route advertising daemon */
30 30
function services_radvd_configure($blacklist = array()) {
src/usr/local/share/locale/pot/pfSense.pot
22273 22273
"Enter the complete fully qualified domain name. Example: myhost.dyndns.org"
22274 22274
"%1$sDNS Made Easy: Dynamic DNS ID (NOT hostname)%1$she.net tunnelbroker: "
22275 22275
"Enter the tunnel ID.%1$sGleSYS: Enter the record ID.%1$sDNSimple: Enter only "
22276
"the domain name.%1$sNamecheap, Cloudflare, GratisDNS, Hover: Enter the "
22277
"hostname and the domain separately, with the domain being the domain or "
22276
"the domain name.%1$sNamecheap, Cloudflare, GratisDNS, Hover, ClouDNS: Enter "
22277
"the hostname and the domain separately, with the domain being the domain or "
22278 22278
"subdomain zone being handled by the provider."
22279 22279
msgstr ""
22280 22280

  
src/usr/local/www/services_dyndns_edit.php
299 299
			'he.net tunnelbroker: Enter the tunnel ID.%1$s' .
300 300
			'GleSYS: Enter the record ID.%1$s' .
301 301
			'DNSimple: Enter only the domain name.%1$s' .
302
			'Namecheap, Cloudflare, GratisDNS, Hover: Enter the hostname and the domain separately, with the domain being the domain or subdomain zone being handled by the provider.', '<br />');
302
			'Namecheap, Cloudflare, GratisDNS, Hover, ClouDNS: Enter the hostname and the domain separately, with the domain being the domain or subdomain zone being handled by the provider.', '<br />');
303 303

  
304 304
$section->add($group);
305 305

  
......
487 487
				hideInput('zoneid', true);
488 488
				hideInput('ttl', true);
489 489
				break;
490
			case "cloudns":
491
				hideGroupInput('domainname', false);
492
				hideInput('resultmatch', true);
493
				hideInput('updateurl', true);
494
				hideInput('requestif', true);
495
				hideCheckbox('curl_ipresolve_v4', true);
496
				hideCheckbox('curl_ssl_verifypeer', true);
497
				hideInput('host', false);
498
				hideInput('mx', false);
499
				hideCheckbox('wildcard', false);
500
				hideCheckbox('proxied', true);
501
				hideInput('zoneid', true);
502
				hideInput('ttl', false);
503
				break;
490 504
			case 'dreamhost':
491 505
			case 'dreamhost-v6':
492 506
				hideGroupInput('domainname', true);

Also available in: Unified diff