diff options
author | Guido Falsi <madpilot@FreeBSD.org> | 2019-01-15 18:16:34 +0000 |
---|---|---|
committer | Guido Falsi <madpilot@FreeBSD.org> | 2019-01-15 18:16:34 +0000 |
commit | 9d7e78cad27e53135554fd93bbfd4d08698f3165 (patch) | |
tree | 147f9480c5cfc643397deb2d4df310c368392c5f /net/ntopng | |
parent | x11-wm/sway: explain why SUID is enabled (diff) |
- Update ntopng to latest upstream snapshot
- Enable again IP geolocation by using the maxminddb. Rename script
which downloads the data to reflect the change
Notes
Notes:
svn path=/head/; revision=490396
Diffstat (limited to 'net/ntopng')
-rw-r--r-- | net/ntopng/Makefile | 10 | ||||
-rw-r--r-- | net/ntopng/distinfo | 6 | ||||
-rw-r--r-- | net/ntopng/files/ntopng-geoip2update.sh.in | 44 | ||||
-rw-r--r-- | net/ntopng/files/ntopng-geoipupdate.sh.in | 39 | ||||
-rw-r--r-- | net/ntopng/files/pkg-deinstall.in | 6 | ||||
-rw-r--r-- | net/ntopng/pkg-message | 5 | ||||
-rw-r--r-- | net/ntopng/pkg-plist | 1 |
7 files changed, 58 insertions, 53 deletions
diff --git a/net/ntopng/Makefile b/net/ntopng/Makefile index e13a48ec8a1a..848817360380 100644 --- a/net/ntopng/Makefile +++ b/net/ntopng/Makefile @@ -2,8 +2,7 @@ # $FreeBSD$ PORTNAME= ntopng -PORTVERSION= 3.8.d20181221 -PORTREVISION= 2 +PORTVERSION= 3.8.d20190111 PORTEPOCH= 1 CATEGORIES= net @@ -25,7 +24,7 @@ BUILD_DEPENDS= bash:shells/bash USES= autoreconf compiler:c++11-lang cpe gmake libtool localbase \ mysql pathfix pkgconfig shebangfix sqlite ssl -SUB_FILES= pkg-deinstall +SUB_FILES= ntopng-geoip2update.sh pkg-deinstall SHEBANG_FILES= httpdocs/misc/ntopng-add-user.sh \ httpdocs/misc/ntopng-utils-manage-config.in GNU_CONFIGURE= yes @@ -37,11 +36,11 @@ PLIST_SUB= NTOPNGUSER="${USERS}" NTOPNGROUP="${GROUPS}" USE_GITHUB= yes GH_ACCOUNT= ntop -GH_TAGNAME= e7503c7 +GH_TAGNAME= 3c2d3bf CPE_VENDOR= ntop -OPTIONS_DEFINE= NLS +OPTIONS_DEFINE= NLS OPTIONS_SUB= yes @@ -57,5 +56,6 @@ post-patch: post-install: ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/ntopng ${MKDIR} ${STAGEDIR}/var/db/ntopng + ${INSTALL_SCRIPT} ${WRKDIR}/ntopng-geoip2update.sh ${STAGEDIR}${PREFIX}/bin .include <bsd.port.mk> diff --git a/net/ntopng/distinfo b/net/ntopng/distinfo index e87320b1ee1e..0ba21cc7cf57 100644 --- a/net/ntopng/distinfo +++ b/net/ntopng/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1545486562 -SHA256 (ntop-ntopng-3.8.d20181221-e7503c7_GH0.tar.gz) = 24513419f03079f6e1dbe2f8971094f8686443e73a0ae752c88fdbac41673c5d -SIZE (ntop-ntopng-3.8.d20181221-e7503c7_GH0.tar.gz) = 33912235 +TIMESTAMP = 1547564923 +SHA256 (ntop-ntopng-3.8.d20190111-3c2d3bf_GH0.tar.gz) = 1da7581a66fdd405574d0f914ed319c90d15c6e7886e14973c32ebc6ba0b35d1 +SIZE (ntop-ntopng-3.8.d20190111-3c2d3bf_GH0.tar.gz) = 33912860 diff --git a/net/ntopng/files/ntopng-geoip2update.sh.in b/net/ntopng/files/ntopng-geoip2update.sh.in new file mode 100644 index 000000000000..1b0302d67856 --- /dev/null +++ b/net/ntopng/files/ntopng-geoip2update.sh.in @@ -0,0 +1,44 @@ +#!/bin/sh + +set -eu +mkdir -p "%%DATADIR%%/httpdocs/geoip" + +TEMPDIR="$(mktemp -d "%%DATADIR%%/httpdocs/geoip/MMDB-XXXXXX")" +trap 'rc=$? ; set +e ; rm -rf "'"$TEMPDIR"'" ; exit $rc' 0 + +cd "${TEMPDIR}" + +# arguments: +# $1 URL +# $2 filename +_fetchextract() { + url="$1" + file="$(basename "${url}")" + + if fetch "${url}"; then + tar xzf "${file}" + else + echo "${file} download failed" + return 1 + fi + + return 0 +} + +echo Fetching GeoLite2-City +_fetchextract 'https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz' + +echo Fetching GeoLite2-ASN +_fetchextract 'https://geolite.maxmind.com/download/geoip/database/GeoLite2-ASN.tar.gz' + +mv GeoLite2-*/*.mmdb %%DATADIR%%/httpdocs/geoip + +cd %%DATADIR%%/httpdocs/geoip +rm -rf "${TEMPDIR}" + +chown root:wheel *.mmdb +chmod 444 *.mmdb + +trap - 0 + +return 0 diff --git a/net/ntopng/files/ntopng-geoipupdate.sh.in b/net/ntopng/files/ntopng-geoipupdate.sh.in deleted file mode 100644 index 783bd81c68bc..000000000000 --- a/net/ntopng/files/ntopng-geoipupdate.sh.in +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh - -set -eu -mkdir -p "%%DATADIR%%/httpdocs/geoip" - -# arguments: -# $1 URL -# $2 output file name -_fetch() { - url="$1" - out="$2" - TEMPFILE="$(mktemp "%%DATADIR%%/httpdocs/geoip/GeoIP.dat-XXXXXX")" - trap 'rc=$? ; set +e ; rm -f "'"$TEMPFILE"'" ; exit $rc' 0 - if fetch -o - "$url" | gunzip >> "$TEMPFILE" ; then - chmod 444 "$TEMPFILE" - if ! mv -f "$TEMPFILE" "%%DATADIR%%/httpdocs/geoip/$2" ; then - echo "Unable to replace %%DATADIR%%/httpdocs/geoip/$2" - return 2 - fi - else - echo "$2 download failed" - return 1 - fi - rm -f "$TEMPFILE" - trap - 0 - return 0 -} - -echo Fetching GeoLiteCity.dat... -_fetch "http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz" GeoLiteCity.dat - -echo Fetching GeoLiteCityv6.dat... -_fetch "http://geolite.maxmind.com/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz" GeoLiteCityv6.dat - -echo Fetching GeoIPASNum.dat... -_fetch "http://download.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz" GeoIPASNum.dat.gz - -echo Fetching GeoIPASNumv6.dat... -_fetch "http://download.maxmind.com/download/geoip/database/asnum/GeoIPASNumv6.dat.gz" GeoIPASNumv6.dat.gz diff --git a/net/ntopng/files/pkg-deinstall.in b/net/ntopng/files/pkg-deinstall.in index 2999b3847595..494746852778 100644 --- a/net/ntopng/files/pkg-deinstall.in +++ b/net/ntopng/files/pkg-deinstall.in @@ -4,8 +4,6 @@ [ "$2" != "DEINSTALL" ] && exit 0 -[ -f "%%DATADIR%%/httpdocs/geoip/GeoLiteCity.dat" ] && /bin/rm "%%DATADIR%%/httpdocs/geoip/GeoLiteCity.dat" -[ -f "%%DATADIR%%/httpdocs/geoip/GeoLiteCityv6.dat" ] && /bin/rm "%%DATADIR%%/httpdocs/geoip/GeoLiteCityv6.dat" -[ -f "%%DATADIR%%/httpdocs/geoip/GeoIPASNum.dat.gz" ] && /bin/rm "%%DATADIR%%/httpdocs/geoip/GeoIPASNum.dat.gz" -[ -f "%%DATADIR%%/httpdocs/geoip/GeoIPASNumv6.dat.gz" ] && /bin/rm "%%DATADIR%%/httpdocs/geoip/GeoIPASNumv6.dat.gz" +[ -f "%%DATADIR%%/httpdocs/geoip/GeoLite2-City.mmdb" ] && /bin/rm "%%DATADIR%%/httpdocs/geoip/GeoLite2-City.mmdb" +[ -f "%%DATADIR%%/httpdocs/geoip/GeoLite2-ASN.mmdb" ] && /bin/rm "%%DATADIR%%/httpdocs/geoip/GeoLite2-ASN.mmdb" [ -d "%%DATADIR%%/httpdocs/geoip" ] && /usr/bin/find "%%DATADIR%%/httpdocs/geoip" -type d -empty -delete diff --git a/net/ntopng/pkg-message b/net/ntopng/pkg-message index 2b6efffb1c6a..7dcb0557a448 100644 --- a/net/ntopng/pkg-message +++ b/net/ntopng/pkg-message @@ -8,8 +8,9 @@ ntopng requires to connect to a redis server to work. Please install redis server from databases/redis or use -r option via ntopng_flags to specify a remote one. -If you enabled GeoIP support(the default), please use ntopng-geoipupdate.sh -to update GeoIP database to the latest available data. +ntopng supports IP geolocation, to enable this you should use the +ntopng-geoip2update.sh script to update the maxminddb geolocation +data to the latest version. To pass a configuration file to ntopng, which overrides any command line arguments, add something like the following to rc.conf: diff --git a/net/ntopng/pkg-plist b/net/ntopng/pkg-plist index d82a1937d952..65a4913dbe4d 100644 --- a/net/ntopng/pkg-plist +++ b/net/ntopng/pkg-plist @@ -1,4 +1,5 @@ bin/ntopng +bin/ntopng-geoip2update.sh man/man8/ntopng.8.gz %%DATADIR%%/httpdocs/bootstrap/css/bootstrap-theme.css %%DATADIR%%/httpdocs/bootstrap/css/bootstrap-theme.css.map |