diff --git a/net-mgmt/pfSense-pkg-darkstat/Makefile b/net-mgmt/pfSense-pkg-darkstat/Makefile index bda8e07237f3..fe83d18eefd4 100644 --- a/net-mgmt/pfSense-pkg-darkstat/Makefile +++ b/net-mgmt/pfSense-pkg-darkstat/Makefile @@ -1,8 +1,7 @@ # $FreeBSD$ PORTNAME= pfSense-pkg-darkstat -PORTVERSION= 3.1.2 -PORTREVISION= 1 +PORTVERSION= 3.1.3 CATEGORIES= net-mgmt MASTER_SITES= # empty DISTFILES= # empty diff --git a/net-mgmt/pfSense-pkg-darkstat/files/usr/local/pkg/darkstat.xml b/net-mgmt/pfSense-pkg-darkstat/files/usr/local/pkg/darkstat.xml index cc696e54d6db..ecff1d00fd98 100644 --- a/net-mgmt/pfSense-pkg-darkstat/files/usr/local/pkg/darkstat.xml +++ b/net-mgmt/pfSense-pkg-darkstat/files/usr/local/pkg/darkstat.xml @@ -8,7 +8,7 @@ * darkstat.xml * * part of pfSense (https://www.pfsense.org) - * Copyright (c) 2009-2015 Rubicon Communications, LLC (Netgate) + * Copyright (c) 2009-2017 Rubicon Communications, LLC (Netgate) * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -31,7 +31,7 @@ Darkstat Settings Setup darkstat specific settings.
Diagnostics
- /pkg_edit.php?xml=darkstat.xml&id=0 + /pkg_edit.php?xml=darkstat.xml darkstat @@ -39,11 +39,10 @@ darkstat Darkstat bandwidth monitoring daemon - installedpackages->package->$packagename->configuration->settings Darkstat Settings - /pkg_edit.php?xml=darkstat.xml&id=0 + /pkg_edit.php?xml=darkstat.xml @@ -62,8 +61,8 @@ Capture Interfaces capture_interfaces - (Default is LAN.) + Capture traffic on the specified network interface(s). + Default: LAN. ]]> interfaces_selection @@ -78,8 +77,8 @@ bind_interfaces - (The default is to listen on all interfaces.) + Bind the web interface to the IP address(es) of the specified interface(s). + Default: Listen on all interfaces. ]]> interfaces_selection @@ -132,8 +131,8 @@ - This cannot be used when the "local network" feature is enabled. + due to circumstances beyond the control of darkstat. + This cannot be used when the "local network" feature is enabled. ]]> checkbox @@ -162,9 +161,9 @@ hostsmax + The maximum number of hosts that will be kept in the hosts table. This is used to limit how much accounting data will be kept in memory.
- (If filled in, the number must be greater than 'Maximum number of hosts to keep' below.) + If filled in, the number must be greater than 'Maximum number of hosts to keep' below. ]]>
input @@ -175,9 +174,9 @@ hostskeep + When the hosts table hits 'Maximum hosts count' and traffic is seen from a new host, we clean out the hosts table, keeping only the top number of hosts, sorted by total traffic.
- (If filled in, the number must be lower than 'Maximum hosts count' above.) + If filled in, the number must be lower than 'Maximum hosts count' above. ]]>
input @@ -188,9 +187,9 @@ portsmax + The maximum number of ports that will be tracked for each host. This is used to limit how much accounting data will be kept in memory.
- (If filled in, the number must be greater than 'Maximum number of ports to keep' below.) + If filled in, the number must be greater than 'Maximum number of ports to keep' below. ]]>
input @@ -202,7 +201,7 @@ - (If filled in, the number must be lower than 'Maximum ports count' above.) + If filled in, the number must be lower than 'Maximum ports count' above. ]]> input @@ -213,17 +212,19 @@ advfilter
- Example 1: We only want to account for SSH traffic.
+ Use the specified filter expression when capturing traffic. Click Info for examples. +
+ Example 1: We only want to account for SSH traffic.
Filter expression: port 22

- Example 2: We don't want to account for traffic between internal IPs.
+ Example 2: We don't want to account for traffic between internal IPs.
Filter expression: not (src net 192.168.0 and dst net 192.168.0)

- NOTE: Filter syntax is beyond the scope of this description; please refer to + NOTE: Filter syntax is beyond the scope of this description; please refer to tcpdump(1), pcap-filter(7) and darkstat(8) documentation.
- WARNING: You are completely on your own with this! If misconfigured, darkstat will malfunction or even not start at all. + WARNING: You are completely on your own with this! If misconfigured, darkstat will malfunction or even not start at all. +
]]>
textarea @@ -240,6 +241,15 @@ global $config, $darkstat_config; $darkstat_config =& $config['installedpackages']['darkstat']['config'][0]; + /* If the service is (being) disabled, stop it (if running), remove rc script and do nothing else */ + if ($darkstat_config['enable'] != "on") { + if (is_process_running("darkstat")) { + stop_service("darkstat"); + } + unlink_if_exists('/usr/local/etc/rc.d/darkstat.sh'); + return; + } + /* Configure capture interface(s) */ $capture_interfaces = $darkstat_config['capture_interfaces'] ?: 'lan'; foreach (explode(",", $capture_interfaces) as $iface) { @@ -317,14 +327,13 @@ ) ); - /* If the service is (being) disabled, stop it (if running) and do nothing else */ - if (!($darkstat_config['enable'])) { - if (is_process_running("darkstat")) { - stop_service("darkstat"); - } + /* Do not (re)start service on boot */ + if (platform_booting()) { return; - } else { + } elseif (is_process_running("darkstat")) { restart_service("darkstat"); + } else { + start_service("darkstat"); } conf_mount_ro(); @@ -332,49 +341,46 @@ function validate_input_darkstat($post, &$input_errors) { if (($_POST['port']) && ($_POST['port'] < 1 || $_POST['port'] < 65535 || !is_numericint($_POST['port']))) { - $input_errors[] .= gettext("The value for 'Maximum number of ports' to keep' must be a positive integer between 1 and 65535."); + $input_errors[] = gettext("The value for 'Maximum number of ports' to keep' must be a positive integer between 1 and 65535."); } if (($_POST['hostsmax']) && ($_POST['hostsmax'] < 1 || !is_numericint($_POST['hostsmax']))) { $input_errors[] = gettext("The value for 'Maximum hosts count' must be a positive integer."); } if (($_POST['hostskeep']) && ($_POST['hostskeep'] < 1 || !is_numericint($_POST['hostskeep']))) { - $input_errors[] .= gettext("The value for 'Maximum number of hosts to keep' must be a positive integer."); + $input_errors[] = gettext("The value for 'Maximum number of hosts to keep' must be a positive integer."); } if ($_POST['hostsmax'] || $_POST['hostskeep']) { if ($_POST['hostsmax'] <= $_POST['hostskeep']) { - $input_errors[] .= gettext("'Maximum hosts count' must be greater than 'Maximum number of hosts to keep'."); + $input_errors[] = gettext("'Maximum hosts count' must be greater than 'Maximum number of hosts to keep'."); } } if (($_POST['portsmax']) && ($_POST['portsmax'] < 1 || !is_numericint($_POST['portsmax']))) { - $input_errors[] .= gettext("The value for 'Maximum ports count' must be a positive integer."); + $input_errors[] = gettext("The value for 'Maximum ports count' must be a positive integer."); } if (($_POST['portskeep']) && ($_POST['portskeep'] < 1 || !is_numericint($_POST['portskeep']))) { - $input_errors[] .= gettext("The value for 'Maximum number of ports' to keep' must be a positive integer."); + $input_errors[] = gettext("The value for 'Maximum number of ports' to keep' must be a positive integer."); } if ($_POST['portsmax'] || $_POST['portskeep']) { if ($_POST['portsmax'] <= $_POST['portskeep']) { - $input_errors[] .= gettext("'Maximum ports count' must be greater than 'Maximum number of ports to keep'."); + $input_errors[] = gettext("'Maximum ports count' must be greater than 'Maximum number of ports to keep'."); } } if ($_POST['localnetworkenable'] && $_POST['nopromisc'] != "") { - $input_errors[] .= gettext("'Do not use promiscuous mode to capture' cannot be used when the 'local network' feature is enabled."); + $input_errors[] = gettext("'Do not use promiscuous mode to capture' cannot be used when the 'local network' feature is enabled."); } if ($_POST['localnetwork']) { $int = convert_friendly_interface_to_real_interface_name($post['localnetwork']); $ip = find_interface_ip($int); if (!is_ipaddrv4($ip)) { - $input_errors[] .= gettext("The selected 'local network' interface has no IPv4 configured. Configured IPv4 is required."); + $input_errors[] = gettext("The selected 'local network' interface has no IPv4 configured. Configured IPv4 is required."); } } if (($post['advfilter']) && !preg_match("/^[a-zA-Z0-9\+\-\=\(\):. ]*$/", $post['advfilter'])) { - $input_errors[] .= gettext('Advanced traffic filtering options may only contain characters matching ^[a-zA-Z0-9\+\-\=\(\):. ]*$ regexp.'); + $input_errors[] = gettext('Advanced traffic filtering options may only contain characters matching ^[a-zA-Z0-9\+\-\=\(\):. ]*$ regexp.'); } } ]]> - - sync_package_darkstat(); - sync_package_darkstat();