From nobody Fri Jul 28 09:46:53 2023 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RC2pk0HRkz4p9HX; Fri, 28 Jul 2023 09:46:54 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RC2pj6mrfz42pD; Fri, 28 Jul 2023 09:46:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690537614; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=n02eGbY9N8ayUZ0F7VqxlrU8ovbm2pNqLyXFQqGYSN0=; b=PcsOoPk/VedophOMaXFXIzkMmMEXHoK5lledWhBeKAyw6i3fUecND6/i8IUYkr8HuV79XD Td7nqGstvQDDdSuwm7d8sJVLJ/Ob5vv6IZkrgsP28HgATL0hYkJKfChwWFeOy4KZCw0uQ7 tRKR6yjfykkw0sJq9xittmJmRBa1fFt77TdwNHOsRjkfcyeVlRNd99yShMQFQBFPbGbCBP 3k0xTBIX2CuX+bjcR58ZE0X6tjrLt8GGOWD8js/QKwbylOedyRfU9hIpqaMzGwLDop1Elv LvCnKr0jnCpkjEPKky5ReIShmDM70nC/uFOJykZQguXt00jSHACi7DOxYnb1fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690537613; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=n02eGbY9N8ayUZ0F7VqxlrU8ovbm2pNqLyXFQqGYSN0=; b=hyNvD/IiNDuRaCN5/QuVU3p7qMOyCpGNWIOrAj/A7EGJi5WACP0lZWgekIlZA5wLqg/+UK X6VxklhRadjESmV5cAGUW+E3PXdCGMdOOpHcGDYQEsOogmHpBOIU4KytsipVDy42HwcsxB ip8gH0nXKxqaqp2qaowrYx7d06SAae+clhn4oqhRt+7ApixmP5hVl65RoJgQbJd9PntZjT WzpbRk2Ch6VmUqN/aw+vexHw7+zrgtDUX/YiCdYCIWBbVJijxkmKDznMYOuRf4R8sCdU8t 78k8VnXBifFwtoEI8MSRhHRagLxPeuosCRomKvQcl7QQZ9f7/RLgRzZqz1IaJA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690537614; a=rsa-sha256; cv=none; b=c1LyBxHwASLXOhIXui26v/tCEZ64Ev76UFZXeJPrSN1NyEDuLR2LAFsrXr/1uEETpqZ5J6 tFdsMu5vcMab63tsOFSGop+sYn0Zfi+Oi0JBb0PICJRkRUXrWmebVgn41xK6zfcZsbhCjc u6qyDVhvvAWyQeQMMA+kpobyRoVjaPFwGRpZm/POFGIt8APQH0cznQTP/f2MoMN4iWb8np z1RGG0agXlOhw4lRxnGVopHsz2Hpknkda8onUo+WHLlhpS2OdlAfjPwH60yajIT5e7eJAa TfahONHYgGj4DkelwENmHHxrGsP9lsCofYpAOBvCaO0NtcMG8o6V5XcBOLIM7w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RC2pj5sJ7zm21; Fri, 28 Jul 2023 09:46:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36S9krrW030009; Fri, 28 Jul 2023 09:46:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36S9krxY030008; Fri, 28 Jul 2023 09:46:53 GMT (envelope-from git) Date: Fri, 28 Jul 2023 09:46:53 GMT Message-Id: <202307280946.36S9krxY030008@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Guido Falsi Subject: git: f785779b1bb1 - main - net/ntopng: Fix GeoIP data download script List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: madpilot X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f785779b1bb16f8315be35d36ab57d17ed8e5560 Auto-Submitted: auto-generated The branch main has been updated by madpilot: URL: https://cgit.FreeBSD.org/ports/commit/?id=f785779b1bb16f8315be35d36ab57d17ed8e5560 commit f785779b1bb16f8315be35d36ab57d17ed8e5560 Author: Guido Falsi AuthorDate: 2023-07-28 09:45:10 +0000 Commit: Guido Falsi CommitDate: 2023-07-28 09:45:10 +0000 net/ntopng: Fix GeoIP data download script MaxMind now requires a free account with an API key to access its APIs to download the GeoLite2 datanases. Update scripts to adapt to new API interface and use API key provided via %%LOCALBASE%%/etc/GeoIP.conf Update pkg-message to provide this information. Reported by: thedoctorjtd <76110609+thedoctorjtd@users.noreply.github.com> Obtained from: https://github.com/freebsd/freebsd-ports/pull/182 --- net/ntopng/Makefile | 3 ++- net/ntopng/files/ntopng-geoip2update.sh.in | 7 +++++-- net/ntopng/{pkg-message => files/pkg-message.in} | 3 ++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/net/ntopng/Makefile b/net/ntopng/Makefile index 64e825b29976..8d7ee91de32f 100644 --- a/net/ntopng/Makefile +++ b/net/ntopng/Makefile @@ -1,5 +1,6 @@ PORTNAME= ntopng PORTVERSION= 5.6.d20230531 +PORTREVISION= 1 PORTEPOCH= 1 CATEGORIES= net @@ -27,7 +28,7 @@ BUILD_DEPENDS= bash:shells/bash USES= autoreconf compiler:c++11-lang cpe gmake ldap libtool localbase \ lua:54 mysql pathfix pkgconfig shebangfix sqlite ssl -SUB_FILES= ntopng-geoip2update.sh pkg-deinstall +SUB_FILES= ntopng-geoip2update.sh pkg-deinstall pkg-message SHEBANG_FILES= httpdocs/misc/ntopng-add-user.sh \ httpdocs/misc/ntopng-utils-manage-config.in GNU_CONFIGURE= yes diff --git a/net/ntopng/files/ntopng-geoip2update.sh.in b/net/ntopng/files/ntopng-geoip2update.sh.in index 1b0302d67856..3d3404647abe 100644 --- a/net/ntopng/files/ntopng-geoip2update.sh.in +++ b/net/ntopng/files/ntopng-geoip2update.sh.in @@ -25,11 +25,14 @@ _fetchextract() { return 0 } +# Get the license key from the GeoIP.conf file +LICENSE_KEY=$(awk -F ' ' '/^#/ {next} $1=="LicenseKey" {print $2}' %%LOCALBASE%%/etc/GeoIP.conf) + echo Fetching GeoLite2-City -_fetchextract 'https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz' +_fetchextract "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=${LICENSE_KEY}&suffix=tar.gz" echo Fetching GeoLite2-ASN -_fetchextract 'https://geolite.maxmind.com/download/geoip/database/GeoLite2-ASN.tar.gz' +_fetchextract "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-ASN&license_key=${LICENSE_KEY}&suffix=tar.gz" mv GeoLite2-*/*.mmdb %%DATADIR%%/httpdocs/geoip diff --git a/net/ntopng/pkg-message b/net/ntopng/files/pkg-message.in similarity index 83% rename from net/ntopng/pkg-message rename to net/ntopng/files/pkg-message.in index f3c46a612b40..02cc4fc9be53 100644 --- a/net/ntopng/pkg-message +++ b/net/ntopng/files/pkg-message.in @@ -10,7 +10,8 @@ remote one. 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. +data to the latest version. This script requires a maxmind.com +account API key configured in %%LOCALBASE%%/etc/GeoIP.conf to work. To pass a configuration file to ntopng, which overrides any command line arguments, add something like the following to rc.conf: