Skip to content

Commit

Permalink
Allow wildcard DNS record of type A in DynDNS client for DNS provider…
Browse files Browse the repository at this point in the history
… Gandi. Ticket #11159.
  • Loading branch information
Sébastien Trupel committed Dec 13, 2020
1 parent fbcfaac commit cb8ecda
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/etc/inc/dyndns.class
Original file line number Diff line number Diff line change
Expand Up @@ -1387,9 +1387,9 @@
case 'gandi-livedns':
// NOTE: quite similar to digitalocean case but with json content like azure case
// Get record href
$server = 'https://dns.api.gandi.net/api/v5/domains/';
$server = 'https://api.gandi.net/v5/livedns/domains/';
$url = $server . $this->_dnsDomain . '/records';
curl_setopt($ch, CURLOPT_HTTPHEADER, array("X-Api-Key: {$this->_dnsPass}"));
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: Apikey {$this->_dnsPass}"));
curl_setopt($ch, CURLOPT_URL, $url);
$output = json_decode(curl_exec($ch));
if (!is_array($output)) {
Expand All @@ -1404,7 +1404,7 @@
}
$request_headers = array();
//$request_headers[] = 'Accept: application/json';
$request_headers[] = 'X-Api-Key: ' . $this->_dnsPass;
$request_headers[] = 'Authorization: Apikey ' . $this->_dnsPass;
$request_headers[] = 'Content-Type: application/json';
//create or update record
if ($recordHref == null) {
Expand Down
4 changes: 2 additions & 2 deletions src/usr/local/www/services_dyndns_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,14 @@ function is_dyndns_username($uname) {
if (isset($_POST['host']) && in_array("host", $reqdfields)) {
$allow_wildcard = false;
/* Namecheap can have a @. and *. in hostname */
if ($pconfig['type'] == "namecheap" && ($_POST['host'] == '*.' || $_POST['host'] == '*' || $_POST['host'] == '@.' || $_POST['host'] == '@')) {
if (($pconfig['type'] == "namecheap" || $pconfig['type'] == "gandi-livedns") && ($_POST['host'] == '*.' || $_POST['host'] == '*' || $_POST['host'] == '@.' || $_POST['host'] == '@')) {
$host_to_check = $_POST['domainname'];
} elseif (($pconfig['type'] == "cloudflare") || ($pconfig['type'] == "cloudflare-v6")) {
$host_to_check = $_POST['host'] == '@' ? $_POST['domainname'] : ( $_POST['host'] . '.' . $_POST['domainname'] );
$allow_wildcard = true;
} elseif ((($pconfig['type'] == "godaddy") || ($pconfig['type'] == "godaddy-v6")) && ($_POST['host'] == '@.' || $_POST['host'] == '@')) {
$host_to_check = $_POST['domainname'];
} elseif (($pconfig['type'] == "digitalocean" || $pconfig['type'] == "digitalocean-v6" || $pconfig['type'] == "gandi-livedns") && ($_POST['host'] == '@.' || $_POST['host'] == '@')) {
} elseif (($pconfig['type'] == "digitalocean" || $pconfig['type'] == "digitalocean-v6") && ($_POST['host'] == '@.' || $_POST['host'] == '@')) {
$host_to_check = $_POST['domainname'];
} elseif (($pconfig['type'] == "linode") || ($pconfig['type'] == "linode-v6")) {
$host_to_check = $_POST['host'] == '@' ? $_POST['domainname'] : ( $_POST['host'] . '.' . $_POST['domainname'] );
Expand Down

0 comments on commit cb8ecda

Please sign in to comment.