项目作者: zhangmingkai4315

项目描述 :
Using Free GeoIP databases, transfer to redis database for api query
高级语言: Go
项目地址: git://github.com/zhangmingkai4315/geoip-server.git
创建时间: 2018-05-14T03:01:57Z
项目社区:https://github.com/zhangmingkai4315/geoip-server

开源协议:MIT License

下载


geoip-server

Using Free GeoIP databases, transfer to redis database for api query

Download

when you checkout the git repo, please follow the next instructions to install database to local
server.

  1. ./scripts/updatefile.sh

you can put this code to crontab and download new files any time

Save To Redis

make sure you redis server is running(not local? change the REDIS_SERVER in scripts/*.py).

  1. pip install -r requirements.txt
  2. cd scripts
  3. python import_asn_to_redis.py
  4. python import_ip_to_redis.py

the first command will install deps for python scripts. then import asn data and ip data to redis.after install it will print one test result for test if it success.

RunServer

The server is a golang progrom. You can download the binary file from release page or install golang development env for change code as you wish.

Databases

GeoLite2 databases are free IP geolocation databases comparable to, but less accurate than, MaxMind’s GeoIP2 databases. The GeoLite2 Country and City databases are updated on the first Tuesday of each month. The GeoLite2 ASN database is updated every Tuesday.

download

License

This product includes GeoLite2 data created by MaxMind, available from http://www.maxmind.com