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>;

  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.

Source Distribution

ipgeobase-importer-1.2.tar.gz (4.1 kB view details)

Uploaded Source

File details

Details for the file ipgeobase-importer-1.2.tar.gz.

File metadata

File hashes

Hashes for ipgeobase-importer-1.2.tar.gz
Algorithm Hash digest
SHA256 e60b9bc762e5a91753c4f012c67f1710f090baf8315f8643d3670d4585fa9bcf
MD5 c784b6a4af91ed13d2127ab396e1e652
BLAKE2b-256 c0200565efc8e30549db654eb1eef7aaa3b9b2ba61d5d5eeae46b0fc062bf763

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page