diff --git a/plist b/plist index 17c3f8e1e..ef97afa8b 100644 --- a/plist +++ b/plist @@ -35,7 +35,7 @@ /usr/local/etc/inc/plugins.inc /usr/local/etc/inc/plugins.inc.d/dnsmasq.inc /usr/local/etc/inc/plugins.inc.d/dyndns.inc -/usr/local/etc/inc/plugins.inc.d/dyndns/phpdns.inc +/usr/local/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc /usr/local/etc/inc/plugins.inc.d/dyndns/r53.inc /usr/local/etc/inc/plugins.inc.d/ipfw.inc /usr/local/etc/inc/plugins.inc.d/ipsec.inc diff --git a/src/etc/inc/gwlb.inc b/src/etc/inc/gwlb.inc index 4987fdae9..18623ad31 100644 --- a/src/etc/inc/gwlb.inc +++ b/src/etc/inc/gwlb.inc @@ -92,8 +92,8 @@ rrd interval 60s; ## These parameters can be overridden in a specific alarm configuration alarm default { - command on "/usr/local/opnsense/service/configd_ctl.py -m 'dyndns reload %T' 'ipsecdns reload' 'openvpn reload %T' 'filter reload' " - command off "/usr/local/opnsense/service/configd_ctl.py -m 'dyndns reload %T' 'ipsecdns reload' 'openvpn reload %T' 'filter reload' " + command on "/usr/local/opnsense/service/configd_ctl.py -m 'dyndns reload %T' 'rfc2136 reload %T' 'ipsecdns reload' 'openvpn reload %T' 'filter reload' " + command off "/usr/local/opnsense/service/configd_ctl.py -m 'dyndns reload %T' 'rfc2136 reload %T' 'ipsecdns reload' 'openvpn reload %T' 'filter reload' " combine 10s } diff --git a/src/etc/inc/plugins.inc.d/dyndns.inc b/src/etc/inc/plugins.inc.d/dyndns.inc index 6c72a3570..6f6fc37b3 100644 --- a/src/etc/inc/plugins.inc.d/dyndns.inc +++ b/src/etc/inc/plugins.inc.d/dyndns.inc @@ -29,7 +29,7 @@ POSSIBILITY OF SUCH DAMAGE. */ -require_once('plugins.inc.d/dyndns/phpdns.inc'); +require_once('plugins.inc.d/dyndns/phpDynDNS.inc'); require_once('plugins.inc.d/dyndns/r53.inc'); function dyndns_configure() @@ -56,6 +56,26 @@ function dyndns_enabled() return false; } +function dyndns_services() +{ + global $config; + + $services = array(); + + if (dyndns_enabled()) { + $services[] = array( + 'description' => gettext('Dynamic DNS'), + 'configd' => array( + 'restart' => array('dyndns reload'), + ), + 'nocheck' => true, + 'name' => 'dyndns', + ); + } + + return $services; +} + function dyndns_cron() { $jobs = array(); diff --git a/src/etc/inc/plugins.inc.d/dyndns/phpdns.inc b/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc similarity index 97% rename from src/etc/inc/plugins.inc.d/dyndns/phpdns.inc rename to src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc index db42321b4..32ec346d1 100644 --- a/src/etc/inc/plugins.inc.d/dyndns/phpdns.inc +++ b/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc @@ -147,7 +147,7 @@ $this->_curlSslVerifypeer = $curlSslVerifypeer; $this->_dnsVerboseLog = $dnsVerboseLog; if ($this->_dnsVerboseLog) - log_error("DynDns: updatedns() starting"); + log_error("Dynamic DNS: updatedns() starting"); $dyndnslck = lock("DDNS".$dnsID, LOCK_EX); @@ -279,7 +279,7 @@ function _update() { if ($this->_dnsVerboseLog) - log_error("Dynamic DNS ({$this->_dnsHost}): DynDns _update() starting."); + log_error("Dynamic DNS ({$this->_dnsHost}): _update() starting."); if ($this->_dnsService != 'ods' and $this->_dnsService != 'route53 ') { $ch = curl_init(); @@ -649,7 +649,7 @@ break; case 'eurodns': if ($this->_dnsVerboseLog) - log_error("EuroDynDns ({$this->_dnsHost}) DNS update() starting."); + log_error("EuroDNS ({$this->_dnsHost}) DNS update() starting."); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser.':'.$this->_dnsPass); $server = "https://eurodyndns.org/update/"; @@ -729,7 +729,7 @@ */ function _checkStatus($ch, $data) { if ($this->_dnsVerboseLog) { - log_error("Dynamic DNS ({$this->_dnsHost}): DynDns _checkStatus() starting."); + log_error("Dynamic DNS ({$this->_dnsHost}): _checkStatus() starting."); log_error("Dynamic DNS ({$this->_dnsHost}): Current Service: {$this->_dnsService}"); } $successful_update = false; @@ -981,7 +981,7 @@ break; case 'dnsexit': if (preg_match("/is the same/i", $data)) { - $status = "phpDynDns ({$this->_dnsHost}): (Success) No Change In IP Address"; + $status = "Dynamic DNS ({$this->_dnsHost}): (Success) No Change In IP Address"; $successful_update = true; } else if (preg_match("/Success/i", $data)) { $status = "Dynamic DNS ({$this->_dnsHost}): (Success) IP Address Changed Successfully!"; @@ -1019,7 +1019,7 @@ } else if (preg_match('/yours/i', $data)) { $status = "Dynamic DNS ({$this->_dnsHost}): (Error) hostname specified exists, but not under the username specified."; } else if (preg_match('/abuse/i', $data)) { - $status = "phpDynDns ({$this->_dnsHost}): (Error) Updating too frequently, considered abuse."; + $status = "Dynamic DNS ({$this->_dnsHost}): (Error) Updating too frequently, considered abuse."; } else { $status = "Dynamic DNS ({$this->_dnsHost}): (Unknown Response)"; log_error("Dynamic DNS ({$this->_dnsHost}): PAYLOAD: {$data}"); @@ -1323,10 +1323,10 @@ $wan_ip = $this->_checkIP(); if ($wan_ip == 0) { - log_error("DynDns ({$this->_dnsHost}): Current WAN IP could not be determined, skipping update process."); + log_error("Dynamic DNS ({$this->_dnsHost}): Current WAN IP could not be determined, skipping update process."); return false; } - $log_error = "DynDns ({$this->_dnsHost}): Current WAN IP: {$wan_ip} "; + $log_error = "Dynamic DNS ({$this->_dnsHost}): Current WAN IP: {$wan_ip} "; if ($this->_useIPv6 == true) { if (file_exists($this->_cacheFile_v6)) { @@ -1367,13 +1367,13 @@ /* lets determine if the item needs updating */ if ($cacheIP != $wan_ip) { $needs_updating = true; - $update_reason = "DynDns: cacheIP != wan_ip. Updating. "; + $update_reason = "Dynamic DNS: cacheIP != wan_ip. Updating. "; $update_reason .= "Cached IP: {$cacheIP} WAN IP: {$wan_ip} "; } if (($currentTime - $cacheTime) > $maxCacheAgeSecs) { $needs_updating = true; $this->_forceUpdateNeeded = true; - $update_reason = "DynDns: More than " . $this->_dnsMaxCacheAgeDays . " days. Updating. "; + $update_reason = "Dynamic DNS: More than " . $this->_dnsMaxCacheAgeDays . " days. Updating. "; $update_reason .= "{$currentTime} - {$cacheTime} > {$maxCacheAgeSecs} "; } if ($initial == true) { @@ -1386,7 +1386,7 @@ */ if ($needs_updating == true) { if ($this->_dnsVerboseLog) - log_error("DynDns ({$this->_dnsHost}): {$update_reason}"); + log_error("Dynamic DNS ({$this->_dnsHost}): {$update_reason}"); return true; } @@ -1425,7 +1425,7 @@ $try++; } if ($try >= 3) { - log_error("Dyndns debug information ({$this->_dnsHost}): Could not resolve {$hosttocheck} to ip using interface ip {$ip_address}."); + log_error("Dynamic DNS debug information ({$this->_dnsHost}): Could not resolve {$hosttocheck} to ip using interface ip {$ip_address}."); return 0; } $ip_ch = curl_init("http://{$checkip}"); @@ -1444,14 +1444,14 @@ $ip_address = trim($matches[1]); if (is_ipaddr($ip_address)) { if ($this->_dnsVerboseLog) - log_error("DynDns ({$this->_dnsHost}): {$ip_address} extracted from {$hosttocheck}"); + log_error("Dynamic DNS ({$this->_dnsHost}): {$ip_address} extracted from {$hosttocheck}"); } else { - log_error("DynDns ({$this->_dnsHost}): IP address could not be extracted from {$hosttocheck}"); + log_error("Dynamic DNS ({$this->_dnsHost}): IP address could not be extracted from {$hosttocheck}"); return 0; } } else { if ($this->_dnsVerboseLog) - log_error("DynDns ({$this->_dnsHost}): {$ip_address} extracted from local system."); + log_error("Dynamic DNS ({$this->_dnsHost}): {$ip_address} extracted from local system."); } $this->_dnsIP = $ip_address; diff --git a/src/etc/inc/plugins.inc.d/pf.inc b/src/etc/inc/plugins.inc.d/pf.inc index 4dd7bb6e3..892514b74 100644 --- a/src/etc/inc/plugins.inc.d/pf.inc +++ b/src/etc/inc/plugins.inc.d/pf.inc @@ -38,8 +38,6 @@ function pf_services() 'description' => gettext('Packet Filter'), 'configd' => array( 'restart' => array('filter reload'), - 'start' => array('filter reload'), - 'stop' => array('filter reload'), ), 'nocheck' => true, 'name' => 'pf', diff --git a/src/etc/inc/plugins.inc.d/rfc2136.inc b/src/etc/inc/plugins.inc.d/rfc2136.inc index 0140faf0c..f86ed3c93 100644 --- a/src/etc/inc/plugins.inc.d/rfc2136.inc +++ b/src/etc/inc/plugins.inc.d/rfc2136.inc @@ -53,6 +53,26 @@ function rfc2136_enabled() return false; } +function rfc2136_services() +{ + global $config; + + $services = array(); + + if (rfc2136_enabled()) { + $services[] = array( + 'description' => gettext('RFC 2136'), + 'configd' => array( + 'restart' => array('rfc2136 reload'), + ), + 'nocheck' => true, + 'name' => 'rfc2136', + ); + } + + return $services; +} + function rfc2136_cron() { $jobs = array(); diff --git a/src/etc/inc/upgrade_config.inc b/src/etc/inc/upgrade_config.inc index efcea2deb..461699a67 100644 --- a/src/etc/inc/upgrade_config.inc +++ b/src/etc/inc/upgrade_config.inc @@ -1295,8 +1295,8 @@ function upgrade_046_to_047() { } } - -function upgrade_047_to_048() { +function upgrade_047_to_048() +{ global $config; if (!empty($config['dyndns'])) { $config['dyndnses'] = array(); @@ -1311,7 +1311,7 @@ function upgrade_047_to_048() { $tempdyn['host'] = $config['dyndns'][0]['host']; $tempdyn['mx'] = $config['dyndns'][0]['mx']; $tempdyn['interface'] = "wan"; - $tempdyn['descr'] = sprintf('Upgraded Dyndns %s', $tempdyn['type']); + $tempdyn['descr'] = sprintf('Upgraded dynamic DNS %s', $tempdyn['type']); $config['dyndnses']['dyndns'][] = $tempdyn; } unset($config['dyndns']); diff --git a/src/opnsense/mvc/app/models/OPNsense/Base/Menu/Menu.xml b/src/opnsense/mvc/app/models/OPNsense/Base/Menu/Menu.xml index a95b3a760..b281317d0 100644 --- a/src/opnsense/mvc/app/models/OPNsense/Base/Menu/Menu.xml +++ b/src/opnsense/mvc/app/models/OPNsense/Base/Menu/Menu.xml @@ -246,9 +246,9 @@ - + - + diff --git a/src/opnsense/service/conf/actions.d/actions_dyndns.conf b/src/opnsense/service/conf/actions.d/actions_dyndns.conf index d388ea7c8..e1ecd95fb 100644 --- a/src/opnsense/service/conf/actions.d/actions_dyndns.conf +++ b/src/opnsense/service/conf/actions.d/actions_dyndns.conf @@ -1,6 +1,6 @@ [reload] command:/usr/local/etc/rc.dyndns.update -description:DynDNS Update +description:Dynamic DNS Update parameters:%s type:script message:updating dyndns %s diff --git a/src/www/services_dyndns.php b/src/www/services_dyndns.php index b92d52b8d..34e5d4afc 100644 --- a/src/www/services_dyndns.php +++ b/src/www/services_dyndns.php @@ -30,6 +30,7 @@ require_once("guiconfig.inc"); require_once("interfaces.inc"); require_once("services.inc"); +require_once("system.inc"); require_once("plugins.inc.d/dyndns.inc"); if (empty($config['dyndnses']['dyndns']) || !isset($config['dyndnses']['dyndns'])) { @@ -44,7 +45,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { @unlink("/conf/dyndns_{$conf['interface']}{$conf['type']}" . escapeshellarg($conf['host']) . "{$conf['id']}.cache"); unset($a_dyndns[$_POST['id']]); write_config(); - configd_run('dyndns reload', true); + system_cron_configure(); } exit; } elseif (isset($_POST['act']) && $_POST['act'] == "toggle" && isset($_POST['id'])) { @@ -55,20 +56,25 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $a_dyndns[$_POST['id']]['enable'] = true; } write_config(); - configd_run('dyndns reload', true); + 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); -$main_buttons = array( - array('label'=>gettext('Add'), 'href'=>'services_dyndns_edit.php'), -); -?> +legacy_html_escape_form_data($a_dyndns); + +$main_buttons = array( + array('label' => gettext('Add'), 'href' => 'services_dyndns_edit.php'), +); + +?>