aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/ntopng/ntopng.xml30
-rw-r--r--config/tinydns/tinydns.inc47
-rw-r--r--config/tinydns/tinydns.xml124
3 files changed, 119 insertions, 82 deletions
diff --git a/config/ntopng/ntopng.xml b/config/ntopng/ntopng.xml
index dcb3f2b7..3d07b064 100644
--- a/config/ntopng/ntopng.xml
+++ b/config/ntopng/ntopng.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
+<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
+<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
<packagegui>
<copyright>
<![CDATA[
@@ -8,7 +8,7 @@
/* ========================================================================== */
/*
ntopng.xml
- part of pfSense (http://www.pfSense.com)
+ part of pfSense (https://www.pfSense.org/)
Copyright (C) 2014 ESF, LLC
All rights reserved.
*/
@@ -39,7 +39,7 @@
]]>
</copyright>
<name>ntopng</name>
- <version>1.2 v0.5</version>
+ <version>0.7.2</version>
<title>Diagnostics: ntopng Settings</title>
<savetext>Change</savetext>
<aftersaveredirect>pkg_edit.php?xml=ntopng.xml</aftersaveredirect>
@@ -146,6 +146,8 @@
config_lock();
global $config;
global $input_errors;
+ global $pf_version, $scripts_path, $fonts_path;
+ $pf_version=substr(trim(file_get_contents("/etc/version")),0,3);
if ($_POST) {
$config['installedpackages']['ntopng']['config'] = array();
$config['installedpackages']['ntopng']['config'][0] = $_POST;
@@ -156,15 +158,26 @@
safe_mkdir("/var/db/ntopng/rrd/graphics", 0755, true);
system("/bin/chmod -R 755 /var/db/ntopng");
system("/usr/sbin/chown -R nobody:nobody /var/db/ntopng");
- $pf_version=substr(trim(file_get_contents("/etc/version")),0,3);
+
if ($pf_version == "2.2") {
$fonts_path = "/usr/pbi/ntopng-" . php_uname("m") . "/local/lib/X11/fonts";
+ $scripts_path = "/usr/pbi/ntopng-" . php_uname("m") . "/local/share/ntopng/scripts";
} else if ($pf_version == "2.1") {
$fonts_path = "/usr/pbi/ntopng-" . php_uname("m") . "/lib/X11/fonts";
+ $scripts_path = "/usr/pbi/ntopng-" . php_uname("m") . "/share/ntopng/scripts";
} else {
$fonts_path = "/usr/local/lib/X11/fonts";
}
+ if ($pf_version == "2.1" || $pf_version == "2.2") {
+ $ntopng_share_path = "/usr/local/share/ntopng";
+ $scripts_link_path = $ntopng_share_path . "/scripts";
+ safe_mkdir("$ntopng_share_path", 0755, true);
+ if (!file_exists($scripts_link_path)) {
+ symlink($scripts_path, $scripts_link_path);
+ }
+ }
system("/bin/cp -Rp {$fonts_path}/webfonts/ {$fonts_path}/TTF/");
+
$first = 0;
foreach($ntopng_config['interface_array'] as $iface) {
$if = convert_friendly_interface_to_real_interface_name($iface);
@@ -211,7 +224,6 @@
$disable_alerts = "-H";
}
- $pf_version=substr(trim(file_get_contents("/etc/version")),0,3);
if ($pf_version == "2.2") {
$redis_path = "/usr/pbi/ntopng-" . php_uname("m") . "/local/bin";
} else if ($pf_version == "2.1") {
@@ -318,6 +330,12 @@
</custom_php_install_command>
<custom_php_deinstall_command>
exec("rm /usr/local/etc/rc.d/ntopng*");
+ $pf_version=substr(trim(file_get_contents("/etc/version")),0,3);
+ if ($pf_version == "2.1" || $pf_version == "2.2") {
+ if (is_dir("/usr/local/share/ntopng/")) {
+ exec("rm -rf /usr/local/share/ntopng/");
+ }
+ }
</custom_php_deinstall_command>
<custom_php_validation_command>
<![CDATA[
diff --git a/config/tinydns/tinydns.inc b/config/tinydns/tinydns.inc
index 5effa10c..f2bda436 100644
--- a/config/tinydns/tinydns.inc
+++ b/config/tinydns/tinydns.inc
@@ -63,6 +63,21 @@ function tinydns_custom_php_install_command() {
if($config['installedpackages']['tinydns']['config'][0]['refreshinterval'])
$refreshinterval = $config['installedpackages']['tinydns']['config'][0]['refreshinterval'];
+ $pf_version=substr(trim(file_get_contents("/etc/version")),0,3);
+ if ($pf_version == "2.2") {
+ $svscan_path = "/usr/pbi/djbdns-" . php_uname("m") . "/local/bin/svscan";
+ $svc_path = "/usr/pbi/djbdns-" . php_uname("m") . "/local/bin/svc";
+ $tinydns_path = "/usr/pbi/djbdns-" . php_uname("m") . "/local/bin";
+ } else if ($pf_version == "2.1") {
+ $svscan_path = "/usr/pbi/djbdns-" . php_uname("m") . "/bin/svscan";
+ $svc_path = "/usr/pbi/djbdns-" . php_uname("m") . "/bin/svc";
+ $tinydns_path = "/usr/pbi/djbdns-" . php_uname("m") . "/bin";
+ } else {
+ $svscan_path = "/usr/local/bin/svscan";
+ $svc_path = "/usr/local/bin/svc";
+ $tinydns_path = "/usr/local/bin";
+ }
+
$svscan = <<<EOD
#!/bin/sh
@@ -74,7 +89,7 @@ function tinydns_custom_php_install_command() {
name="svscan"
rcvar="\${name}_enable"
-command="/usr/local/bin/svscan"
+command="{$svscan_path}"
svscan_enable=\${svscan_enable-"YES"}
svscan_servicedir=\${svscan_servicedir-"{$g['varrun_path']}/service"}
logdir="/var/log/svscan"
@@ -90,7 +105,7 @@ svscan_start () {
echo "Starting svscan."
mkdir -p \$logdir
/usr/bin/env \
- PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
+ PATH={$tinydns_path}:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
/usr/sbin/daemon -f /bin/sh -c "\$command \$svscan_servicedir 2>&1 | /usr/local/bin/multilog t \$logdir" > /dev/null
EOD;
@@ -105,7 +120,7 @@ $svscan .= <<<EOD
svscan_stop_post () {
echo "Stopping svscan."
- find -L "\$svscan_servicedir" -mindepth 1 -maxdepth 2 -type d \( \! -path "\$svscan_servicedir/*/*" -or -name 'log' \) -print0 | xargs -0 /usr/local/bin/svc -dx
+ find -L "\$svscan_servicedir" -mindepth 1 -maxdepth 2 -type d \( \! -path "\$svscan_servicedir/*/*" -or -name 'log' \) -print0 | xargs -0 {$svc_path} -dx
/bin/pkill -F /var/run/ping_hosts.pid
}
@@ -132,11 +147,11 @@ ENDPHP\n";
$stop = "";
$interfaces = explode(",", $config['installedpackages']['tinydns']['config'][0]['interface']);
foreach ($interfaces as $dnsidx => $dnsif)
- $stop .= "\t/usr/local/bin/svc -dx {$g['varrun_path']}/service/dnscache{$dnsidx}\n";
+ $stop .= "\t{$svc_path} -dx {$g['varrun_path']}/service/dnscache{$dnsidx}\n";
$stop .= <<<ENDSH
- /usr/local/bin/svc -dx {$g['varrun_path']}/service/tinydns
- /usr/local/bin/svc -dx {$g['varrun_path']}/service/axfrdns
+ {$svc_path} -dx {$g['varrun_path']}/service/tinydns
+ {$svc_path} -dx {$g['varrun_path']}/service/axfrdns
/bin/rm -rf {$g['varrun_path']}/service/tinydns 2>/dev/null
/bin/rm -rf {$g['varetc_path']}/tinydns 2>/dev/null
/bin/rm -rf {$g['varrun_path']}/dnscache* 2>/dev/null
@@ -161,9 +176,19 @@ function tinydns_custom_php_deinstall_command() {
global $g, $config;
conf_mount_rw();
+
+ $pf_version=substr(trim(file_get_contents("/etc/version")),0,3);
+ if ($pf_version == "2.2") {
+ $svc_path = "/usr/pbi/djbdns-" . php_uname("m") . "/local/bin/svc";
+ } else if ($pf_version == "2.1") {
+ $svc_path = "/usr/pbi/djbdns-" . php_uname("m") . "/bin/svc";
+ } else {
+ $svc_path = "/usr/local/bin/svc";
+ }
+
/* destroy all daemontools items */
- exec("/usr/local/bin/svc -xk {$g['varetc_path']}/tinydns*");
- exec("/usr/local/bin/svc -xk {$g['varetc_path']}/dnscache*");
+ exec("{$svc_path} -xk {$g['varetc_path']}/tinydns*");
+ exec("{$svc_path} -xk {$g['varetc_path']}/dnscache*");
exec("/usr/local/etc/rc.d/tinydns.sh stop");
exec("/usr/local/etc/rc.d/svscan.sh stop");
exec("/usr/bin/killall supervise");
@@ -225,7 +250,7 @@ function tinydns_custom_php_changeip_command() {
}
exec("echo {$dnsserverip} > {$g['varetc_path']}/tinydns/env/IP");
- exec("/usr/local/bin/svc -xk {$g['varrun_path']}/service/tinydns");
+ exec("{$svc_path} -xk {$g['varrun_path']}/service/tinydns");
if(!empty($config['installedpackages']['tinydns']['config'][0]['enableforwarding'])) {
@@ -277,7 +302,7 @@ function tinydns_custom_php_changeip_command() {
/* setup symlink to start dnscache */
exec("/bin/ln -s {$g['varetc_path']}/dnscache{$dnsidx} {$g['varrun_path']}/service/");
- exec("/usr/local/bin/svc -xk {$g['varetc_path']}/dnscache{$dnsidx}");
+ exec("{$svc_path} -xk {$g['varetc_path']}/dnscache{$dnsidx}");
}
} else {
$interfaces = explode(",", $$config['installedpackages']['tinydns']['config'][0]['interface']);
@@ -285,7 +310,7 @@ function tinydns_custom_php_changeip_command() {
if(is_dir("{$g['varetc_path']}/dnscache{$dnsidx}"))
dnscache_use_root_servers($dnsidx);
}
- exec("/usr/local/bin/svc -xk {$g['varetc_path']}/dnscache*");
+ exec("{$svc_path} -xk {$g['varetc_path']}/dnscache*");
}
/* a wee bit of magic - something seems to start up a broken dnscache, the below kills it, and svc restarts it correctly. */
diff --git a/config/tinydns/tinydns.xml b/config/tinydns/tinydns.xml
index fa80953c..55ee3269 100644
--- a/config/tinydns/tinydns.xml
+++ b/config/tinydns/tinydns.xml
@@ -2,45 +2,47 @@
<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
<packagegui>
- <copyright>
- <![CDATA[
+ <copyright>
+ <![CDATA[
/* $Id$ */
-/* ========================================================================== */
+/* ====================================================================================== */
/*
- tinydns.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
- */
-/* ========================================================================== */
+ tinydns.xml
+ part of pfSense (https://www.pfSense.org/)
+ Copyright (C) 2009 Bill Marquette
+ Copyright (C) 2010 Ermal Luçi
+ Copyright (C) 2010-2011 Scott Ullrich
+ Copyright (C) 2012-2015 ESF, LLC
+ All rights reserved.
+*/
+/* ====================================================================================== */
/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
+ 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.
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
- 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.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
+ 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.
+*/
+/* ====================================================================================== */
+ ]]>
+ </copyright>
<name>tinydns</name>
<version>1.0</version>
<title>DNS Server: Settings</title>
@@ -94,62 +96,53 @@
<configpath>installedpackages->package->tinydns</configpath>
<additional_files_needed>
<prefix>/usr/local/pkg/</prefix>
- <chmod>077</chmod>
<item>https://packages.pfsense.org/packages/config/tinydns/tinydns.inc</item>
</additional_files_needed>
<additional_files_needed>
<prefix>/usr/local/pkg/pf/</prefix>
- <chmod>077</chmod>
<item>https://packages.pfsense.org/packages/config/tinydns/tinydns_xmlrpc_sync.php</item>
</additional_files_needed>
<additional_files_needed>
<prefix>/usr/local/pkg/</prefix>
- <chmod>077</chmod>
<item>https://packages.pfsense.org/packages/config/tinydns/tinydns_domains.xml</item>
</additional_files_needed>
<additional_files_needed>
<prefix>/usr/local/www/</prefix>
- <chmod>077</chmod>
<item>https://packages.pfsense.org/packages/config/tinydns/tinydns_status.php</item>
</additional_files_needed>
<additional_files_needed>
<prefix>/usr/local/www/</prefix>
- <chmod>077</chmod>
<item>https://packages.pfsense.org/packages/config/tinydns/tinydns_dhcp_filter.php</item>
</additional_files_needed>
<additional_files_needed>
<prefix>/usr/local/www/</prefix>
- <chmod>077</chmod>
<item>https://packages.pfsense.org/packages/config/tinydns/tinydns_filter.php</item>
</additional_files_needed>
<additional_files_needed>
<prefix>/usr/local/pkg/</prefix>
- <chmod>077</chmod>
+ <chmod>0775</chmod>
<item>https://packages.pfsense.org/packages/config/tinydns/tinydns_down.php</item>
</additional_files_needed>
<additional_files_needed>
<prefix>/usr/local/pkg/</prefix>
- <chmod>077</chmod>
+ <chmod>0775</chmod>
<item>https://packages.pfsense.org/packages/config/tinydns/tinydns_up.php</item>
</additional_files_needed>
<additional_files_needed>
<prefix>/usr/local/pkg/</prefix>
- <chmod>077</chmod>
+ <chmod>0775</chmod>
<item>https://packages.pfsense.org/packages/config/tinydns/tinydns_parse_logs.php</item>
</additional_files_needed>
<additional_files_needed>
<prefix>/usr/local/www/</prefix>
- <chmod>077</chmod>
<item>https://packages.pfsense.org/packages/config/tinydns/tinydns_view_logs.php</item>
</additional_files_needed>
<additional_files_needed>
<prefix>/usr/local/pkg/</prefix>
- <chmod>077</chmod>
<item>https://packages.pfsense.org/packages/config/tinydns/tinydns_sync.xml</item>
</additional_files_needed>
<additional_files_needed>
<prefix>/usr/local/www/wizards/</prefix>
- <chmod>077</chmod>
<item>https://packages.pfsense.org/packages/config/tinydns/new_zone_wizard.xml</item>
</additional_files_needed>
<fields>
@@ -237,23 +230,23 @@
<field>
<fielddescr>Hosts allowed to perform DNS Zone Transfers - Note: this requires TCP port 53 firewall permit rule!</fielddescr>
<fieldname>none</fieldname>
- <type>rowhelper</type>
- <rowhelper>
- <rowhelperfield>
- <fielddescr>IP Address</fielddescr>
- <fieldname>ztipaddress</fieldname>
- <description>Enter the IP Address that is allowed to transfer zone records (ex: 4.2.2.1)</description>
- <type>input</type>
- <size>20</size>
- </rowhelperfield>
- <rowhelperfield>
- <fielddescr>DNS Zone - Use * for all Zones</fielddescr>
- <fieldname>dnszone</fieldname>
- <description>Enter the DNS zone that this IP address is allowed to transfer (ex: domain.com)</description>
- <type>input</type>
- <size>20</size>
- </rowhelperfield>
- </rowhelper>
+ <type>rowhelper</type>
+ <rowhelper>
+ <rowhelperfield>
+ <fielddescr>IP Address</fielddescr>
+ <fieldname>ztipaddress</fieldname>
+ <description>Enter the IP Address that is allowed to transfer zone records (ex: 4.2.2.1)</description>
+ <type>input</type>
+ <size>20</size>
+ </rowhelperfield>
+ <rowhelperfield>
+ <fielddescr>DNS Zone - Use * for all Zones</fielddescr>
+ <fieldname>dnszone</fieldname>
+ <description>Enter the DNS zone that this IP address is allowed to transfer (ex: domain.com)</description>
+ <type>input</type>
+ <size>20</size>
+ </rowhelperfield>
+ </rowhelper>
</field>
</fields>
<custom_delete_php_command>
@@ -290,9 +283,10 @@
</custom_php_deinstall_command>
<custom_php_command_before_form>
<![CDATA[
- unset($_POST['temp']);
- if(!is_process_running("svscan"))
- $savemsg = "NOTE: svscan is not running. Please <a href='/status_services.php?mode=restartservice&service=svscan'>start svscan</a> to bring up the DNS Server";
+ unset($_POST['temp']);
+ if (!is_process_running("svscan")) {
+ $savemsg = "NOTE: svscan is not running. Please <a href='/status_services.php?mode=restartservice&service=svscan'>start svscan</a> to bring up the DNS Server";
+ }
]]>
</custom_php_command_before_form>
</packagegui>