Skip to content

Commit ce07c19

Browse files
committed
Update geoip
1 parent 929c030 commit ce07c19

9 files changed

+13
-9
lines changed

geoip/COPYRIGHT.txt

-1
This file was deleted.

geoip/GeoLite2-ASN.mmdb

834 KB
Binary file not shown.

geoip/GeoLite2-City.mmdb

-10.7 MB
Binary file not shown.

geoip/GeoLite2-Country.mmdb

2.12 MB
Binary file not shown.

geoip/LICENSE.txt geoip/LICENSE

File renamed without changes.

geoip/README.txt

-1
This file was deleted.

geoip/update.sh

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
#!/bin/bash
22
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
3-
USER_AGENT="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36"
3+
USER_AGENT="Mozilla/5.0"
44

55
cd $DIR
66

7+
if [ ! -f ".maxmind_license_key" ]; then
8+
echo "Missing .maxmind_license_key file. Please make sure it exists in $DIR and contains your MaxMind license key: https://support.maxmind.com/hc/en-us/sections/1260801610490-Manage-my-License-Keys"
9+
exit 1
10+
fi
11+
712
MAXMIND_LICENSE_KEY=$(<.maxmind_license_key)
813
wget --quiet --user-agent="$USER_AGENT" "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&suffix=tar.gz&license_key=$MAXMIND_LICENSE_KEY" -O GeoLite2-City.tar.gz && tar --strip-components=1 -zxf GeoLite2-City.tar.gz && rm GeoLite2-City.tar.gz
914
wget --quiet --user-agent="$USER_AGENT" "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country&suffix=tar.gz&license_key=$MAXMIND_LICENSE_KEY" -O GeoLite2-Country.tar.gz && tar --strip-components=1 -zxf GeoLite2-Country.tar.gz && rm GeoLite2-Country.tar.gz
1015
wget --quiet --user-agent="$USER_AGENT" "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-ASN&suffix=tar.gz&license_key=$MAXMIND_LICENSE_KEY" -O GeoLite2-ASN.tar.gz && tar --strip-components=1 -zxf GeoLite2-ASN.tar.gz && rm GeoLite2-ASN.tar.gz
16+
rm *.txt

tests/test_export.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ def test_export(mock_strict_redis, mock_get_heights, mock_write_json_file):
4747
None,
4848
"Singapore",
4949
"SG",
50-
1.3036,
51-
103.8554,
50+
1.2868,
51+
103.8503,
5252
"Asia/Singapore",
5353
"AS16509",
5454
"AMAZON-02",

tests/test_resolve.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ def test_raw_geoip():
7979
geoip = Resolve().raw_geoip("2606:4700:4700::1111")
8080
assert geoip == (
8181
None,
82-
"US",
83-
37.751,
84-
-97.822,
85-
"America/Chicago",
82+
None,
83+
0.0,
84+
0.0,
85+
None,
8686
"AS13335",
8787
"CLOUDFLARENET",
8888
)

0 commit comments

Comments
 (0)