Skip to main content

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

Project description

IpGeoBase importer
==================

Импортер 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
-----

```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.0.tar.gz (4.0 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for ipgeobase-importer-1.0.tar.gz
Algorithm Hash digest
SHA256 f59aa18c1584e92e18063a7172b81f74d3593749545cb2d1b287f6fb8dcb140a
MD5 42325aa2603f6c364e5f69c02c26a48e
BLAKE2b-256 be45719c44ba155f73e8ea0cbedbb2e66f98f3ac7d8804f1d37317f8156f8596

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