Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Accessing GeoLite2 database in 2020 #29

Open
wbyoung opened this issue Jan 2, 2020 · 7 comments
Open

Accessing GeoLite2 database in 2020 #29

wbyoung opened this issue Jan 2, 2020 · 7 comments

Comments

@wbyoung
Copy link

wbyoung commented Jan 2, 2020

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!

@circlingthesun
Copy link

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"

@wbyoung
Copy link
Author

wbyoung commented Jan 4, 2020

@circlingthesun any plans on a PR back here then?

@circlingthesun
Copy link

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

@wbyoung
Copy link
Author

wbyoung commented Jan 4, 2020

@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?

@tomrallen
Copy link

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.

@letrungkien
Copy link

Thank you @circlingthesun 👍

@Pagebakers
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants