dns/dyndns: remove obsolete plugin

This commit is contained in:
Franco Fichtner
2023-07-17 10:16:18 +02:00
parent 6adb47c4c9
commit 09616f6c66
14 changed files with 0 additions and 4128 deletions
-7
View File
@@ -1,7 +0,0 @@
PLUGIN_NAME= dyndns
PLUGIN_VERSION= 1.27
PLUGIN_REVISION= 3
PLUGIN_COMMENT= Dynamic DNS Support
PLUGIN_MAINTAINER= franco@opnsense.org
.include "../../Mk/plugins.mk"
-32
View File
@@ -1,32 +0,0 @@
Support for numerous Dynamic DNS services (DynDNS et al)
Plugin Changelog
================
1.27
* Add missing digitalocean-v6 switch case (contributed by zarcjap)
* Fix GoDaddy IPv6 update (contributed by Team Rebellion)
1.26
* Add support for 1984 Hosting Company (contributed by Adrian Fedoreanu)
* Add %HOST% support for custom dynamic DNS (contributed by Marc Collins)
* Add PAYLOAD log and debug support for missing code spots
1.25
* Make regfish DynDNS work for IPv4 and IPv6 (contributed by DeepCoreSystem)
* Add STRATO IPv6 to DynDNS (contributed by Jan Wiesemann)
* Add desec.io wildcard support (contributed by Luca Zeug)
* Accept wildcard entry for Hetzner
1.24
* Fix FreeDNS update in DynDNS plugin (contributed by rmrfus)
* Add hetzner dns console to supported dyndns services (contributed by schreibubi)
* Add support for deSEC.io (contributed by Michael Paul)
* Add All-Inkl v4 and v6 DynDNS support (contributed by polkhigh33)
* Add support for digitalocean v6 records (contributed by Jan Koppe)
* Update No-Ip client code to use APIv2 (contributed by Victor Kislov)
* Fix copy and paste unprotected JSON object access
@@ -1,281 +0,0 @@
<?php
/*
* Copyright (C) 2014-2017 Franco Fichtner <franco@opnsense.org>
* Copyright (C) 2010 Ermal Luçi
* Copyright (C) 2005-2006 Colin Smith <ethethlay@gmail.com>
* Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
require_once('plugins.inc.d/dyndns/phpDynDNS.inc');
require_once('plugins.inc.d/dyndns/r53.inc');
function dyndns_configure()
{
return [
'bootup' => ['dyndns_configure_do'],
'local' => ['dyndns_configure_do'],
'newwanip' => ['dyndns_configure_do:2'],
];
}
function dyndns_enabled()
{
global $config;
if (isset($config['dyndnses']['dyndns'])) {
foreach ($config['dyndnses']['dyndns'] as $conf) {
if (isset($conf['enable'])) {
return true;
}
}
}
return false;
}
function dyndns_services()
{
$services = [];
if (dyndns_enabled()) {
$services[] = [
'description' => gettext('Dynamic DNS'),
'configd' => [ 'restart' => ['dyndns reload'] ],
'nocheck' => true,
'name' => 'dyndns',
];
}
return $services;
}
function dyndns_cron()
{
$jobs = [];
if (dyndns_enabled()) {
$jobs[]['autocron'] = ['/usr/local/etc/rc.dyndns', '11', '1'];
}
return $jobs;
}
function dyndns_list()
{
/*
* XXX something like this would be cool:
*
* https://github.com/openwrt/packages/blob/master/net/ddns-scripts/files/services
*/
return [
'1984-hosting' => '1984 Hosting Company',
'3322' => '3322',
'all-inkl' => 'All-Inkl',
'all-inkl-v6' => 'All-Inkl (v6)',
'azure' => 'Azure DNS',
'azurev6' => 'Azure DNS (v6)',
'citynetwork' => 'City Network',
'cloudflare' => 'Cloudflare',
'cloudflare-token' => 'Cloudflare API token',
'cloudflare-token-v6' => 'Cloudflare API token (v6)',
'cloudflare-v6' => 'Cloudflare (v6)',
'custom' => 'Custom',
'custom-v6' => 'Custom (v6)',
'desec' => 'deSEC',
'desec-v4-v6' => 'deSEC (v4+v6)',
'desec-v6' => 'deSEC (v6)',
'dhs' => 'DHS',
'digitalocean' => 'DigitalOcean',
'digitalocean-v6' => 'DigitalOcean (v6)',
'dnsexit' => 'DNSexit',
'dnsomatic' => 'DNS-O-Matic',
'duckdns' => 'Duck DNS',
'dyndns' => 'DynDNS (dynamic)',
'dyndns-custom' => 'DynDNS (custom)',
'dyndns-static' => 'DynDNS (static)',
'dyns' => 'DyNS',
'dynv6' => 'dynv6',
'dynv6-v6' => 'dynv6 (v6)',
'easydns' => 'easyDNS',
'eurodns' => 'EuroDNS',
'freedns' => 'freeDNS',
'gandi-livedns' => 'Gandi LiveDNS',
'godaddy' => 'GoDaddy',
'godaddy-v6' => 'GoDaddy (v6)',
'googledomains' => 'Google Domains',
'gratisdns' => 'GratisDNS',
'he-net' => 'HE.net',
'he-net-tunnelbroker' => 'HE.net Tunnelbroker',
'he-net-v6' => 'HE.net (v6)',
'hetzner' => 'Hetzner DNS Console',
'hetzner-v6' => 'Hetzner DNS Console (v6)',
'linode' => 'Linode',
'linode-v6' => 'Linode (v6)',
'loopia' => 'Loopia',
'namecheap' => 'Namecheap',
'noip' => 'No-IP',
'noip-free' => 'No-IP (free)',
'ods' => 'ODS.org',
'oray' => 'Oray',
'ovh-dynhost' => 'OVH DynHOST',
'regfish' => 'regfish',
'regfish-v6' => 'regfish (v6)',
'route53' => 'Route 53',
'route53-v6' => 'Route 53 (v6)',
'selfhost' => 'SelfHost',
'strato' => 'STRATO',
'strato-v6' => 'STRATO (v6)',
'zoneedit' => 'ZoneEdit',
];
}
function dyndns_cache_file($conf, $ipver = 4)
{
$ipver = $ipver == 6 ? '_v6' : '';
return "/var/cache/dyndns_{$conf['interface']}_{$conf['host']}_{$conf['id']}{$ipver}.cache";
}
function dyndns_configure_client($conf)
{
if (!isset($conf['enable'])) {
return;
}
$dns = new updatedns(
$dnsService = $conf['type'],
$dnsHost = $conf['host'],
$dnsUser = $conf['username'],
$dnsPass = $conf['password'],
$dnsWilcard = $conf['wildcard'],
$dnsMX = $conf['mx'],
$dnsIf = "{$conf['interface']}",
$dnsBackMX = null,
$dnsServer = null,
$dnsPort = null,
$dnsUpdateURL = "{$conf['updateurl']}",
$forceUpdate = $conf['force'],
$dnsZoneID = $conf['zoneid'],
$dnsResourceID = $conf['resourceid'],
$dnsTTL = $conf['ttl'],
$dnsResultMatch = "{$conf['resultmatch']}",
$dnsRequestIf = "{$conf['requestif']}",
$dnsID = "{$conf['id']}",
$dnsVerboseLog = $conf['verboselog'],
$curlIpresolveV4 = $conf['curl_ipresolve_v4'],
$curlSslVerifypeer = $conf['curl_ssl_verifypeer']
);
}
function dyndns_configure_do($verbose = false, $int = '')
{
global $config;
if (!dyndns_enabled()) {
return;
}
$dyndnscfg = $config['dyndnses']['dyndns'];
$gwgroups = return_gateway_groups_array();
service_log('Configuring dynamic DNS clients...', $verbose);
foreach ($dyndnscfg as $dyndns) {
if ((empty($int)) || ($int == $dyndns['interface']) || (is_array($gwgroups[$dyndns['interface']]))) {
$dyndns['verboselog'] = isset($dyndns['verboselog']);
$dyndns['curl_ipresolve_v4'] = isset($dyndns['curl_ipresolve_v4']);
$dyndns['curl_ssl_verifypeer'] = isset($dyndns['curl_ssl_verifypeer']);
dyndns_configure_client($dyndns);
sleep(1);
}
}
service_log("done.\n", $verbose);
}
function dyndns_failover_interface($interface, $family = 'all')
{
global $config;
/* shortcut for known interfaces */
if (isset($config['interfaces'][$interface])) {
return get_real_interface($interface, $family);
}
/* compare against gateway groups */
$a_groups = return_gateway_groups_array();
if (isset($a_groups[$interface])) {
/* we found a gateway group, fetch the interface or vip */
if ($a_groups[$interface][0]['vip'] != '') {
return $a_groups[$interface][0]['vip'];
} else {
return $a_groups[$interface][0]['int'];
}
}
/* fall through to get real interface the hard way */
return get_real_interface($interface, $family);
}
function get_dyndns_ip_address($int, $ipver = 4)
{
$ip_address = $ipver == 6 ? get_interface_ipv6($int) : get_interface_ip($int);
if (empty($ip_address)) {
log_error("Aborted IPv{$ipver} detection: no address for {$int}");
return 'down';
}
if ($ipver != 6 && is_private_ip($ip_address)) {
/* Chinese alternative is http://ip.3322.net/ */
$hosttocheck = 'http://checkip.dyndns.org';
$ip_ch = curl_init($hosttocheck);
curl_setopt($ip_ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ip_ch, CURLOPT_INTERFACE, $ip_address);
curl_setopt($ip_ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ip_ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ip_ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
$ip_result = curl_exec($ip_ch);
if ($ip_result !== false) {
preg_match('=<body>Current IP Address: (.*)</body>=siU', $ip_result, $matches);
$ip_address = trim($matches[1]);
} else {
log_error('Aborted IPv4 detection: ' . curl_error($ip_ch));
$ip_address = '';
}
curl_close($ip_ch);
} elseif ($ipver == 6 && is_linklocal($ip_address)) {
log_error('Aborted IPv6 detection: cannot bind to link-local address');
$ip_address = '';
}
if (($ipver == 6 && !is_ipaddrv6($ip_address)) || ($ipver != 6 && !is_ipaddrv4($ip_address))) {
return 'down';
}
return $ip_address;
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-50
View File
@@ -1,50 +0,0 @@
#!/usr/local/bin/php
<?php
/*
* Copyright (C) 2004 Scott Ullrich <sullrich@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
require_once("config.inc");
require_once("interfaces.inc");
require_once("util.inc");
require_once("filter.inc");
require_once("plugins.inc.d/dyndns.inc");
if (isset($argv[1])) {
$argument = trim($argv[1], " \n");
} else {
$argument = null;
}
if (empty($argument)) {
dyndns_configure_do(true);
} else {
$interface = (new \OPNsense\Routing\Gateways(legacy_interfaces_details()))->getInterfaceName($argument);
if (empty($interface)) {
$interface = $argument;
}
dyndns_configure_do(true, $interface);
}
@@ -1,38 +0,0 @@
#!/bin/sh
# Copyright (c) 2019 Franco Fichtner <franco@opnsense.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
GATEWAY="${1}"
if [ -z "${GATEWAY}" ]; then
# require a gateway
exit 1
fi
echo -n "Reloading DynDNS for ${GATEWAY}: "
/usr/local/opnsense/service/configd_ctl.py dyndns reload ${GATEWAY}
exit 0
@@ -1,9 +0,0 @@
<acl>
<page-services-dynamicdnsclients>
<name>Services: Dynamic DNS clients</name>
<patterns>
<pattern>services_dyndns.php*</pattern>
<pattern>services_dyndns_edit.php*</pattern>
</patterns>
</page-services-dynamicdnsclients>
</acl>
@@ -1,7 +0,0 @@
<menu>
<Services>
<DynamicDNSOld VisibleName="Dynamic DNS (legacy)" url="/services_dyndns.php" cssClass="fa fa-tags fa-fw">
<Edit url="/services_dyndns_edit.php*" visibility="hidden"/>
</DynamicDNSOld>
</Services>
</menu>
@@ -1,6 +0,0 @@
[reload]
command:/usr/local/etc/rc.dyndns
description:Dynamic DNS Update
parameters:%s
type:script
message:updating dyndns %s
-203
View File
@@ -1,203 +0,0 @@
<?php
/*
* Copyright (C) 2014-2016 Deciso B.V.
* Copyright (C) 2008 Ermal Luçi
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
require_once("guiconfig.inc");
require_once("interfaces.inc");
require_once("system.inc");
require_once("plugins.inc.d/dyndns.inc");
$a_dyndns = &config_read_array('dyndnses', 'dyndns');
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (isset($_POST['act']) && $_POST['act'] == "del" && isset($_POST['id'])) {
if (!empty($a_dyndns[$_POST['id']])) {
$conf = $a_dyndns[$_POST['id']];
@unlink(dyndns_cache_file($conf, 4));
@unlink(dyndns_cache_file($conf, 6));
unset($a_dyndns[$_POST['id']]);
write_config();
system_cron_configure();
}
exit;
} elseif (isset($_POST['act']) && $_POST['act'] == "toggle" && isset($_POST['id'])) {
if (!empty($a_dyndns[$_POST['id']])) {
if (!empty($a_dyndns[$_POST['id']]['enable'])) {
$a_dyndns[$_POST['id']]['enable'] = false;
} else {
$a_dyndns[$_POST['id']]['enable'] = true;
}
write_config();
system_cron_configure();
if ($a_dyndns[$_POST['id']]['enable']) {
$a_dyndns[$_POST['id']]['force'] = true;
dyndns_configure_client($a_dyndns[$_POST['id']]);
}
}
exit;
}
}
include("head.inc");
legacy_html_escape_form_data($a_dyndns);
?>
<body>
<script>
$( document ).ready(function() {
// delete service action
$(".act_delete_service").click(function(event){
event.preventDefault();
var id = $(this).data("id");
BootstrapDialog.show({
type:BootstrapDialog.TYPE_DANGER,
title: "<?= gettext("Dynamic DNS");?>",
message: "<?=gettext("Do you really want to delete this entry?");?>",
buttons: [{
label: "<?= gettext("No");?>",
action: function(dialogRef) {
dialogRef.close();
}}, {
label: "<?= gettext("Yes");?>",
action: function(dialogRef) {
$.post(window.location, {act: 'del', id:id}, function(data) {
location.reload();
});
}
}]
});
});
// link toggle buttons
$(".act_toggle").click(function(event){
event.preventDefault();
$.post(window.location, {act: 'toggle', id:$(this).data("id")}, function(data) {
location.reload();
});
});
// watch scroll position and set to last known on page load
watchScrollPosition();
});
</script>
<?php include("fbegin.inc"); ?>
<section class="page-content-main">
<div class="container-fluid">
<div class="row">
<section class="col-xs-12">
<div class="alert alert-warning" role="alert">
<strong>
<?=gettext("Please make sure to upgrade to os-ddclient before 23.7 is released as this plugin will be removed from our repository");?>
</strong>
</div>
<div class="tab-content content-box col-xs-12">
<form method="post" name="iform" id="iform">
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th><?=gettext("Interface");?></th>
<th><?=gettext("Service");?></th>
<th><?=gettext("Hostname");?></th>
<th><?=gettext("Cached IP");?></th>
<th><?=gettext("Description");?></th>
<th class="text-nowrap">
<a href="services_dyndns_edit.php" class="btn btn-primary btn-xs" data-toggle="tooltip" title="<?= html_safe(gettext('Add')) ?>">
<i class="fa fa-plus fa-fw"></i>
</a>
</th>
</tr>
</thead>
<tbody>
<?php
$i = 0;
foreach ($a_dyndns as $dyndns): ?>
<tr>
<td>
<a href="#" class="act_toggle" data-id="<?=$i;?>" data-toggle="tooltip" title="<?=(!empty($dyndns['enable'])) ? gettext("Disable") : gettext("Enable");?>">
<i class="fa fa-play fa-fw <?=(!empty($dyndns['enable'])) ? "text-success" : "text-muted";?>"></i>
</a>
<?=!empty($config['interfaces'][$dyndns['interface']]['descr']) ? $config['interfaces'][$dyndns['interface']]['descr'] : strtoupper($dyndns['interface']);?>
</td>
<td><?=dyndns_list()[$dyndns['type']];?></td>
<td><?=$dyndns['host'];?></td>
<td>
<?php
$filename = dyndns_cache_file($dyndns, 4);
$fdata = '';
if (file_exists($filename) && !empty($dyndns['enable'])) {
$ipaddr = get_dyndns_ip_address(dyndns_failover_interface($dyndns['interface'], 'all'), 4);
$fdata = @file_get_contents($filename);
}
$filename_v6 = dyndns_cache_file($dyndns, 6);
$fdata6 = '';
if (file_exists($filename_v6) && !empty($dyndns['enable'])) {
$ipv6addr = get_dyndns_ip_address(dyndns_failover_interface($dyndns['interface'], 'inet6'), 6);
$fdata6 = @file_get_contents($filename_v6);
}
if (!empty($fdata)) {
$cached_ip_s = explode('|', $fdata);
$cached_ip = $cached_ip_s[0];
echo sprintf(
'<font color="%s">%s</font>',
$ipaddr != $cached_ip ? 'red' : 'green',
htmlspecialchars($cached_ip)
);
} elseif (!empty($fdata6)) {
$cached_ipv6_s = explode('|', $fdata6);
$cached_ipv6 = $cached_ipv6_s[0];
echo sprintf(
'<font color="%s">%s</font>',
$ipv6addr != $cached_ipv6 ? 'red' : 'green',
htmlspecialchars($cached_ipv6)
);
} else {
echo sprintf('<span class="text-muted">%s</span>', gettext('N/A'));
}?>
</td>
<td><?=$dyndns['descr'];?></td>
<td class="text-nowrap">
<a href="services_dyndns_edit.php?id=<?=$i;?>" class="btn btn-default btn-xs"><i class="fa fa-pencil fa-fw"></i></a>
<a href="#" data-id="<?=$i;?>" class="act_delete_service btn btn-xs btn-default"><i class="fa fa-trash fa-fw"></i></a>
</td>
</tr>
<?php
$i++;
endforeach; ?>
</tbody>
</table>
</div>
</form>
</div>
</section>
</div>
</div>
</section>
<?php include("foot.inc"); ?>
File diff suppressed because it is too large Load Diff
@@ -1,4 +0,0 @@
<?php
$dyn_dns_status_title = gettext('Dynamic DNS');
$dyn_dns_status_title_link = 'services_dyndns.php';
@@ -1,172 +0,0 @@
<?php
/*
* Copyright (C) 2014-2016 Deciso B.V.
* Copyright (C) 2008 Ermal Luçi
* Copyright (C) 2013 Stanley P. Miller \ stan-qaz
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INClUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
require_once("guiconfig.inc");
require_once("widgets/include/dyn_dns_status.inc");
require_once("interfaces.inc");
require_once("plugins.inc.d/dyndns.inc");
$a_dyndns = &config_read_array('dyndnses', 'dyndns');
if (!empty($_REQUEST['getdyndnsstatus'])) {
$first_entry = true;
foreach ($a_dyndns as $dyndns) {
if ($first_entry) {
$first_entry = false;
} else {
// Put a vertical bar delimiter between the echoed HTML for each entry processed.
echo '|';
}
$filename = dyndns_cache_file($dyndns, 4);
$fdata = '';
if (!empty($dyndns['enable']) && file_exists($filename)) {
$ipaddr = get_dyndns_ip_address(dyndns_failover_interface($dyndns['interface'], 'all'), 4);
$fdata = @file_get_contents($filename);
}
$filename_v6 = dyndns_cache_file($dyndns, 6);
$fdata6 = '';
if (!empty($dyndns['enable']) && file_exists($filename_v6)) {
$ipv6addr = get_dyndns_ip_address(dyndns_failover_interface($dyndns['interface'], 'inet6'), 6);
$fdata6 = @file_get_contents($filename_v6);
}
if (!empty($fdata)) {
$cached_ip_s = explode('|', $fdata);
$cached_ip = $cached_ip_s[0];
echo sprintf(
'<span class="%s">%s</span>',
$ipaddr != $cached_ip ? 'text-danger' : '',
htmlspecialchars($cached_ip)
);
} elseif (!empty($fdata6)) {
$cached_ipv6_s = explode('|', $fdata6);
$cached_ipv6 = $cached_ipv6_s[0];
echo sprintf(
'<span class="%s">%s</span>',
$ipv6addr != $cached_ipv6 ? 'text-danger' : '',
htmlspecialchars($cached_ipv6)
);
} else {
echo gettext('N/A');
}
}
exit;
}
?>
<table class="table table-striped table-condensed">
<thead>
<tr>
<th colspan="4">
<div class="alert alert-warning" role="alert">
<strong>
<?=gettext("Please make sure to upgrade to os-ddclient before 23.7 is released as this plugin will be removed from our repository");?>
</strong>
</div>
</th>
</tr>
<tr>
<th style="word-break:break-word;"><?=gettext("Interface");?></th>
<th style="word-break:break-word;"><?=gettext("Service");?></th>
<th style="word-break:break-word;"><?=gettext("Hostname");?></th>
<th style="word-break:break-word;"><?=gettext("Cached IP");?></th>
</tr>
</thead>
<tbody>
<?php
$iflist = get_configured_interface_with_descr();
$types = dyndns_list();
$groupslist = return_gateway_groups_array();
foreach ($a_dyndns as $i => $dyndns) :?>
<tr ondblclick="document.location='services_dyndns_edit.php?id=<?=$i;?>'">
<td style="word-break:break-word;" <?= isset($dyndns['enable']) ? '' : 'class="text-muted"' ?>>
<?php
foreach ($iflist as $if => $ifdesc) {
if ($dyndns['interface'] == $if) {
echo "{$ifdesc}";
break;
}
}
foreach ($groupslist as $if => $group) {
if ($dyndns['interface'] == $if) {
echo "{$if}";
break;
}
}?>
</td>
<td style="word-break:break-word;" <?= isset($dyndns['enable']) ? '' : 'class="text-muted"' ?>>
<?php
if (isset($types[$dyndns['type']])) {
echo htmlspecialchars($types[$dyndns['type']]);
} else {
echo htmlspecialchars($dyndns['type']);
}
?>
</td>
<td style="word-break:break-word;" <?= isset($dyndns['enable']) ? '' : 'class="text-muted"' ?>>
<?= htmlspecialchars($dyndns['host']) ?>
</td>
<td style="word-break:break-word;" <?= isset($dyndns['enable']) ? '' : 'class="text-muted"' ?>>
<div id='dyndnsstatus<?=$i;?>'>
<?= gettext('Checking...') ?>
</div>
</td>
</tr>
<?php
endforeach;?>
</tbody>
</table>
<script>
function dyndns_getstatus()
{
scroll(0,0);
var url = "/widgets/widgets/dyn_dns_status.widget.php";
var pars = 'getdyndnsstatus=yes';
jQuery.ajax(url, {type: 'get', data: pars, complete: dyndnscallback});
// Refresh the status every 5 minutes
setTimeout('dyndns_getstatus()', 5*60*1000);
}
function dyndnscallback(transport)
{
// The server returns a string of statuses separated by vertical bars
var responseStrings = transport.responseText.split("|");
for (var count=0; count<responseStrings.length; count++) {
var divlabel = '#dyndnsstatus' + count;
jQuery(divlabel).prop('innerHTML',responseStrings[count]);
}
}
$(window).on("load", function() {
// Do the first status check 2 seconds after the dashboard opens
setTimeout('dyndns_getstatus()', 2000);
});
</script>