geoipupdate and the 401

Bugs in eFa 4
Post Reply
mattch
Posts: 30
Joined: 28 Mar 2018 22:26

geoipupdate and the 401

Post by mattch » 22 Apr 2020 02:01

04/22/20 EDIT: skip down for the correct method of updating geoip2. this works but is a lot more difficult than it has to be.



Using a fresh install of eFa-v4.0.2 (with restored backup from v3) on centos 7 which included geoipupdate v2.5, kept giving a 401 response (geoipupdate -v) complaining invalid account or license. its not invalid. IDK, this may be user error :think: but here is what I find and did.

Reading this https://dev.maxmind.com/geoip/geoipupdate/ it seems an update to geoipupdate is in order, to v4.x.

Of course downloading precompiled rpm from github doesn't work. It complains about conflicts (below) and i was too chicken to try a yum remove because of dependencies, efa being one. I ate some space to compile from source which solved my dilemma. :dance:

rpm update conflict

Code: Select all

[root@mx2 ~]# rpm -i geoipupdate_4.3.0_linux_amd64.rpm
        file /etc/GeoIP.conf from install of geoipupdate-0:4.3.0-1.x86_64 conflicts with file from package geoipupdate-2.5.0-1.el7.x86_64
        file /usr/bin/geoipupdate from install of geoipupdate-0:4.3.0-1.x86_64 conflicts with file from package geoipupdate-2.5.0-1.el7.x86_64
I had to yum go and pandoc for compilation. edited Makefile to reflect conf and db location, keeping it consistent.

Code: Select all

CONFFILE=/etc/GeoIP.conf
....
DATADIR=/usr/share/GeoIP

Code: Select all

cd
yum install go pandoc
wget https://github.com/maxmind/geoipupdate/archive/v4.3.0.tar.gz
tar xvf v4*
cd geoipupdate-*
make all
mv /bin/geoipupdate /bin/geoipupdate_old
cp build/geoipupdate /bin/geoipupdate
rpm/source
https://github.com/maxmind/geoipupdate/releases

Final product: :clap: :dance:

Code: Select all

[root@mx2 ~]# geoipupdate -v
Using config file /etc/GeoIP.conf
Using database directory /usr/share/GeoIP
Performing get filename request to https://updates.maxmind.com/app/update_getfilename?product_id=GeoLite2-Country
Acquired lock file lock (/usr/share/GeoIP/.geoipupdate.lock)
Calculated MD5 sum for /usr/share/GeoIP/GeoLite2-Country.mmdb: xx
Performing update request to https://updates.maxmind.com/geoip/databases/GeoLite2-Country/update?db_md5=xx
No new updates available for GeoLite2-Country
Crontab for a weekly update

Code: Select all

32 5 * * 5 /bin/geoipupdate
In hopes to free up disk space:

Code: Select all

yum remove go
Last edited by mattch on 22 Apr 2020 17:36, edited 2 times in total.

User avatar
shawniverson
Posts: 3231
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: geoipupdate and the 401

Post by shawniverson » 22 Apr 2020 11:03

This works, just know that geoip update is built-in with mailwatch. You can add a key to it and it will keep your GeoIP stuff up to date too. :D

mattch
Posts: 30
Joined: 28 Mar 2018 22:26

Re: geoipupdate and the 401

Post by mattch » 22 Apr 2020 17:32

:teasing-dink:
So this isnt a bug after all.

i cant believe i missed that in tools menu, and in eFa-configure.
****** added license in efa-configure, run the update in mailwatch gui, boom done. *******
too easy, too easy.


Here is some closure to my unnecessary saga:
-upgrading geoipupdate to v4 and running (outside mailwatch) will update the geoip2 database, ok good. however mailwatch lookups failed.
-When i ran update from mailwatch i saw it drop the geoip2 database in /var/www/html/mailscanner/temp/
-The lookup failed because the database is in the wrong location (/usr/share/GeoIP).
- link /usr/share/GeoIP/GeoLite2-country.mmdb to /var/www/html/temp/GeoLite2-country.mmdb


started playing in v4 few days ago and let me say I'm loving it. Excellent work.

Post Reply