Learn about Centmin Mod LEMP Stack today
Register Now

MaxMind GeoIP2: No public download available any more

Discussion in 'Bug Reports' started by wmtech, Jan 2, 2020.

  1. wmtech

    wmtech Active Member

    175
    44
    28
    Jul 22, 2017
    Ratings:
    +132
    Local Time:
    4:24 PM
    Giving the recent changes with the distribution of the geoip2 databases by MaxMind, when can we expect an update to the geoipdb-update.sh tool to be able again to update GeoIP2 databases?


    Currently this update tool does not work. So GeoIP2 is not working any more for new Centminmod installations and not updating any more for all existing installations.

    'Significant Changes to Accessing and Using GeoLite2 Databases | MaxMind Blog
     
  2. eva2000

    eva2000 Administrator Staff Member

    54,362
    12,198
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,763
    Local Time:
    1:24 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Dam this messes things up requiring maxmind registered account to download the geoip2 lite databases and then not allowing me to sign up :rolleyes:

    geoip2-lite-signup-denied-01.png

    Guess will need to work on this when I have some spare time.
     
  3. eva2000

    eva2000 Administrator Staff Member

    54,362
    12,198
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,763
    Local Time:
    1:24 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Seems to break CSF Firewall too that uses maxmind's geoip2 lite database New csf v13.09 | ConfigServer Services Blog

    from lfd.log
    Code (Text):
    Jan  1 07:15:07 host lfd[11096]: Country Code Lookups...
    Jan  1 07:15:07 host lfd[11096]: CC Error: Country Code Lookups setting MM_LICENSE_KEY must be set in /etc/csf/csf.conf to continue using the MaxMind databases
    
     
  4. eva2000

    eva2000 Administrator Staff Member

    54,362
    12,198
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,763
    Local Time:
    1:24 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    For existing 123.09beta01 users, running cmupdate command will update their existing GeoLite2 update tool at /usr/local/src/centminmod/tools/geoip2db-update.sh as per latest commit update. You GeoLite 2 database for Nginx GeoIP2 nginx module will then update to only use Dec 24, 2019 database version. The last one before Maxmind changed to require registration signups to be able to download newer GeoLite2 databases. This is temporary measure until I figure out what to do or switch to ip2location nginx module/database. This only addresses the Nginx GeoIP2 Lite database source only. No work on CSF Firewall's changed configuration requirements for it's own Maxmind GeoLite2 database download routines yet. Will work on that soon.
     
  5. eva2000

    eva2000 Administrator Staff Member

    54,362
    12,198
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,763
    Local Time:
    1:24 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Update for CSF Firewall's Maxmind Geolite2 database required MM_LICENSE_KEY in CSF version 13.10 at https://community.centminmod.com/th...ite2-database-routines-in-123-09beta01.18953/

    Part 2 update https://community.centminmod.com/th...ite2-database-routines-in-123-09beta01.18954/ further improves it so that if MM_LICENSE_KEY isn't set in /etc/centminmod/custom_config.inc & /etc/csf/csf.conf and if the variables aren't set and /var/lib/csf/Geo database files are missing, download last publicly available geolite2 databases for CSF Firewall as at Dec 23, 2019 & extend CC_INTERVAL to 365 days before next geolite2 database update to give me time to develop alternative arrangements. Once MM_LICENSE_KEY is set in /etc/centminmod/custom_config.inc and/or /etc/csf/csf.conf, then on next centmin.sh menu run, the CC_INTERVAL will be reset back from 365 days to default 14 days for geolite2 database update checks.
     
    Last edited: Jan 2, 2020
  6. eva2000

    eva2000 Administrator Staff Member

    54,362
    12,198
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,763
    Local Time:
    1:24 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Added support for Nginx geoip2 module setup using Maxmind account sign up generated API token key as well via update at https://community.centminmod.com/th...se-routines-in-123-09beta01.18956/#post-80655. This is due to changes by Maxmind for GeoLite2 database downloads outlined at https://community.centminmod.com/th...download-available-any-more.18945/#post-80656

    When you set MM_LICENSE_KEY in persistent config file at /etc/centminmod/custom_config.inc with your manually obtained and generated Maxmind account's token API key via https://www.maxmind.com/en/geolite2/signup and generate the token API in Services > My License Key section of your Maxmind account, both CSF Firewall and Nginx geoip2 nginx module routines will download GeoLite2 database via Maxmind API for latest version. If you do not set MM_LICENSE_KEY in persistent config file at /etc/centminmod/custom_config.inc, then Centmin Mod will use a mirror of the last publicly available Dec 23, 2019 version.

    relevant outlined commits for these changes.
    One more update planned is for using a single Maxmind API key prefilled in MM_LICENSE_KEY variable in persistent config file at /etc/centminmod/custom_config.inc. But need to evaluate what it means for licensing requirements set out by Maxmind

    Maxmind tech support replied to my questions.
    Edit, latest update also adds a shared Maxmind API key by default https://community.centminmod.com/th...mind-geolite2-routines-in-123-09beta01.18957/
     
    Last edited: Jan 2, 2020
  7. wmtech

    wmtech Active Member

    175
    44
    28
    Jul 22, 2017
    Ratings:
    +132
    Local Time:
    4:24 PM
    Once again, I have to say that I am very impressed with your work, George. I just started to create a custom download script for our servers to download and update the databases, but you beated me and -boom- your solution is already there.

    Now I am just updating all our custom config files to include MM_LICENSE_KEY.

    THANK YOU! :love:
     
  8. eva2000

    eva2000 Administrator Staff Member

    54,362
    12,198
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,763
    Local Time:
    1:24 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Last edited: Jan 2, 2020
  9. eva2000

    eva2000 Administrator Staff Member

    54,362
    12,198
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,763
    Local Time:
    1:24 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+