From 7868071344a84a70c88d39cdd8de159ba82db782 Mon Sep 17 00:00:00 2001 From: Cino Date: Wed, 7 Jan 2015 20:30:49 -0500 Subject: ntopng - add checkbox to enable historical data storage add checkbox to enable historical data storage ntopng Command Line Options: --dump-flows | -F Dump expired flows. If ntopng is compiled with sqlite support, flows can dumped persistently on disk using this option. Databases are created daily under /db. https://forum.pfsense.org/index.php?topic=80461.msg473467#msg473467 --- config/ntopng/ntopng.xml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/config/ntopng/ntopng.xml b/config/ntopng/ntopng.xml index 45b68bdc..82999978 100644 --- a/config/ntopng/ntopng.xml +++ b/config/ntopng/ntopng.xml @@ -118,6 +118,12 @@ + + Historical Data Storage + dump_flows + Turn historical data storages on + checkbox + = on) { + $dump_flows = "-F"; + } + $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"; @@ -188,7 +199,7 @@ // Add support for --data-dir /somewhere, --httpdocs-dir /somewhereelse, // --dump-timeline (on/off) --http-port, --https-port - $start .= "\t/usr/local/bin/ntopng -s -e {$ifaces} {$dns_mode} {$aggregations} {$local_networks} &"; + $start .= "\t/usr/local/bin/ntopng -s -e {$dump_flows} {$ifaces} {$dns_mode} {$aggregations} {$local_networks} &"; write_rcfile(array( "file" => "ntopng.sh", "start" => $start, @@ -238,4 +249,4 @@ } ]]> - \ No newline at end of file + -- cgit v1.2.3 From e0d0d5a32d05ac59d7b5efaf77eefd0b5bf28995 Mon Sep 17 00:00:00 2001 From: Cino Date: Wed, 7 Jan 2015 20:39:20 -0500 Subject: ntop - change location of database and pid changed database/pid location to /var/db/ntopng and /var/run/ntopng.pid It was defaulting to /var/tmp/ntopng -d /var/db/ntopng -G /var/run/ntopng.pid --- config/ntopng/ntopng.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/ntopng/ntopng.xml b/config/ntopng/ntopng.xml index 82999978..b656e483 100644 --- a/config/ntopng/ntopng.xml +++ b/config/ntopng/ntopng.xml @@ -199,7 +199,7 @@ // Add support for --data-dir /somewhere, --httpdocs-dir /somewhereelse, // --dump-timeline (on/off) --http-port, --https-port - $start .= "\t/usr/local/bin/ntopng -s -e {$dump_flows} {$ifaces} {$dns_mode} {$aggregations} {$local_networks} &"; + $start .= "\t/usr/local/bin/ntopng -d /var/db/ntopng -G /var/run/ntopng.pid -s -e {$dump_flows} {$ifaces} {$dns_mode} {$aggregations} {$local_networks} &"; write_rcfile(array( "file" => "ntopng.sh", "start" => $start, -- cgit v1.2.3 From 5b7db3419ae520c2e031a17274cd2261a6043776 Mon Sep 17 00:00:00 2001 From: Cino Date: Thu, 8 Jan 2015 06:55:21 -0500 Subject: update ntopng version --- pkg_config.10.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg_config.10.xml b/pkg_config.10.xml index c66f7909..d06dc9a2 100644 --- a/pkg_config.10.xml +++ b/pkg_config.10.xml @@ -258,7 +258,7 @@ databases/redis databases/gdbm net/GeoIP x11-fonts/font-util x11-fonts/webfonts graphics/graphviz net/ntopng - 1.2.1 v0.2 + 1.2.1 v0.3 ALPHA 2.2 https://packages.pfsense.org/packages/config/ntopng/ntopng.xml -- cgit v1.2.3 From 85f6996c516c7b54adfe035f08ad866f8654e9c4 Mon Sep 17 00:00:00 2001 From: Cino Date: Thu, 8 Jan 2015 06:56:53 -0500 Subject: update ntopng version --- pkg_config.8.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg_config.8.xml b/pkg_config.8.xml index da853b8f..ea9340dc 100644 --- a/pkg_config.8.xml +++ b/pkg_config.8.xml @@ -365,7 +365,7 @@ databases/redis databases/gdbm net/GeoIP x11-fonts/font-util x11-fonts/webfonts graphics/graphviz net/ntopng - 1.1 v0.2 + 1.1 v0.3 ALPHA 2.1.4 https://packages.pfsense.org/packages/config/ntopng/ntopng.xml -- cgit v1.2.3 From 782aaa0d534cf731b5a92d6889f8f7ab69188025 Mon Sep 17 00:00:00 2001 From: Cino Date: Thu, 8 Jan 2015 06:58:54 -0500 Subject: update ntopng version --- pkg_config.8.xml.amd64 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg_config.8.xml.amd64 b/pkg_config.8.xml.amd64 index 251d7214..92d92277 100644 --- a/pkg_config.8.xml.amd64 +++ b/pkg_config.8.xml.amd64 @@ -352,7 +352,7 @@ databases/redis databases/gdbm net/GeoIP x11-fonts/font-util x11-fonts/webfonts graphics/graphviz net/ntopng - 1.1 v0.2 + 1.1 v0.3 ALPHA 2.1.4 https://packages.pfsense.org/packages/config/ntopng/ntopng.xml -- cgit v1.2.3 From 8052e07bef11260ef1876f63b70853ffd1dee253 Mon Sep 17 00:00:00 2001 From: jim-p Date: Fri, 9 Jan 2015 08:18:59 -0500 Subject: Some variable and path fixes for squidGuard's blacklist update code. --- config/squidGuard/squidguard.xml | 2 +- config/squidGuard/squidguard_configurator.inc | 60 +++++++++++++-------------- pkg_config.10.xml | 2 +- pkg_config.8.xml | 2 +- pkg_config.8.xml.amd64 | 2 +- 5 files changed, 34 insertions(+), 34 deletions(-) diff --git a/config/squidGuard/squidguard.xml b/config/squidGuard/squidguard.xml index 62882539..a41507a7 100644 --- a/config/squidGuard/squidguard.xml +++ b/config/squidGuard/squidguard.xml @@ -6,7 +6,7 @@ Describe your package requirements here Currently there are no FAQ items provided. squidguardgeneral - 1.4_4 pkg v.1.9.6 + 1.4_4 pkg v.1.9.7 Proxy filter SquidGuard: General settings /usr/local/pkg/squidguard.inc diff --git a/config/squidGuard/squidguard_configurator.inc b/config/squidGuard/squidguard_configurator.inc index 006cf083..f065e4cb 100644 --- a/config/squidGuard/squidguard_configurator.inc +++ b/config/squidGuard/squidguard_configurator.inc @@ -2081,8 +2081,8 @@ function squidguard_blacklist_update_start($url_filename) function squidguard_blacklist_update_cancel() { # kill script and SG update process - mwexec("kill `ps auxwwww | grep '" . SCR_NAME_BLKUPDATE . "' | grep -v 'grep' | awk '{print $2}'`"); - mwexec("kill `ps auxwwww | grep 'squidGuard -c .* -C all' | grep -v 'grep' | awk '{print $2}'`"); + mwexec("/bin/kill `ps auxwwww | /usr/bin/grep '" . SCR_NAME_BLKUPDATE . "' | /usr/bin/grep -v 'grep' | /usr/bin/awk '{print $2}'`"); + mwexec("/bin/kill `ps auxwwww | /usr/bin/grep 'squidGuard -c .* -C all' | /usr/bin/grep -v 'grep' | /usr/bin/awk '{print $2}'`"); squidguard_ramdisk(false); squidguard_update_log("Blacklist update terminated by user.", ""); @@ -2102,7 +2102,7 @@ function squidguard_blacklist_update_clearlog() # ----------------------------------------------------------------------------- function squidguard_blacklist_update_IsStarted() { - return exec("ps auxwwww | grep '" . SCR_NAME_BLKUPDATE . "' | grep -v 'grep' | awk '{print $2}' | wc -l | awk '{ print $1 }'"); + return exec("/bin/ps auxwwww | /usr/bin/grep '" . SCR_NAME_BLKUPDATE . "' | /usr/bin/grep -v 'grep' | /usr/bin/awk '{print $2}' | /usr/bin/wc -l | /usr/bin/awk '{ print $1 }'"); } # ----------------------------------------------------------------------------- @@ -2126,27 +2126,27 @@ function sg_reconfigure_blacklist($source_filename, $opt = '') # 2. download if ($sf[0] === "/") { # local file - example '/tmp/blacklists.tar' - sg_addlog("sg_reconfigure_blacklist", "Update from file '$sf'.", SQUIDGUARD_INFO); - squidguard_update_log("Copy archive from file '$sf'"); + sg_addlog("sg_reconfigure_blacklist", "Update from file '{$sf}'.", SQUIDGUARD_INFO); + squidguard_update_log("Copy archive from file '{$sf}'"); if (file_exists($sf)) { $sf_contents = file_get_contents($sf); } else { - sg_addlog("sg_reconfigure_blacklist", "File '$sf' not found.", SQUIDGUARD_ERROR); - squidguard_update_log("File '$sf' not found."); + sg_addlog("sg_reconfigure_blacklist", "File '{$sf}' not found.", SQUIDGUARD_ERROR); + squidguard_update_log("File '{$sf}' not found."); return; } } # from url else { - sg_addlog("sg_reconfigure_blacklist", "Download from url '$sf'.", SQUIDGUARD_INFO); + sg_addlog("sg_reconfigure_blacklist", "Download from url '{$sf}'.", SQUIDGUARD_INFO); squidguard_update_log("Start download."); $sf_contents = sg_uploadfile_from_url($sf, $opt); } # 3. update if (empty($sf_contents)) { - sg_addlog("sg_reconfigure_blacklist", "Bad content from '$sf'. Terminate.", SQUIDGUARD_ERROR); - squidguard_update_log("Bad content from '$sf'. Terminate."); + sg_addlog("sg_reconfigure_blacklist", "Bad content from '{$sf}'. Terminate.", SQUIDGUARD_ERROR); + squidguard_update_log("Bad content from '{$sf}'. Terminate."); return; } @@ -2177,7 +2177,7 @@ function sg_update_blacklist($from_file) $conf_path = SQUIDGUARD_VAR . DB_REBUILD_BLK_CONF; $blklist_file = SQUIDGUARD_BLK_FILELISTPATH; - sg_addlog("sg_update_blacklist", "Begin with '$from_file'.", SQUIDGUARD_INFO); + sg_addlog("sg_update_blacklist", "Begin with '{$from_file}'.", SQUIDGUARD_INFO); if (file_exists($from_file)) { # check work and DB dir's @@ -2185,20 +2185,20 @@ function sg_update_blacklist($from_file) if (file_exists($squidguard_config[F_WORKDIR])) $workdir = $squidguard_config[F_WORKDIR]; # delete old tmp dir's - if (file_exists($tmp_unpack_dir)) mwexec("rm -R $tmp_unpack_dir"); - if (file_exists($arc_db_dir)) mwexec("rm -R $arc_db_dir"); + if (file_exists($tmp_unpack_dir)) mwexec("/bin/rm -R {$tmp_unpack_dir}"); + if (file_exists($arc_db_dir)) mwexec("/bin/rm -R {$arc_db_dir}"); squidguard_ramdisk(false); # create new tmp/arc dir's, use ramdisk for quick operations squidguard_ramdisk(true); - mwexec("mkdir -p -m 0755 $tmp_unpack_dir"); - mwexec("mkdir -p -m 0755 $arc_db_dir"); + mwexec("/bin/mkdir -p -m 0755 {$tmp_unpack_dir}"); + mwexec("/bin/mkdir -p -m 0755 {$arc_db_dir}"); # 1. unpack archive squidguard_update_log("Unpack archive"); - mwexec("tar zxvf $from_file -C $tmp_unpack_dir"); + mwexec("/usr/bin/tar zxvf $from_file -C {$tmp_unpack_dir}"); set_file_access($tmp_unpack_dir, OWNER_NAME, 0755); - sg_addlog("sg_update_blacklist", "Unpack uploaded file '$from_file' -> '$tmp_unpack_dir'.", SQUIDGUARD_INFO); + sg_addlog("sg_update_blacklist", "Unpack uploaded file '{$from_file}' -> '{$tmp_unpack_dir}'.", SQUIDGUARD_INFO); # 2. copy blacklist to TempDB base & create entries list squidguard_update_log("Scan blacklist categories."); @@ -2211,7 +2211,7 @@ function sg_update_blacklist($from_file) # move blacklist catalog structure to 'one level' (from tmp_DB to arch_DB) foreach ($blk_items as $key => $val) { - $current_dbpath = "$arc_db_dir/$key"; + $current_dbpath = "{$arc_db_dir}/{$key}"; if (count($val)) { # make blk_list for config file $blk_list[$key] = $key; @@ -2220,9 +2220,9 @@ function sg_update_blacklist($from_file) # need moving $val['path'] to $current_dbpath # if $current_dbpath exists, then $val['path'] will created as subdir - !it's worng! if (file_exists($current_dbpath)) - mwexec("rm -R $current_dbpath"); - mwexec("mv -f {$val['path']}/ $current_dbpath"); - sg_addlog("sg_update_blacklist", "Move {$val['path']}/ -> $current_dbpath.", SQUIDGUARD_INFO); + mwexec("/bin/rm -R {$current_dbpath}"); + mwexec("/usr/bin/tar -f {$val['path']}/ {$current_dbpath}"); + sg_addlog("sg_update_blacklist", "Move {$val['path']}/ -> {$current_dbpath}.", SQUIDGUARD_INFO); } } set_file_access($arc_db_dir, OWNER_NAME, 0755); @@ -2242,7 +2242,7 @@ function sg_update_blacklist($from_file) file_put_contents($blklist_file, $cont); set_file_access ($blklist_file, OWNER_NAME, 0755); - sg_addlog("sg_update_blacklist", "Create DB entries list '$blklist_file'.", SQUIDGUARD_INFO); + sg_addlog("sg_update_blacklist", "Create DB entries list '{$blklist_file}'.", SQUIDGUARD_INFO); squidguard_update_log("Found " . count($blk_items) . " items."); } @@ -2252,8 +2252,8 @@ function sg_update_blacklist($from_file) squidguard_update_log("Copy DB to workdir."); $blklist_file = $arc_db_dir . SQUIDGUARD_BLK_FILELIST; - mwexec("cp -R -p $arc_db_dir/ $dbhome"); - mwexec("cp -f -p $blklist_file " . SQUIDGUARD_WORKDIR); + mwexec("/bin/cp -R -p {$arc_db_dir}/ {$dbhome}"); + mwexec("/bin/cp -f -p {$blklist_file} " . SQUIDGUARD_WORKDIR); set_file_access($dbhome, OWNER_NAME, 0755); squidguard_update_log("Reconfigure Squid proxy."); @@ -2266,7 +2266,7 @@ function sg_update_blacklist($from_file) # free ramdisk squidguard_ramdisk(false); } - else sg_addlog("sg_update_blacklist", "File $from_file not found.", SQUIDGUARD_ERROR); + else sg_addlog("sg_update_blacklist", "File {$from_file} not found.", SQUIDGUARD_ERROR); } # ----------------------------------------------------------------------------- @@ -2382,13 +2382,13 @@ function squidguard_blacklist_restore_arcdb() if (file_exists($arc_db_dir)) { conf_mount_rw(); # copy arc blacklist to work DB with permissions - mwexec("cp -R -p $arc_db_dir/ $dbhome"); + mwexec("/bin/cp -R -p {$arc_db_dir}/ {$dbhome}"); set_file_access($dbhome, OWNER_NAME, 0755); - sg_addlog("squidguard_blacklist_restore_arcdb", "Restore blacklist archive from '$arc_db_dir'.", SQUIDGUARD_INFO); + sg_addlog("squidguard_blacklist_restore_arcdb", "Restore blacklist archive from '{$arc_db_dir}'.", SQUIDGUARD_INFO); # generate blacklist files list $blklist = ""; - $files = scan_dir("$arc_db_dir/"); + $files = scan_dir("{$arc_db_dir}/"); if ($files) $blklist = implode("\n", $files); file_put_contents($blklist_file, $blklist); set_file_access($blklist_file, OWNER_NAME, 0755); @@ -2401,8 +2401,8 @@ function squidguard_blacklist_restore_arcdb() conf_mount_ro(); squidguard_update_log("Restore success."); } else { - sg_addlog("squidguard_blacklist_restore_arcdb", "File '$arc_db_dir' or '$blklist_file' not found.", SQUIDGUARD_ERROR); - squidguard_update_log("Restore error: File '$arc_db_dir' or '$blklist_file' not found."); + sg_addlog("squidguard_blacklist_restore_arcdb", "File '{$arc_db_dir}' or '{$blklist_file}' not found.", SQUIDGUARD_ERROR); + squidguard_update_log("Restore error: File '{$arc_db_dir}' or '{$blklist_file}' not found."); } } diff --git a/pkg_config.10.xml b/pkg_config.10.xml index d06dc9a2..eaf75dc5 100644 --- a/pkg_config.10.xml +++ b/pkg_config.10.xml @@ -985,7 +985,7 @@ http://www.squidGuard.org/ dv_serg@mail.ru Network Management - 1.4_4 pkg v.1.9.6 + 1.4_4 pkg v.1.9.7 Beta 2.2 squidguard-1.4_7-##ARCH##.pbi diff --git a/pkg_config.8.xml b/pkg_config.8.xml index ea9340dc..7c291e75 100644 --- a/pkg_config.8.xml +++ b/pkg_config.8.xml @@ -1268,7 +1268,7 @@ http://www.squidGuard.org/ dv_serg@mail.ru Network Management - 1.4_4 pkg v.1.9.6 + 1.4_4 pkg v.1.9.7 Beta 1.1 https://files.pfsense.org/packages/8/All/ diff --git a/pkg_config.8.xml.amd64 b/pkg_config.8.xml.amd64 index 92d92277..6996c3ab 100644 --- a/pkg_config.8.xml.amd64 +++ b/pkg_config.8.xml.amd64 @@ -1255,7 +1255,7 @@ http://www.squidGuard.org/ dv_serg@mail.ru Network Management - 1.4_4 pkg v.1.9.6 + 1.4_4 pkg v.1.9.7 Beta 1.1 https://files.pfsense.org/packages/amd64/8/All/ -- cgit v1.2.3 From d4296dbbf3bcebb60096f47e902831cb4ec17dfe Mon Sep 17 00:00:00 2001 From: Marcello Coutinho Date: Fri, 9 Jan 2015 17:34:24 -0200 Subject: squid3 - leave only pf transparent proxy compile arg --- pkg_config.10.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg_config.10.xml b/pkg_config.10.xml index eaf75dc5..e5c0dcbc 100644 --- a/pkg_config.10.xml +++ b/pkg_config.10.xml @@ -918,7 +918,7 @@ www/squid www/squid_radius_auth security/clamav www/squidclamav security/ca_root_nss www/c-icap-modules - squid_UNSET_FORCE=AUTH_SASL AUTH_SMB AUTH_SQL DEBUG DNS_HELPER ESI FS_ROCK TP_IPF NETTLE STACKTRACES VIA_DB DOCS EXAMPLES;squid_SET_FORCE=ARP_ACL AUTH_KERB AUTH_LDAP AUTH_NIS DELAY_POOLS ECAP FOLLOW_XFF FS_AUFS FS_DISKD HTCP ICAP ICMP IDENT IPV6 KQUEUE LARGEFILE SNMP SSL SSL_CRTD LAX_HTTP TP_IPFW TP_PF WCCP WCCPV2 CACHE_DIGESTS + squid_UNSET_FORCE=AUTH_SASL AUTH_SMB AUTH_SQL DEBUG TP_IPFW DNS_HELPER ESI FS_ROCK TP_IPF NETTLE STACKTRACES VIA_DB DOCS EXAMPLES;squid_SET_FORCE=ARP_ACL AUTH_KERB AUTH_LDAP AUTH_NIS DELAY_POOLS ECAP FOLLOW_XFF FS_AUFS FS_DISKD HTCP ICAP ICMP IDENT IPV6 KQUEUE LARGEFILE SNMP SSL SSL_CRTD LAX_HTTP TP_PF WCCP WCCPV2 CACHE_DIGESTS https://packages.pfsense.org/packages/config/squid3/34/squid.xml squid.xml squid-3.4.10_2-##ARCH##.pbi -- cgit v1.2.3