alexhaydock / BoringNginx

Nginx + Docker + BoringSSL = ✔️ Easy TLS 1.3

Home Page:https://gitlab.com/alexhaydock/boringnginx

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

geoipupdate failed

imba-tjd opened this issue · comments

docker run -it ubuntu
apt-get update && apt-get install geoipupdate -y
geoipupdate -v

And I got:

geoipupdate -v
geoipupdate 2.5.0
Opened License file /etc/GeoIP.conf
AccountID 0
LicenseKey 000000000000
Insert edition_id GeoLite2-Country
Insert edition_id GeoLite2-City
Read in license key /etc/GeoIP.conf
Number of edition IDs 2
url: https://updates.maxmind.com/app/update_getfilename?product_id=GeoLite2-Country
md5hex_digest: 00000000000000000000000000000000
url: https://updates.maxmind.com/app/update_getipaddr
Client IP address: xxx.xxx.xxx.xxx
md5hex_digest2 (challenge): 03f7711455e713fdfaefedc4e18ed9ac
url: https://updates.maxmind.com/app/update_secure?db_md5=00000000000000000000000000000000&challenge_md5=03f7711455e713fdfaefedc4e18ed9ac&user_id=0&edition_id=GeoLite2-Country
Received an unexpected HTTP status code of 401 from https://updates.maxmind.com/app/update_secure?db_md5=00000000000000000000000000000000&challenge_md5=03f7711455e713fdfaefedc4e18ed9ac&user_id=0&edition_id=GeoLite2-Country:
Invalid account ID

This caused CI fail.

This is because MaxMind who provide the GeoIP database for using geographic IP location features have changed their distribution model. Now you can't automatically download the GeoIP database without having an account on their site.

I also can't distribute the GeoIP db myself because of the license, so I can't just add it to the repo here. Using geoipupdate is necessary.

What I've had to do to fix this is split the Dockerfile. The regular Dockerfile now builds the container without any GeoIP support or the GeoIP module. This is the version which gets built and pushed to the GitLab container registry to be pulled by anyone.

Locally, you can still build the container with GeoIP support by signing up for a free account with MaxMind and generating a GeoIP.conf file for use with geoipupdate. You can then place this GeoIP.conf inside this directory and run:

make geoip

to build the container locally with GeoIP support.