Skip to main content

Импорт ipgeobase и TOR баз в совместимые с nginx geoIP map-файлы

Project description

https://img.shields.io/pypi/v/ipgeobase-importer.svg?style=flat-square https://img.shields.io/pypi/dm/ipgeobase-importer.svg?style=flat-square

Импортер ipgeobase базы русских городов в файлы, понятные для nginx geoip module, с поддержкой кодов регионов РФ.

Принцип

  1. Скачивает geo_files.zip с сайта ipgeobase.ru
  2. Конвертирует базу в два файла:
    • city.txt, вида: <start_ip>-<end_ip> base64(<city_name>);
    • region.txt, вида: <start_ip>-<end_ip> <region_code>; (01-99)
  3. Скачивает списки TOR с torproject и blutmagie.de
  4. Создает tor.txt, вида: <start_ip>-<end_ip> 1;

Установка

pip install ipgeobase-importer

Запуск

ipgeobase-importer <output_dir>

Nginx

geo $region {
    ranges;
    include geo/region.txt;
}

geo $city {
    ranges;
    include geo/city.txt;
}

geo $is_tor {
    ranges;
    default 0;
    include geo/tor.txt;
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for ipgeobase-importer, version 1.3
Filename, size File type Python version Upload date Hashes
Filename, size ipgeobase-importer-1.3.macosx-10.11-x86_64.tar.gz (3.6 kB) File type Dumb Binary Python version any Upload date Hashes View
Filename, size ipgeobase-importer-1.3.tar.gz (4.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page