Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve ntopng bootstrap conversion, hide defunct historical data feature pending rework #255

Merged
merged 4 commits into from
Jan 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion net/pfSense-pkg-ntopng/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# $FreeBSD$

PORTNAME= pfSense-pkg-ntopng
PORTVERSION= 0.8.5
PORTVERSION= 0.8.6
CATEGORIES= net
MASTER_SITES= # empty
DISTFILES= # empty
Expand Down
16 changes: 9 additions & 7 deletions net/pfSense-pkg-ntopng/files/usr/local/pkg/ntopng.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* ntopng.inc
*
* part of pfSense (https://www.pfsense.org)
* Copyright (c) 2015 Rubicon Communications, LLC (Netgate)
* Copyright (c) 2015-2017 Rubicon Communications, LLC (Netgate)
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -76,7 +76,7 @@ function ntopng_sync_package() {
if ($_POST['Submit'] == "Update GeoIP Data") {
return;
}
if ($_POST['Delete'] == "Delete (Historical) Data") {
if ($_POST['Delete'] == "Delete Data") {
return;
}

Expand Down Expand Up @@ -127,10 +127,12 @@ function ntopng_sync_package() {
break;
}

/* Historical Data Storage, Dump expired flows */
// Pending rework - see https://redmine.pfsense.org/issues/7000
/* Historical Data Storage, Dump expired flows
if ($ntopng_config['dump_flows'] == "on") {
$dump_flows = "-F";
}
*/

/* Disable alerts */
if ($ntopng_config['disable_alerts'] == "on") {
Expand Down Expand Up @@ -287,7 +289,7 @@ function ntopng_flush_historical_data() {
ntopng_services_stop();
if (is_dir("/var/db/ntopng/")) {
mwexec("rm -rf /var/db/ntopng/");
log_error(gettext("[ntopng] Deleted ntopng historical traffic data and graphs."));
log_error(gettext("[ntopng] Deleted ntopng traffic data and graphs."));
} else {
log_error(gettext("[ntopng] Nothing to delete; /var/db/ntopng/ directory not found."));
}
Expand All @@ -299,9 +301,9 @@ function ntopng_flush_historical_data() {
ntopng_sync_package();
log_error(gettext("[ntopng] Resynced ntopng settings."));
} else {
$error = "Cannot delete historical data - redis-server is not running.";
$error = "Cannot delete data - redis-server is not running.";
log_error(gettext("[ntopng] {$error}"));
file_notice("ntopng", $error, "ntopng Delete Historical Data", "");
file_notice("ntopng", $error, "ntopng Delete Data", "");
}
}

Expand All @@ -318,7 +320,7 @@ function ntopng_validate_input($post, &$input_errors) {
if ($post['Submit'] == "Update GeoIP Data") {
ntopng_update_geoip();
}
if ($post['Delete'] == "Delete (Historical) Data") {
if ($post['Delete'] == "Delete Data") {
ntopng_flush_historical_data();
}
}
Expand Down
42 changes: 33 additions & 9 deletions net/pfSense-pkg-ntopng/files/usr/local/pkg/ntopng.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* ntopng.xml
*
* part of pfSense (https://www.pfsense.org)
* Copyright (c) 2014-2015 Rubicon Communications, LLC (Netgate)
* Copyright (c) 2014-2017 Rubicon Communications, LLC (Netgate)
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -68,10 +68,11 @@
<field>
<fielddescr>Keep Data/Settings</fielddescr>
<fieldname>keepdata</fieldname>
<description>Keep ntopng settings, graphs and traffic data. (Default: on)</description>
<description>Keep ntopng settings, graphs and traffic data.</description>
<sethelp>
<![CDATA[
<strong><span class="errmsg">Note:</span> If 'Keep Data/Settings' is disabled, all settings and data will be wiped on package uninstall/reinstall/upgrade!</strong>
<strong><span class="text-danger">Note:</span> If disabled, all settings and data will be wiped
on package uninstall/reinstall/upgrade!</strong>
]]>
</sethelp>
<type>checkbox</type>
Expand Down Expand Up @@ -106,10 +107,7 @@
<fieldname>dns_mode</fieldname>
<description>
<![CDATA[
Configures how name resolution is handled.<br /><br />
Additionally, GeoIP Data can provide location information about IP addresses.<br />
This product includes GeoLite data created by MaxMind, available from <a href="http://www.maxmind.com">http://www.maxmind.com</a><br /><br />
<input type="submit" name="Submit" value="Update GeoIP Data" />
Configures how name resolution is handled.
]]>
</description>
<type>select</type>
Expand All @@ -121,13 +119,25 @@
<option><value>3</value><name>Don't decode DNS responses and don't resolve numeric IPs</name></option>
</options>
</field>
<field>
<fielddescr>GeoIP Data</fielddescr>
<description>
<![CDATA[
Additionally, GeoIP Data can provide location information about IP addresses.
<div class="infoblock blockopen">
This product includes GeoLite data created by MaxMind, available from <a href="http://www.maxmind.com" target="_blank">http://www.maxmind.com</a><br /></div><br />
<button class="btn btn-success btn-sm" name='Submit' id='update_geoip' type='submit' value='Update GeoIP Data'><i class="fa fa-refresh icon-embed-btn"></i>Update GeoIP Data</button>
]]>
</description>
<type>info</type>
</field>
<field>
<fielddescr>Local Networks</fielddescr>
<fieldname>local_networks</fieldname>
<description>
<![CDATA[
Configures how Local Networks are defined.<br />
(Default: Consider all RFC1918 networks local)
Configures how Local Networks are defined.
<span class="text-info">Default: Consider all RFC1918 networks local.</span>
]]>
</description>
<type>select</type>
Expand All @@ -138,6 +148,8 @@
<option><value>lanonly</value><name>Consider only LAN interface local</name></option>
</options>
</field>
<!-- Hide nonfunctional stuff pending rework - see https://redmine.pfsense.org/issues/7000 -->
<!--
<field>
<fielddescr>Historical Data Storage</fielddescr>
<fieldname>dump_flows</fieldname>
Expand All @@ -154,6 +166,18 @@
</sethelp>
<type>checkbox</type>
</field>
-->
<field>
<fielddescr>Delete ntopng Data</fielddescr>
<description>
<![CDATA[
Useful if you are running out of free disk space, or simply want to reset graphs and data.<br/>
<strong><span class="text-danger">WARNING:</span> This will delete all ntopng graphs, traffic data and dump flows!<br/><br/>
<button class="btn btn-warning btn-sm" name='Delete' id='delete_ntopng_data' type='submit' value='Delete Data'><i class="fa fa-trash icon-embed-btn"></i>Delete Data</button>
]]>
</description>
<type>info</type>
</field>
<field>
<fielddescr>Disable Alerts</fielddescr>
<fieldname>disable_alerts</fieldname>
Expand Down