Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpolden/echoip.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2019-12-24 19:14:09 +0300
committerMartin Polden <mpolden@mpolden.no>2019-12-24 19:15:45 +0300
commit4974f9387b58edd051365b78e2c766782a83b4d9 (patch)
treecb3c37393419d204be55275f62ad51fbeb7ccbb0
parent1d478b5db3ecf6fdc810b51dbb2782be9728545c (diff)
Require license key for GeoIP download
Fixes #72.
-rw-r--r--Makefile5
1 files changed, 4 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index cb61f26..c35a922 100644
--- a/Makefile
+++ b/Makefile
@@ -23,8 +23,11 @@ install:
databases := GeoLite2-City GeoLite2-Country GeoLite2-ASN
$(databases):
+ifndef GEOIP_LICENSE_KEY
+ $(error GEOIP_LICENSE_KEY must be set. Please see https://blog.maxmind.com/2019/12/18/significant-changes-to-accessing-and-using-geolite2-databases/)
+endif
mkdir -p data
- curl -fsSL -m 30 https://geolite.maxmind.com/download/geoip/database/$@.tar.gz | tar $(TAR_OPTS) --strip-components=1 -C $(CURDIR)/data -xzf - '*.mmdb'
+ @curl -fsSL -m 30 "https://download.maxmind.com/app/geoip_download?edition_id=$@&license_key=$(GEOIP_LICENSE_KEY)&suffix=tar.gz" | tar $(TAR_OPTS) --strip-components=1 -C $(CURDIR)/data -xzf - '*.mmdb'
test ! -f data/GeoLite2-City.mmdb || mv data/GeoLite2-City.mmdb data/city.mmdb
test ! -f data/GeoLite2-Country.mmdb || mv data/GeoLite2-Country.mmdb data/country.mmdb
test ! -f data/GeoLite2-ASN.mmdb || mv data/GeoLite2-ASN.mmdb data/asn.mmdb