[GUIDE] Automatic downloading & updating of the GeoLite2 database to implement geoblocking #1702
txwgnd
started this conversation in
Show and tell
Replies: 2 comments 1 reply
-
|
Hi Tom!
Thanks for the post! We would be super grateful if you would be able to
write this up and submit it as a PR on the docs-v2 repo to include in
the documentation? I think a page under community guides would be great
and we could link to it from the geoblocking pages.
|
Beta Was this translation helpful? Give feedback.
1 reply
-
|
Works like a charm! Thanks for the guide |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello All,
because the self-hosted version recently got gifted the geoblocking feature from the Pangolin team I thought I could share my recent implementation of automating this.
Maxmind is offering a tool for automatically downloading/updating their IP databases called geoipupdate.
First you need to create an account on Maxmind.
After You created an account you can obtain access to the GeoLite2 IP databases here
When you got access to the everything go to
Manage License Keysin your Maxmind dashboard and create a new key for Pangolin.Name the Key
Pangolinand save your account ID as well as your key. The key can only be seen once after creation!After you saved your key you need to modify your pangolin
docker-compose.yamlstack.Shut down your stack and open your
docker-compose.yamlin your favorite text editor.Append this service to your stack
Check out the
geoipupdatedocs for some optional environment variables.You can store the ID and key as well as other settings in a config file or Docker secrets.
Save the file but don't start your pangolin stack just yet.
Open
config.ymlfound in the config folder. (/pangolin/config)Add this line to the
serverobject: maxmind_db_path: "./config/GeoLite2/GeoLite2-Country.mmdb"This tells pangolin where to find the database. -> Docs
Start your stack back up again and et voilà you are now able to define country rules for your ressources!
BTW: You now can link this database to Traefik too -> Community Guide
Thanks to the Pangolin Team for reconsidering the direction of the project.
This is what keeps me going on spending some free time on projects like this.
Cheers
Tom
Beta Was this translation helpful? Give feedback.
All reactions