aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/havp/havp.inc18
-rw-r--r--config/ntopng/ntopng.xml28
-rw-r--r--config/systempatches/system_patches.php51
-rw-r--r--pkg_config.10.xml2
4 files changed, 68 insertions, 31 deletions
diff --git a/config/havp/havp.inc b/config/havp/havp.inc
index 1648bcb0..e7966a38 100644
--- a/config/havp/havp.inc
+++ b/config/havp/havp.inc
@@ -76,7 +76,13 @@ define('HVDEF_PROXYPORT', '8080');
define('HVDEF_MAXSCANSIZE', '5000000'); # [bytes] ! do not enter 0 or big size !
define('HVDEF_MAXARCSCANSIZE', '5000000'); # [bytes] ! do not enter 0 or big size !
define('HVDEF_PID_FILE', '/var/run/havp.pid');
-define('HVDEF_WORK_DIR', '/usr/local/etc/havp');
+
+$pf_version=substr(trim(file_get_contents("/etc/version")),0,3);
+if ($pf_version == "2.1" || $pf_version == "2.2")
+ define("HVDEF_WORK_DIR", "/usr/pbi/havp-" . php_uname("m") . "/local/etc");
+ else
+ define("HVDEF_WORK_DIR", "/usr/local/etc/havp");
+
$pfSversion = str_replace("\s", "", file_get_contents("/etc/version"));
if(preg_match("/^2./",$pfSversion))
@@ -101,8 +107,8 @@ define('HVDEF_HAVP_MINSRV', '3');
define('HVDEF_HAVP_MAXSRV', '100');
# Clam
-#define('HVDEF_CLAM_RUNDIR', '/var/run/clamav');
-define('HVDEF_CLAM_RUNDIR', '/var/run');
+define('HVDEF_CLAM_RUNDIR', '/var/run/clamav');
+#define('HVDEF_CLAM_RUNDIR', '/var/run');
define('HVDEF_CLAM_DBDIR', '/var/db/clamav');
if(preg_match("/^2./",$pfSversion))
define('HVDEF_AVLOG_DIR', '/var/log/clamav');
@@ -446,9 +452,9 @@ function havp_check_system()
# =-= ClamAV =-=
# catalog for Pid and Socket files
-# if (!file_exists(HVDEF_CLAM_RUNDIR))
-# mwexec("mkdir -p " . HVDEF_CLAM_RUNDIR);
-# havp_set_file_access(HVDEF_CLAM_RUNDIR, HVDEF_USER, '0774');
+ if (!file_exists(HVDEF_CLAM_RUNDIR))
+ mwexec("mkdir -p " . HVDEF_CLAM_RUNDIR);
+ havp_set_file_access(HVDEF_CLAM_RUNDIR, HVDEF_USER, '0774');
# AV update script
file_put_contents(HVDEF_AVUPD_SCRIPT, havp_AVupdate_script());
diff --git a/config/ntopng/ntopng.xml b/config/ntopng/ntopng.xml
index 778881e8..055f54c0 100644
--- a/config/ntopng/ntopng.xml
+++ b/config/ntopng/ntopng.xml
@@ -156,7 +156,15 @@
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");
- system("/bin/cp -Rp /usr/local/lib/X11/fonts/webfonts/ /usr/local/lib/X11/fonts/TTF/");
+ $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";
+ } else if ($pf_version == "2.1") {
+ $fonts_path = "/usr/pbi/ntopng-" . php_uname("m") . "/lib/X11/fonts";
+ } else {
+ $fonts_path = "/usr/local/lib/X11/fonts";
+ }
+ 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);
@@ -246,12 +254,23 @@
config_unlock();
}
function ntopng_update_geoip() {
+ $fetchcmd = "/usr/bin/fetch";
+ $geolite_city = "https://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz";
+ $geolite_city_v6 = "https://geolite.maxmind.com/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz";
+ $geoip_asnum = "https://download.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz";
+ $geoip_asnum_v6 = "https://download.maxmind.com/download/geoip/database/asnum/GeoIPASNumv6.dat.gz";
$pf_version=substr(trim(file_get_contents("/etc/version")),0,3);
if ($pf_version == "2.1" || $pf_version == "2.2") {
- mwexec("/usr/pbi/ntopng-" . php_uname("m") . "/bin/ntopng-geoipupdate.sh");
+ $output_dir = "/usr/pbi/ntopng-" . php_uname("m") . "/share/ntopng";
} else {
- mwexec("/usr/local/bin/ntopng-geoipupdate.sh");
+ $output_dir = "/usr/local/share/ntopng";
}
+
+ mwexec("{$fetchcmd} -o {$output_dir} -T 5 {$geolite_city}");
+ mwexec("{$fetchcmd} -o {$output_dir} -T 5 {$geolite_city_v6}");
+ mwexec("{$fetchcmd} -o {$output_dir} -T 5 {$geoip_asnum}");
+ mwexec("{$fetchcmd} -o {$output_dir} -T 5 {$geoip_asnum_v6}");
+
ntopng_fixup_geoip();
restart_service("ntopng");
}
@@ -268,7 +287,8 @@
foreach(glob("{$source_dir}/Geo*.dat*") as $geofile) {
/* Decompress if needed. */
if (substr($geofile, -3, 3) == ".gz") {
- mwexec("/usr/bin/gzip -d " . escapeshellarg($geofile));
+ // keep -f here, otherwise the files will not get updated
+ mwexec("/usr/bin/gzip -d -f " . escapeshellarg($geofile));
}
}
diff --git a/config/systempatches/system_patches.php b/config/systempatches/system_patches.php
index 43c8c22b..97e00b32 100644
--- a/config/systempatches/system_patches.php
+++ b/config/systempatches/system_patches.php
@@ -180,11 +180,11 @@ include("head.inc");
<td width="5%" class="list">&nbsp;</td>
<td width="5%" class="listhdrr"><?=gettext("Description");?></td>
<td width="60%" class="listhdrr"><?=gettext("URL/ID");?></td>
+<td width="5%" class="listhdrr"><?=gettext("Status");?></td>
<td width="5%" class="listhdrr"><?=gettext("Fetch");?></td>
-<td width="5%" class="listhdrr"><?=gettext("Test");?></td>
-<td width="5%" class="listhdrr"><?=gettext("Apply");?></td>
-<td width="5%" class="listhdr"><?=gettext("Revert");?></td>
+<td width="5%" class="listhdrr"><?=gettext("Apply");?>/<br /><?=gettext("Revert");?></td>
<td width="5%" class="listhdr"><?=gettext("Auto Apply");?></td>
+<td width="5%" class="listhdrr"><?=gettext("Test");?></td>
<td width="5%" class="list">
<table border="0" cellspacing="0" cellpadding="1" summary="buttons">
<tr><td width="17">
@@ -213,39 +213,50 @@ foreach ($a_patches as $thispatch):
<?=$thispatch['descr'];?>
</td>
<td class="listr" onclick="fr_toggle(<?=$npatches;?>)" id="frd<?=$npatches;?>" ondblclick="document.location='system_patches_edit.php?id=<?=$npatches;?>';">
-
<?php
- if (!empty($thispatch['location']))
- echo $thispatch['location'];
- elseif (!empty($thispatch['patch']))
- echo gettext("Saved Patch");
+ if (!empty($thispatch['location']))
+ echo $thispatch['location'];
+ elseif (!empty($thispatch['patch'])) {
+ // saved patch with no location => manually entered/user defined
+ echo gettext("User-defined");
+ }
?>
</td>
- <td class="listr" onclick="fr_toggle(<?=$npatches;?>)" id="frd<?=$npatches;?>" ondblclick="document.location='system_patches_edit.php?id=<?=$npatches;?>';">
- <?php if (empty($thispatch['patch'])): ?>
- <a href="system_patches.php?id=<?=$i;?>&amp;act=fetch"><?php echo gettext("Fetch"); ?></a>
- <?php elseif (!empty($thispatch['location'])): ?>
- <a href="system_patches.php?id=<?=$i;?>&amp;act=fetch"><?php echo gettext("Re-Fetch"); ?></a>
- <?php endif; ?>
+
+ <td class="listr" onclick="fr_toggle(<?=$npatches;?>)" id="frd<?=$npatches;?>" ondblclick="document.location='system_patches_edit.php?id=<?=$npatches;?>';" nowrap>
+ <?php
+ if ($can_apply) {
+ echo gettext("Valid, not applied");
+ } elseif ($can_revert) {
+ echo gettext("Valid, applied");
+ } elseif (empty($thispatch['patch'])) {
+ echo gettext("Unknown, no code stored");
+ } else {
+ echo gettext("Not valid, does not match");
+ }
+ ?>
</td>
+
<td class="listr" onclick="fr_toggle(<?=$npatches;?>)" id="frd<?=$npatches;?>" ondblclick="document.location='system_patches_edit.php?id=<?=$npatches;?>';">
- <?php if (!empty($thispatch['patch'])): ?>
- <a href="system_patches.php?id=<?=$i;?>&amp;act=test"><?php echo gettext("Test"); ?></a>
+ <?php if (!empty($thispatch['location'])): ?>
+ <a href="system_patches.php?id=<?=$i;?>&amp;act=fetch"><?php echo gettext(empty($thispatch['patch']) ? "Fetch" : "Re-Fetch"); ?></a>
<?php endif; ?>
</td>
<td class="listr" onclick="fr_toggle(<?=$npatches;?>)" id="frd<?=$npatches;?>" ondblclick="document.location='system_patches_edit.php?id=<?=$npatches;?>';">
<?php if ($can_apply): ?>
<a href="system_patches.php?id=<?=$i;?>&amp;act=apply"><?php echo gettext("Apply"); ?></a>
- <?php endif; ?>
- </td>
- <td class="listr" onclick="fr_toggle(<?=$npatches;?>)" id="frd<?=$npatches;?>" ondblclick="document.location='system_patches_edit.php?id=<?=$npatches;?>';">
- <?php if ($can_revert): ?>
+ <?php elseif ($can_revert): ?>
<a href="system_patches.php?id=<?=$i;?>&amp;act=revert"><?php echo gettext("Revert"); ?></a>
<?php endif; ?>
</td>
<td class="listr" onclick="fr_toggle(<?=$npatches;?>)" id="frd<?=$npatches;?>" ondblclick="document.location='system_patches_edit.php?id=<?=$npatches;?>';">
<?= isset($thispatch['autoapply']) ? "Yes" : "No" ?>
</td>
+ <td class="listr" onclick="fr_toggle(<?=$npatches;?>)" id="frd<?=$npatches;?>" ondblclick="document.location='system_patches_edit.php?id=<?=$npatches;?>';">
+ <?php if (!empty($thispatch['patch'])): ?>
+ <a href="system_patches.php?id=<?=$i;?>&amp;act=test"><?php echo gettext("Test"); ?></a>
+ <?php endif; ?>
+ </td>
<td valign="middle" class="list" nowrap>
<table border="0" cellspacing="0" cellpadding="1" summary="edit">
<tr>
diff --git a/pkg_config.10.xml b/pkg_config.10.xml
index 86e39ae5..f0822968 100644
--- a/pkg_config.10.xml
+++ b/pkg_config.10.xml
@@ -300,7 +300,7 @@
<ports_before>databases/redis databases/gdbm net/GeoIP x11-fonts/font-util x11-fonts/webfonts graphics/graphviz</ports_before>
<port>net/ntopng</port>
</build_pbi>
- <version>0.6</version>
+ <version>0.7</version>
<status>ALPHA</status>
<required_version>2.2</required_version>
<config_file>https://packages.pfsense.org/packages/config/ntopng/ntopng.xml</config_file>