From nobody Sat Jun 08 01:11:26 2024 X-Original-To: questions@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 4Vx0QB6gwKz5N9Ft for ; Sat, 08 Jun 2024 01:11:30 +0000 (UTC) (envelope-from rody@dds.nl) Received: from smtp2.signet.nl (smtp2.signet.nl [83.96.147.103]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vx0Q86K7fz4gNZ for ; Sat, 8 Jun 2024 01:11:28 +0000 (UTC) (envelope-from rody@dds.nl) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=pass (policy=none) header.from=dds.nl; spf=pass (mx1.freebsd.org: domain of rody@dds.nl designates 83.96.147.103 as permitted sender) smtp.mailfrom=rody@dds.nl Received: from [10.0.1.103] (unknown [45.83.7.125]) by smtp2.signet.nl (Postfix) with ESMTPSA id AFF1040C4912 for ; Sat, 8 Jun 2024 03:11:25 +0200 (CEST) From: Rody To: questions@freebsd.org Subject: Re: How to install geoiplookup? Date: Sat, 8 Jun 2024 03:11:26 +0200 User-Agent: KMail/1.9.10 References: <202406071553.40403.rody@dds.nl> In-Reply-To: X-KMail-QuotePrefix: > List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-questions@freebsd.org Sender: owner-freebsd-questions@FreeBSD.org MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <202406080311.26029.rody@dds.nl> X-Spamd-Bar: - X-Spamd-Result: default: False [-1.62 / 15.00]; SUBJECT_ENDS_QUESTION(1.00)[]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999]; NEURAL_HAM_LONG(-0.99)[-0.989]; NEURAL_HAM_SHORT(-0.83)[-0.833]; DMARC_POLICY_ALLOW(-0.50)[dds.nl,none]; R_SPF_ALLOW(-0.20)[+ip4:83.96.147.103]; MIME_GOOD(-0.10)[text/plain]; ONCE_RECEIVED(0.10)[]; RCVD_IN_DNSWL_LOW(-0.10)[83.96.147.103:from]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_ONE(0.00)[1]; ASN(0.00)[asn:21155, ipnet:83.96.128.0/17, country:NL]; MLMMJ_DEST(0.00)[questions@freebsd.org]; ARC_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; R_DKIM_NA(0.00)[]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[questions@freebsd.org]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_ALL(0.00)[] X-Rspamd-Queue-Id: 4Vx0Q86K7fz4gNZ Op vrijdag 7 juni 2024, schreef Edward Sanford Sutton, III: > On 6/7/24 06:53, Rody wrote: > > Hi everyone, > > > > Trying to prepare myself to get command line geoip lookups working. > > Running 13.3-RELEASE-p1 of freebsd. It seems the pkg libmaxminddb is > > installed by default but missing the tools to access the data. > > Which tools are missing? My understanding is it is a library for > accessing the database files once they are downloaded. There are no > special options to that port (just documentation related) so installing > from pkg or ports should give identical results for available tools and > capabilities. Once you have a ports tree, you can check the options of > that port with `cd /usr/ports/net/libmaxminddb;make showconfig`. > > https://www.freshports.org/net/libmaxminddb/ section "This port is > required by" can help get an idea of other ports using this port; it > only includes direct dependencies and does not handle dependencies that > could be changed by changing options in ports. > > > The following page tells me to install the libmaxminddb via ports: > > https://forums.freebsd.org/threads/geoiplookup-for-the-new-geolite2-count > >ry-db.69866/ But it does not include info for when you've never used ports > > before. Ah! I was looking for the old geoiplookup tool as it is currently still named on linux. It doesn't exist anymore on bsd though. It is now the new GeoIP2 software, but I got confused by info from multiple sources as you say further down yourself. I compared the files that the port would provide and the files I already had installed on my system, and they were the same. Both provided the same binary that I did not look for as it was named different from what I expected and was looking for. (geoiplookup vs. mmdblookup) The mmdblookuptool has different syntax and output but I can use it. After long searching I finally came to the conclusion that installing ports was not needed for what I wanted with GeoIP. The previous link gave me the wrong impression that a ports install of the program would be different from the default program from pkg. My bad... > > net/geoipupdate is a port that handles fetching the geoip2 databases. It > is written by maxmind though it is in go instead of c and seems to have > much more going on for inner workings. If the c version from the forums > works in beneficial ways over the maxmind copy then maybe it could be > made into a port for more users to benefit. There have been various > changes to libmaximdb since that post in 2019 that should be reviewed > for compatibility. > > > The following page tell what to do to get started with ports: > > https://docs.freebsd.org/en/books/handbook/ports/ > > And tells me that if ports was not installed during install, I should use > > a series of commands to use git. > > > > Not sure if ports was indeed installed or not during install. Any way to > > find out? > > if `ls /usr/ports` is missing/empty then you didn't install it from the > installer (or moved it); you can get a ports tree and also later update > the ports tree with git. > > > The following page recommends to use portsnap: > > https://www.cyberciti.biz/faq/install-ports-in-freebsd/ > > Portsnap seems to be installed by default and easier to use, but: > > https://forums.freebsd.org/threads/portsnap-being-retired-whats-the-alter > >native.76463/ suggests that maybe only git should be used? > > Portsnap is removed from 14+ though it is still present in > /usr/ports/ports-mgmt/portsnap. Reading its makefile I see > > DEPRECATED= portsnap infrastructure will be removed after the EOL of > 13.x > EXPIRATION_DATE=2026-04-30 > > which tells me the present plan is you would be learning a dead end; it > will remain a viable option to you until upgrading off of 13. The > cyberciti.biz article covering portsnap form base for FreeBSD14 when > updated last month is a bug in that article; its title should remove 14 > or it should include git instructions. The article's content explains > its steps only got to 13. > https://www.freebsd.org/releases/14.0R/relnotes/ section about portsnap > makes that clear for FreeBSD 14+. Thanks for making that clear to me as I have need for using ports soonish, but not for this. > > > Still, it seems the database was already installed automatically using > > pkg so it should probably be deleted prior to starting with ports? > > Ports is the instructions to build and install software. Its install are > registered as an installed package and the tree is used within a clean > environment to build the official packages. If you need to change build > options or need a version that is not in the pkg repo but is in a > newer/older ports tree then you could build it yourself but otherwise > the pkg installed version should be the same. > > > I imagine the geoiplookup tool is only a tiny binary and requires a lot > > of work to get it installed this way, or am I missing something? > > The ports tree is a collection of 'how to make it work' steps, > changes/fixes, etc. so getting an entry there is usually how it is made > easier for FreeBSD users. As for documentation, you tried to follow it > from multiple places to solve the problems as they arise which usually > complicates things. Unless there is a known bug, I'd defer to what is in > the handbook and other official FreeBSD documentation over what is in > internet blogs and forums when available. The handbook and similar > documents receives updates and tries to represent how things are > currently working for what they cover; though not perfect, it is usually > better than words of a random individual and more up to date than places > where there may not be an 'edit' button later. Thanks for making it all much clearer. It's not that hard but got bitten by older info that I couldn't place exactly. But it happened before with fail2ban. That program has had changes that affected how pf should be configured. Many sources available but all explained the old way. Still, I found my way in the end... > > > Rody