From owner-svn-ports-all@freebsd.org Tue Jan 15 18:16:36 2019 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C2A21492007; Tue, 15 Jan 2019 18:16:36 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C73B76AD1F; Tue, 15 Jan 2019 18:16:35 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB1E01E885; Tue, 15 Jan 2019 18:16:35 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0FIGZrc019508; Tue, 15 Jan 2019 18:16:35 GMT (envelope-from madpilot@FreeBSD.org) Received: (from madpilot@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0FIGYdH019503; Tue, 15 Jan 2019 18:16:34 GMT (envelope-from madpilot@FreeBSD.org) Message-Id: <201901151816.x0FIGYdH019503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: madpilot set sender to madpilot@FreeBSD.org using -f From: Guido Falsi Date: Tue, 15 Jan 2019 18:16:34 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r490396 - in head/net/ntopng: . files X-SVN-Group: ports-head X-SVN-Commit-Author: madpilot X-SVN-Commit-Paths: in head/net/ntopng: . files X-SVN-Commit-Revision: 490396 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C73B76AD1F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jan 2019 18:16:36 -0000 Author: madpilot Date: Tue Jan 15 18:16:34 2019 New Revision: 490396 URL: https://svnweb.freebsd.org/changeset/ports/490396 Log: - Update ntopng to latest upstream snapshot - Enable again IP geolocation by using the maxminddb. Rename script which downloads the data to reflect the change Added: head/net/ntopng/files/ntopng-geoip2update.sh.in - copied, changed from r490395, head/net/ntopng/files/ntopng-geoipupdate.sh.in Deleted: head/net/ntopng/files/ntopng-geoipupdate.sh.in Modified: head/net/ntopng/Makefile head/net/ntopng/distinfo head/net/ntopng/files/pkg-deinstall.in head/net/ntopng/pkg-message head/net/ntopng/pkg-plist Modified: head/net/ntopng/Makefile ============================================================================== --- head/net/ntopng/Makefile Tue Jan 15 18:06:50 2019 (r490395) +++ head/net/ntopng/Makefile Tue Jan 15 18:16:34 2019 (r490396) @@ -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 Modified: head/net/ntopng/distinfo ============================================================================== --- head/net/ntopng/distinfo Tue Jan 15 18:06:50 2019 (r490395) +++ head/net/ntopng/distinfo Tue Jan 15 18:16:34 2019 (r490396) @@ -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 Copied and modified: head/net/ntopng/files/ntopng-geoip2update.sh.in (from r490395, head/net/ntopng/files/ntopng-geoipupdate.sh.in) ============================================================================== --- head/net/ntopng/files/ntopng-geoipupdate.sh.in Tue Jan 15 18:06:50 2019 (r490395, copy source) +++ head/net/ntopng/files/ntopng-geoip2update.sh.in Tue Jan 15 18:16:34 2019 (r490396) @@ -3,37 +3,42 @@ 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 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 +# $2 filename +_fetchextract() { + url="$1" + file="$(basename "${url}")" + + if fetch "${url}"; then + tar xzf "${file}" + else + echo "${file} download failed" + return 1 fi - else - echo "$2 download failed" - return 1 - fi - rm -f "$TEMPFILE" - trap - 0 - return 0 + + return 0 } -echo Fetching GeoLiteCity.dat... -_fetch "http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz" GeoLiteCity.dat +echo Fetching GeoLite2-City +_fetchextract 'https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz' -echo Fetching GeoLiteCityv6.dat... -_fetch "http://geolite.maxmind.com/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz" GeoLiteCityv6.dat +echo Fetching GeoLite2-ASN +_fetchextract 'https://geolite.maxmind.com/download/geoip/database/GeoLite2-ASN.tar.gz' -echo Fetching GeoIPASNum.dat... -_fetch "http://download.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz" GeoIPASNum.dat.gz +mv GeoLite2-*/*.mmdb %%DATADIR%%/httpdocs/geoip -echo Fetching GeoIPASNumv6.dat... -_fetch "http://download.maxmind.com/download/geoip/database/asnum/GeoIPASNumv6.dat.gz" GeoIPASNumv6.dat.gz +cd %%DATADIR%%/httpdocs/geoip +rm -rf "${TEMPDIR}" + +chown root:wheel *.mmdb +chmod 444 *.mmdb + +trap - 0 + +return 0 Modified: head/net/ntopng/files/pkg-deinstall.in ============================================================================== --- head/net/ntopng/files/pkg-deinstall.in Tue Jan 15 18:06:50 2019 (r490395) +++ head/net/ntopng/files/pkg-deinstall.in Tue Jan 15 18:16:34 2019 (r490396) @@ -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 Modified: head/net/ntopng/pkg-message ============================================================================== --- head/net/ntopng/pkg-message Tue Jan 15 18:06:50 2019 (r490395) +++ head/net/ntopng/pkg-message Tue Jan 15 18:16:34 2019 (r490396) @@ -8,8 +8,9 @@ ntopng requires to connect to a redis server to work. 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: Modified: head/net/ntopng/pkg-plist ============================================================================== --- head/net/ntopng/pkg-plist Tue Jan 15 18:06:50 2019 (r490395) +++ head/net/ntopng/pkg-plist Tue Jan 15 18:16:34 2019 (r490396) @@ -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