aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Falsi <madpilot@FreeBSD.org>2018-12-22 21:05:01 +0000
committerGuido Falsi <madpilot@FreeBSD.org>2018-12-22 21:05:01 +0000
commit234b8801f91e26919e98aa0f6bf30ac6ce0885e7 (patch)
tree76e43d982a66b489a26c72afaa8866bceb386862
parent5767dad407eb74d8edbfef5337e11c0b2a7eabf2 (diff)
downloadports-234b8801f91e26919e98aa0f6bf30ac6ce0885e7.tar.gz
ports-234b8801f91e26919e98aa0f6bf30ac6ce0885e7.zip
Modify ntopng to use /var/db/ntopng as a data directory by default,
instead of /var/lib/ntopng. Updated UPDATING entry text accordingly. Reported by: pi
Notes
Notes: svn path=/head/; revision=488131
-rw-r--r--UPDATING6
-rw-r--r--net/ntopng/Makefile3
-rw-r--r--net/ntopng/files/patch-httpdocs_misc_ntopng-utils-manage-config.in11
-rw-r--r--net/ntopng/files/patch-include_ntop__defines.h11
-rw-r--r--net/ntopng/files/patch-ntopng.811
-rw-r--r--net/ntopng/files/patch-scripts_lua_examples_sqlite.lua11
-rw-r--r--net/ntopng/pkg-plist3
7 files changed, 50 insertions, 6 deletions
diff --git a/UPDATING b/UPDATING
index ddd0081ed208..3338edfb4794 100644
--- a/UPDATING
+++ b/UPDATING
@@ -10,7 +10,7 @@ you update your ports collection, before attempting any port upgrades.
AUTHOR: madpilot@FreeBSD.org
Since ntopng 3.7, for security reasons, the default setting for
- the data directory has been changed to "/var/lib/ntopng", and the
+ the data directory has been changed to "/var/db/ntopng", and the
default user has been changed to "ntopng". This new directory is
created automatically by the port/package with correct permissions.
@@ -21,8 +21,8 @@ you update your ports collection, before attempting any port upgrades.
the new settings, unless you are already using a custom directory:
# service ntopng stop
- # mv /var/tmp/ntopng/* /var/lib/ntopng/
- # chown -R ntopng:ntopng /var/lib/ntopng
+ # mv /var/tmp/ntopng/* /var/db/ntopng/
+ # chown -R ntopng:ntopng /var/db/ntopng
# service ntopng start
Please check hte upstream FAQ for reference:
diff --git a/net/ntopng/Makefile b/net/ntopng/Makefile
index 2f65b0d5be4d..566af11cbf5f 100644
--- a/net/ntopng/Makefile
+++ b/net/ntopng/Makefile
@@ -3,6 +3,7 @@
PORTNAME= ntopng
PORTVERSION= 3.8.d20181221
+PORTREVISION= 1
PORTEPOCH= 1
CATEGORIES= net
@@ -58,7 +59,7 @@ post-patch:
post-install:
${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/ntopng
- ${MKDIR} ${STAGEDIR}/var/lib/ntopng
+ ${MKDIR} ${STAGEDIR}/var/db/ntopng
post-install-GEOIP-on:
${INSTALL_SCRIPT} ${WRKDIR}/ntopng-geoipupdate.sh ${STAGEDIR}${PREFIX}/bin
diff --git a/net/ntopng/files/patch-httpdocs_misc_ntopng-utils-manage-config.in b/net/ntopng/files/patch-httpdocs_misc_ntopng-utils-manage-config.in
new file mode 100644
index 000000000000..634c45414efd
--- /dev/null
+++ b/net/ntopng/files/patch-httpdocs_misc_ntopng-utils-manage-config.in
@@ -0,0 +1,11 @@
+--- httpdocs/misc/ntopng-utils-manage-config.in.orig 2018-12-21 18:58:17 UTC
++++ httpdocs/misc/ntopng-utils-manage-config.in
+@@ -2,7 +2,7 @@
+
+ DEFAULT_CONF_FILE="/etc/ntopng/ntopng.conf"
+
+-DEFAULT_DATADIR="/var/lib/ntopng"
++DEFAULT_DATADIR="/var/db/ntopng"
+ OLD_DEFAULT_DATADIR="/var/tmp/ntopng"
+ if [ -d "${OLD_DEFAULT_DATADIR}" ]; then
+ DEFAULT_DATADIR="${OLD_DEFAULT_DATADIR}"
diff --git a/net/ntopng/files/patch-include_ntop__defines.h b/net/ntopng/files/patch-include_ntop__defines.h
new file mode 100644
index 000000000000..e055b1f0c060
--- /dev/null
+++ b/net/ntopng/files/patch-include_ntop__defines.h
@@ -0,0 +1,11 @@
+--- include/ntop_defines.h.orig 2018-12-21 18:58:17 UTC
++++ include/ntop_defines.h
+@@ -416,7 +416,7 @@
+ #define NTOPNG_NDPI_OS_PROTO_ID (NDPI_LAST_IMPLEMENTED_PROTOCOL+NDPI_MAX_NUM_CUSTOM_PROTOCOLS-2)
+ #define CONST_DEFAULT_HOME_NET "192.168.1.0/24"
+ #define CONST_OLD_DEFAULT_DATA_DIR "/var/tmp/ntopng"
+-#define CONST_DEFAULT_DATA_DIR "/var/lib/ntopng"
++#define CONST_DEFAULT_DATA_DIR "/var/db/ntopng"
+ #define CONST_DEFAULT_MAX_UI_STRLEN 24
+ #define CONST_DEFAULT_IS_AUTOLOGOUT_ENABLED 1
+ #define CONST_DEFAULT_IS_IDLE_LOCAL_HOSTS_CACHE_ENABLED 1
diff --git a/net/ntopng/files/patch-ntopng.8 b/net/ntopng/files/patch-ntopng.8
new file mode 100644
index 000000000000..61538d62e7d8
--- /dev/null
+++ b/net/ntopng/files/patch-ntopng.8
@@ -0,0 +1,11 @@
+--- ntopng.8.orig 2018-12-21 18:58:17 UTC
++++ ntopng.8
+@@ -186,7 +186,7 @@ can be instructed to act as a publisher delivering flo
+ Finally using \-i dummy it is possible to create a dummy interface that generates a large number of flows/hosts in order to saturate ntopng resources. This way ntopng can be tested for performance issues as well proper handling of low-memory situations.
+
+ .It \-d|\-\-data\-dir\ <path>
+-Specifies the data directory (it must be writable). Default directory is /var/lib/ntopng
++Specifies the data directory (it must be writable). Default directory is /var/db/ntopng
+
+ .It \-t|\-\-install\-dir\ <path>
+ Specifies the installation directory. Default directory is retrieved from common install paths.
diff --git a/net/ntopng/files/patch-scripts_lua_examples_sqlite.lua b/net/ntopng/files/patch-scripts_lua_examples_sqlite.lua
new file mode 100644
index 000000000000..b64b41473edc
--- /dev/null
+++ b/net/ntopng/files/patch-scripts_lua_examples_sqlite.lua
@@ -0,0 +1,11 @@
+--- scripts/lua/examples/sqlite.lua.orig 2018-12-21 18:58:17 UTC
++++ scripts/lua/examples/sqlite.lua
+@@ -26,7 +26,7 @@ if (query == nil) then
+ <div class="alert alert-warning alert-dismissible" role="alert">
+ <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span>
+ <span class="sr-only">Close</span></button>
+- <strong>Query Empty!</strong> Example: localhost:3000/lua/examples/sqlite.lua?query=/var/lib/ntopng/0/flows/2014-15-15/07/08/01/45.sqlite
++ <strong>Query Empty!</strong> Example: localhost:3000/lua/examples/sqlite.lua?query=/var/db/ntopng/0/flows/2014-15-15/07/08/01/45.sqlite
+ </div>
+ ]]
+
diff --git a/net/ntopng/pkg-plist b/net/ntopng/pkg-plist
index 92c15a48e794..008082108f07 100644
--- a/net/ntopng/pkg-plist
+++ b/net/ntopng/pkg-plist
@@ -514,5 +514,4 @@ man/man8/ntopng.8.gz
%%DATADIR%%/scripts/lua/username_details.lua
%%DATADIR%%/scripts/lua/vlan_details.lua
%%DATADIR%%/scripts/lua/vlan_stats.lua
-@dir(%%NTOPNGUSER%%,%%NTOPNGGROUP%%,750) /var/lib/ntopng
-@dir /var/lib
+@dir(%%NTOPNGUSER%%,%%NTOPNGGROUP%%,750) /var/db/ntopng