freegeoip icon indicating copy to clipboard operation
freegeoip copied to clipboard

Accessing GeoLite2 database in 2020

Open wbyoung opened this issue 5 years ago • 7 comments

For those of us who are building this or using a Docker image, is there a way to configure things properly now that public access to downloading the MaxMind databases is no longer possible? Without changes, it seems as though the URL being accessed is for a domain that's no longer resolvable. And even if the URL was updated, I'd expect permission errors without incorporating the newly required license keys.

I tried using the username/license key setup, but that didn't end up working. The downloaded file was tiny and just said that the account ID was missing.

My current (workaround) plan is to incorporate the geoipupdate into a custom docket image that extends the image I'm currently using (I'm still on a slightly older version right now). Then have that run periodically through some other script (maybe an ENTRYPOINT script as cron feels heavyweight). Finally, I'll change the freegeoip config to use this file.

This seems like it would work for me, but I'd hate to do this work and find out I'm just missing something here. Also, I wouldn't want others to also have to go through this when they're just looking for the same functionality. Hopefully we can get something done here instead!

wbyoung avatar Jan 02 '20 22:01 wbyoung

I've forked a fork of this repo and made it work here: https://github.com/circlingthesun/freegeoip. Build it with docker build . --build-arg INITIAL_DATABASE_URL="https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&suffix=tar.gz&license_key=YOUR_LICENCE_KEY"

circlingthesun avatar Jan 04 '20 10:01 circlingthesun

@circlingthesun any plans on a PR back here then?

wbyoung avatar Jan 04 '20 10:01 wbyoung

@wbyoung, given the big deprecation warning on this repo, it seems pointless.

circlingthesun avatar Jan 04 '20 11:01 circlingthesun

@circlingthesun I was under the impression that the new API still used this project, but I haven't dug deeply into the changes that have been made since the project changed hands. In other words, the deprecation was related to usage & what consumers of the API must write rather than the project as a whole (and that ipstack.com still used this code to implement their offerings).

Is that not true @apilayer?

wbyoung avatar Jan 04 '20 22:01 wbyoung

Many thanks for your update @circlingthesun, this is now working perfectly for me using the new Maxmind Geolite2 download mechanism.

In case it helps anyone else, for some reason the command line parameters that I was using to pass the freegeoip parameters to the docker instance when starting it were no longer accepted after I moved to this fork. I had to switch to using an environment variable file (--env-file=prod.env) to pass the parameters instead.

It's possible this was because I was using a different version of freegeoip.

tomrallen avatar Jan 07 '20 00:01 tomrallen

Thank you @circlingthesun 👍

letrungkien avatar Jan 09 '20 14:01 letrungkien

Thanks, i managed to get it running using your method, but i'm still getting 503 errors on all requests.

This fork does work though!

https://github.com/voyagin/freegeoip

Pagebakers avatar Mar 17 '20 11:03 Pagebakers