Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
531e9be8
Commit
531e9be8
authored
Mar 04, 2015
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
services/dnydns: support Duck DNS (#43)
parent
02d6fcf3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
15 deletions
+42
-15
dyndns.class
src/etc/inc/dyndns.class
+26
-4
services.inc
src/etc/inc/services.inc
+1
-0
services_dyndns_edit.php
src/www/services_dyndns_edit.php
+15
-11
No files found.
src/etc/inc/dyndns.class
View file @
531e9be8
<?php
/*
* PHP.updateDNS (
pfS
ense version)
* PHP.updateDNS (
OPNs
ense version)
*
* +====================================================+
* Services Supported:
...
...
@@ -29,7 +30,8 @@
* - CloudFlare (www.cloudflare.com)
* - Eurodns (eurodns.com)
* - GratisDNS (gratisdns.dk)
* - City Network (citynetwork.se)
* - City Network (citynetwork.se)
* - Duck DNS (duckdns.org)
* +----------------------------------------------------+
* Requirements:
* - PHP version 4.0.2 or higher with the CURL Library and the PCRE Library
...
...
@@ -71,7 +73,8 @@
* Eurodns - Last Tested: 27 June 2013
* GratisDNS - Last Tested: 15 August 2012
* OVH DynHOST - Last Tested: NEVER
* City Network - Last Tested: 13 November 2013
* City Network - Last Tested: 13 November 2013
* Duck DNS - Last Tested: 04 March 2015
* +====================================================+
*
* @author E.Kristensen
...
...
@@ -240,7 +243,8 @@
case
'eurodns'
:
case
'gratisdns'
:
case
'ovh-dynhost'
:
case
'citynetwork'
:
case
'citynetwork'
:
case
'duckdns'
:
$this
->
_update
();
if
(
$this
->
_dnsDummyUpdateDone
==
true
)
{
// If a dummy update was needed, then sleep a while and do the update again to put the proper address back.
...
...
@@ -674,6 +678,14 @@
$port
=
":"
.
$this
->
_dnsPort
;
curl_setopt
(
$ch
,
CURLOPT_URL
,
$server
.
$port
.
'?hostname='
.
$this
->
_dnsHost
.
'&myip='
.
$this
->
_dnsIP
);
break
;
case
'duckdns'
:
$needsIP
=
FALSE
;
if
(
$this
->
_dnsVerboseLog
)
log_error
(
"Duck DNS (
{
$this
->
_dnsHost
}
): DNS update() starting."
);
$server
=
"https://www.duckdns.org/update"
;
curl_setopt
(
$ch
,
CURLOPT_SSL_VERIFYPEER
,
FALSE
);
curl_setopt
(
$ch
,
CURLOPT_URL
,
$server
.
'?domains='
.
$this
->
_dnsHost
.
'&token='
.
$this
->
_dnsUser
);
break
;
default
:
break
;
}
...
...
@@ -1185,6 +1197,16 @@
$this
->
_debug
(
$data
);
}
break
;
case
'duckdns'
:
if
(
preg_match
(
'/OK/i'
,
$data
))
{
$status
=
"phpDynDNS: (Success) IP Address Updated Successfully!"
;
$successful_update
=
true
;
}
else
{
$status
=
"phpDynDNS: (Unknown Response)"
;
log_error
(
"phpDynDNS: PAYLOAD:
{
$data
}
"
);
$this
->
_debug
(
$data
);
}
break
;
}
if
(
$successful_update
==
true
)
{
...
...
src/etc/inc/services.inc
View file @
531e9be8
...
...
@@ -1602,6 +1602,7 @@ function services_dyndns_list()
'dhs'
=>
'DHS'
,
'dnsexit'
=>
'DNSexit'
,
'dnsomatic'
=>
'DNS-O-Matic'
,
'duckdns'
=>
'Duck DNS'
,
'dyndns'
=>
'DynDNS (dynamic)'
,
'dyndns-static'
=>
'DynDNS (static)'
,
'dyndns-custom'
=>
'DynDNS (custom)'
,
...
...
src/www/services_dyndns_edit.php
View file @
531e9be8
...
...
@@ -82,18 +82,20 @@ if ($_POST) {
/* input validation */
$reqdfields
=
array
();
$reqdfieldsn
=
array
();
$reqdfields
=
array
(
"type"
);
$reqdfieldsn
=
array
(
gettext
(
"Service type"
));
$reqdfields
=
array
(
'type'
);
$reqdfieldsn
=
array
(
gettext
(
'Service type'
));
if
(
$pconfig
[
'type'
]
!=
'custom'
&&
$pconfig
[
'type'
]
!=
'custom-v6'
)
{
$reqdfields
[]
=
"host"
;
$reqdfieldsn
[]
=
gettext
(
"Hostname"
);
$reqdfields
[]
=
"password"
;
$reqdfieldsn
[]
=
gettext
(
"Password"
);
$reqdfields
[]
=
"username"
;
$reqdfieldsn
[]
=
gettext
(
"Username"
);
}
else
{
$reqdfields
[]
=
"updateurl"
;
$reqdfieldsn
[]
=
gettext
(
"Update URL"
);
$reqdfields
[]
=
'host'
;
$reqdfieldsn
[]
=
gettext
(
'Hostname'
);
$reqdfields
[]
=
'username'
;
$reqdfieldsn
[]
=
gettext
(
'Username'
);
if
(
$pconfig
[
'type'
]
!=
'duckdns'
)
{
$reqdfields
[]
=
'password'
;
$reqdfieldsn
[]
=
gettext
(
'Password'
);
}
}
else
{
$reqdfields
[]
=
'updateurl'
;
$reqdfieldsn
[]
=
gettext
(
'Update URL'
);
}
do_input_validation
(
$_POST
,
$reqdfields
,
$reqdfieldsn
,
$input_errors
);
...
...
@@ -363,6 +365,7 @@ include("head.inc");
<input
name=
"username"
type=
"text"
class=
"formfld user"
id=
"username"
size=
"20"
value=
"
<?=
htmlspecialchars
(
$pconfig
[
'username'
]);
?>
"
/>
<br
/>
<?=
gettext
(
"Username is required for all types except Namecheap, FreeDNS and Custom Entries."
);
?>
<br
/>
<?=
gettext
(
"Route 53: Enter your Access Key ID."
);
?>
<br
/>
<?=
gettext
(
"Duck DNS: Enter your Token."
);
?>
<br
/>
<?=
gettext
(
"For Custom Entries, Username and Password represent HTTP Authentication username and passwords."
);
?>
</td>
</tr>
...
...
@@ -373,6 +376,7 @@ include("head.inc");
<br
/>
<?=
gettext
(
"FreeDNS (freedns.afraid.org): Enter your
\"
Authentication Token
\"
provided by FreeDNS."
);
?>
<br
/>
<?=
gettext
(
"Route 53: Enter your Secret Access Key."
);
?>
<br
/>
<?=
gettext
(
"Duck DNS: Leave blank."
);
?>
</td>
</tr>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment