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.

Source Distribution

ipgeobase-importer-1.4.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

ipgeobase-importer-1.4.macosx-10.11-x86_64.tar.gz (3.8 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for ipgeobase-importer-1.4.tar.gz
Algorithm Hash digest
SHA256 476ae72eb9d83cfe397c94003b024b35ffeb9232e0161d0aafe14933262cc0c4
MD5 662628a0acac1d3f072b770421f382a1
BLAKE2b-256 ba96f459017c1bb1544ead8cd482dbf68ffb90375d9a3e3e7a388ab3226be424

See more details on using hashes here.

File details

Details for the file ipgeobase-importer-1.4.macosx-10.11-x86_64.tar.gz.

File metadata

File hashes

Hashes for ipgeobase-importer-1.4.macosx-10.11-x86_64.tar.gz
Algorithm Hash digest
SHA256 3e9780cf883cec78cfda37528ba385b4dc7934ca2ae579879e934a8fd270c84c
MD5 04304fe3b830af1e0df1da6eb37d9a65
BLAKE2b-256 884c804202ea39b69be50af7ecada856d7692064050a11bb05ceef32c9d918e2

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