Skip to content

Commit

Permalink
Change default IPv4 / IPv6 service
Browse files Browse the repository at this point in the history
  • Loading branch information
stecklars committed Mar 2, 2024
1 parent 8a7fbe5 commit a8a6327
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
16 changes: 8 additions & 8 deletions config.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@
// define('HOST', 'server');


// Enter a URL to use to determine the public IPv4 address.
// [Optional; will be set to default value 'https://api.ipify.org' if missing.]
define('IPV4_ADDRESS_URL', 'https://api.ipify.org');
// Enter an URL to use to determine the public IPv4 address.
// [Optional; will be set to default value 'https://get-ipv4.steck.cc' if missing.]
define('IPV4_ADDRESS_URL', 'https://get-ipv4.steck.cc');

// Enter a URL to use as fallback to determine the public IPv4 address.
// Enter an URL to use as fallback to determine the public IPv4 address.
// [Optional; will be set to default value 'https://ipv4.seeip.org' if missing.]
define('IPV4_ADDRESS_URL_FALLBACK', 'https://ipv4.seeip.org');

// Enter a URL to use to determine the public IPv6 address.
// [Optional; will be set to default value 'https://ipv6.seeip.org' if missing.]
define('IPV6_ADDRESS_URL', 'https://ipv6.seeip.org');
// Enter an URL to use to determine the public IPv6 address.
// [Optional; will be set to default value 'https://get-ipv6.steck.cc' if missing.]
define('IPV6_ADDRESS_URL', 'https://get-ipv6.steck.cc');

// Enter a URL to use as fallback to determine the public IPv6 address.
// Enter an URL to use as fallback to determine the public IPv6 address.
// [Optional; will be set to default value 'https://v6.ident.me' if missing.]
define('IPV6_ADDRESS_URL_FALLBACK', 'https://v6.ident.me');

Expand Down
4 changes: 2 additions & 2 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const VERSION = '5.0';
const SUCCESS = 'success';
const USERAGENT = "dynamic-dns-netcup-api/".VERSION." (by stecklars)";
const USERAGENT = "dynamic-dns-netcup-api/" . VERSION ." (by stecklars)";

//Check passed options
$shortopts = "q4:6:c:vh";
Expand Down Expand Up @@ -173,7 +173,7 @@ function sendRequest($request, $apiSessionRetry = false)

$result = json_decode($result, true);

// Due to a bug in the netcup CCP DNS API, sometimes sessions expire too early (statuscode 4001, error message: "The session id is not in a valid format."
// Due to a bug in the netcup CCP DNS API, sometimes sessions expire too early (statuscode 4001, error message: "The session id is not in a valid format.")
// We work around this bug by trying to login again once.
// See Github issue #21.
if ($result['statuscode'] === 4001 && $apiSessionRetry === false) {
Expand Down
6 changes: 3 additions & 3 deletions update.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@
}

if (!defined('IPV4_ADDRESS_URL')) {
define('IPV4_ADDRESS_URL', 'https://api.ipify.org');
define('IPV4_ADDRESS_URL', 'https://get-ipv4.steck.cc');
}

if (!defined('IPV4_ADDRESS_URL_FALLBACK')) {
define('IPV4_ADDRESS_URL_FALLBACK', 'https://ipv4.seeip.org');
}

if (!defined('IPV6_ADDRESS_URL')) {
define('IPV6_ADDRESS_URL', 'https://ipv6.seeip.org');
define('IPV6_ADDRESS_URL', 'https://get-ipv6.steck.cc');
}

if (!defined('IPV6_ADDRESS_URL_FALLBACK')) {
define('IPV6_ADDRESS_URL_FALLBACK', 'https://v6.ident.me/');
}
}

if (USE_IPV4 === true) {
// Get current IPv4 address
Expand Down

0 comments on commit a8a6327

Please sign in to comment.