geoip icon indicating copy to clipboard operation
geoip copied to clipboard

GeoLite Legacy databases are now discontinued

Open toddmazierski opened this issue 6 years ago • 13 comments

As of today, MaxMind's GeoLite Legacy databases are discontinued:

https://support.maxmind.com/geolite-legacy-discontinuation-notice/

Two of the locations are now returning 404:

  • https://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
  • https://geolite.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz

You may want to consider updating the README to indicate this. Thanks!

toddmazierski avatar Jan 02 '19 19:01 toddmazierski

Thank you for the heads-up. Readme updated and pushed to Github. I don't think it's necessary to re-release the gem for this change.

cjheath avatar Jan 03 '19 00:01 cjheath

Many thanks, @cjheath!

toddmazierski avatar Jan 03 '19 15:01 toddmazierski

@cjheath I'm a bit confused by the update - the readme tells people they can download a Geolite2 database from https://dev.maxmind.com/geoip/geoip2/geolite2, but those aren't supported with GeoIP, right?

jdelStrother avatar Jan 04 '19 16:01 jdelStrother

Unfortunately correct, this gem has no support for the mmdb database format. Brain fart - I haven't touched this code in a long time. There are two options:

  • implement support for the new indexing and database format
  • implement a compiler from the CSV data to the legacy format.

It might sound bogus, but the latter is a much more well-defined problem. I don't want to resort to a C extension (this gem was written to replace one!). I don't know when I'll have time to read Maxmind's V2 code and re-implement it, or even if enough information is provided to make that possible. A contributor might offer to help, of course.

Any other options?

cjheath avatar Jan 05 '19 23:01 cjheath

I’ve not tried it yet, but https://github.com/yhirose/maxminddb is pure ruby and handles geoip2. If it’s any good, we could point users to that rather than maintaining a competing gem

jdelStrother avatar Jan 06 '19 14:01 jdelStrother

We could. But this gem has been in continuous use since 2005 (rubyforge days, before rubygems existed) and a lot of people still use it. maxminddb is MIT-licensed, so we could borrow the code with attribution. A quick scan of that code shows that the basic index structure and search algorithm is unchanged in any case, so it would also be possible to enhance the current implementation to support V2 databases.

cjheath avatar Jan 06 '19 15:01 cjheath

If you are thinking about implementing support, there is a public spec for the MaxMind DB format. There is also a relatively recent official pure Ruby implementation.

oschwald avatar Jan 06 '19 16:01 oschwald

Finally - it only took them 14 years to document and implement in Ruby! I don't feel too bad about letting mine die now, but my users might want something different.

cjheath avatar Jan 06 '19 22:01 cjheath

@cjheath I think it's worth wrapping the maxmind-db gem with the existing geoip API just to make it nice and easy for everybody to continue to without needing code changes.

I started to look into doing this, but I cannot figure out for the life of me how to make these tests run since the test Rake task doesn't quite work with files like test_file.rb

rtyler avatar Apr 09 '19 01:04 rtyler

There never has been an automated test for this gem, just a stub. test_file.rb is a manual test, used for dumping a GeoIP file in IP order - it needs to be given the pathname to a data file. I'd welcome a new implementation, but some tests are obviously needed first.

cjheath avatar Apr 09 '19 02:04 cjheath

@cjheath Am I understanding correctly, that you'd accept a new implementation based on maxminddb-reader that implemented the current GeoIP interfaces?

rtyler avatar Apr 18 '19 13:04 rtyler

Yes, I'd accept that. Perhaps the old code could be loaded to handle legacy files in case the maxminddb-reader doesn't?

cjheath avatar Apr 18 '19 21:04 cjheath

I haven't tried this out yet, but it seems that there's been some progress on the conversion of geo-ip2 to legacy formats.

There's a python script https://github.com/sherpya/geolite2legacy

And a site distributing dat files generated, presumably with this script: https://www.miyuru.lk/geoiplegacy

andyroberts avatar May 30 '20 18:05 andyroberts