All Projects → m-messiah → Ip2geo

m-messiah / Ip2geo

Licence: mit
Импортер ipgeo-данных в файлы, понятные для nginx geoip module, с поддержкой кодов регионов РФ.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Ip2geo

Docker Waf
An NGINX and ModSecurity based Web Application Firewall for Docker
Stars: ✭ 181 (+206.78%)
Mutual labels:  nginx, nginx-proxy
geostat
GeoStat, Python script for parsing Nginx and Apache logs files and getting GEO data from incoming IP's.
Stars: ✭ 50 (-15.25%)
Mutual labels:  geo, nginx-proxy
Country Ip Blocks
CIDR country-level IP data, straight from the Regional Internet Registries, updated hourly.
Stars: ✭ 100 (+69.49%)
Mutual labels:  geoip, nginx
Nginx
NGINX Accelerated! This is a Docker image that creates a high performance (FAST!), optimized image for NGINX for use with Redis and PHP-FMP. Deliver sites and applications with performance, reliability, security, and scale. This NGINX server offers advanced performance, web and mobile acceleration, security controls, application monitoring, and management.
Stars: ✭ 157 (+166.1%)
Mutual labels:  nginx, nginx-proxy
Nginx Autoinstall
Compile Nginx from source with custom modules on Debian and Ubuntu
Stars: ✭ 443 (+650.85%)
Mutual labels:  geoip, nginx
Nginx Admins Handbook
How to improve NGINX performance, security, and other important things.
Stars: ✭ 12,463 (+21023.73%)
Mutual labels:  nginx, nginx-proxy
Docker Elastic Stack
ELK Stack Dockerfile
Stars: ✭ 175 (+196.61%)
Mutual labels:  geoip, nginx
Ngx http ipdb module
Another nginx http geoip module by ipdb
Stars: ✭ 104 (+76.27%)
Mutual labels:  geoip, nginx
Apioak
Full Lifecycle Management API Gateway.
Stars: ✭ 335 (+467.8%)
Mutual labels:  nginx, nginx-proxy
Nginx Proxy Manager
Docker container for managing Nginx proxy hosts with a simple, powerful interface
Stars: ✭ 5,221 (+8749.15%)
Mutual labels:  nginx, nginx-proxy
Symfony 4 Docker Env
Docker Environment for Symfony. PHP-FPM, NGINX SSL Proxy, MySQL, LEMP
Stars: ✭ 119 (+101.69%)
Mutual labels:  nginx, nginx-proxy
Engintron
Engintron for cPanel/WHM is the easiest way to integrate Nginx on your cPanel/WHM server. Engintron will improve the performance & web serving capacity of your server, while reducing CPU/RAM load at the same time, by installing & configuring the popular Nginx webserver to act as a reverse caching proxy in front of Apache.
Stars: ✭ 587 (+894.92%)
Mutual labels:  nginx, nginx-proxy
Docker Oidc Proxy
Docker Image built on Alpine Linux for secure OpenID Connect (OIDC) proxy authentication
Stars: ✭ 91 (+54.24%)
Mutual labels:  nginx, nginx-proxy
Nginx Proxy Automation
Automated docker nginx proxy integrated with letsencrypt.
Stars: ✭ 2,302 (+3801.69%)
Mutual labels:  nginx, nginx-proxy
Vouch Proxy
an SSO and OAuth / OIDC login solution for Nginx using the auth_request module
Stars: ✭ 1,239 (+2000%)
Mutual labels:  nginx, nginx-proxy
lua-resty-maxminddb
A Lua library for reading MaxMind's Geolocation database
Stars: ✭ 72 (+22.03%)
Mutual labels:  geo, geoip
Plex Nginx Reverseproxy
Configuration to serve Plex Media Center https://plex.tv using Nginx https://nginx.com
Stars: ✭ 523 (+786.44%)
Mutual labels:  nginx, nginx-proxy
The World Is Yours
Nginx L7 DDoS Protection! And many more features 💥 ⚡️
Stars: ✭ 20 (-66.1%)
Mutual labels:  nginx, nginx-proxy
Pi Camera In A Box
Stream your Raspberry Pi Camera Module directly to your web browser
Stars: ✭ 49 (-16.95%)
Mutual labels:  nginx
Geo On Fire
A library to create high performance geolocation queries for Firebase. Checkout the demos: https://run.plnkr.co/plunks/AYaN8ABEDcMntgbJyLVW/ and https://run.plnkr.co/plunks/xJgstAvXYcp0w7MbOOjm/
Stars: ✭ 54 (-8.47%)
Mutual labels:  geo

Ip2Geo importer

TravisGitHub releaseGithub ReleasesMaintainability

Импортер ipgeo-данных в файлы, понятные для nginx geo module, с поддержкой кодов регионов РФ.

Поддерживает Ipgeobase.ru, TOR-списки, MaxMind GeoLite (для городов и стран), базы IP2Proxy PX4 и PX4LITE.

Установка

  1. Скачать соответствующий архитектуре бинарник с github куда-нибудь в $PATH
  2. Сделать его исполняемым
  3. Пользоваться

(также, при наличии Go окружения можно собрать самостоятельно через go get + go build)

Запуск

По умолчанию, ip2geo генерирует все возможные map-файлы, но все настраиваемо с помощью ключей:

-c      string
    Путь до конфигурационного файла (см. config.yaml.example)
-output string
    Директория для записи map-файлов (по умолчанию: "output")
-q  Be quiet - skip [OK]
-qq Be very quiet - show only errors
-version Вывести текущую версию программы и выйти.
-ipgeobase
    Генерация IPgeobase баз (название города, код региона, часовой пояс)
-tor
    Генерация списков TOR нод.
-ip2proxy
    Генерация ip2proxy PX4LITE сетей
-ip2proxy-token string
    Токен для скачивания ip2proxy PX4LITE баз https://lite.ip2location.com/file-download
-ip2proxy-lite-filename string
    Путь до уже скачанного zip файла PX4LITE
-ip2proxy-pro
    Генерация ip2proxy PX4 сетей
-ip2proxy-pro-token string
    Токен для скачивания ip2proxy PX4
-ip2proxy-pro-filename string
    Путь до уже скачанного zip файла PX4
-ip2proxy-print-type
    Вместо 1 указывать тип прокси из ip2proxy (PUB/DCH/e.t.c.)
-maxmind
    Генерация баз MaxMind (название города, часовой пояс)
Дальше параметры для MaxMind:
-maxmind-license-key string
    Лицензионный ключ для MaxMind
-maxmind-filename string
    Путь до уже скачанного файла MaxMind GeoLite2-City-CSV.csv
-lang string
    Язык MaxMind баз (по умолчанию ru)
-ipver int
    MaxMind версия IP (4 or 6) (default 4)
-include string
    MaxMind фильтр: использовать только перечисленные страны  
    Принимает список ISO-кодов стран, разделенных пробелами ("RU FR EN")
-exclude string
    MaxMind фильтр: исключает из вывода перечисленные страны. (см формат выше)
-nobase64
    Не перекодирует MaxMind города в base64, записывая их в map-файл как есть. Не используйте, если не уверены в кодировке MaxMind.
-nocountry
    Не создавать map-файлы с названиями стран и iso-кодами стран из MaxMind

Формат geomap-файлов

geomap-файлы предназначены для использования в nginx в виде:

# Region
    geo $region {
        ranges;
        include geo/region.txt;
    }
# City
    geo $city_geo {
        ranges;
        include geo/city.txt;
    }

    geo $city_mm {
        ranges;
        include geo/mm_city.txt;
    }

    map $city_geo $city {
        "" $city_mm;
        default $city_geo;
    }
# Country
    geo $country {
        ranges;
        include geo/mm_country.txt;
    }
# Country Code
    geo $country_code {
        ranges;
        include geo/mm_country_code.txt;
    }
# TZ
    geo $tz_geo {
        ranges;
        include geo/tz.txt;
    }

    geo $tz_mm {
        ranges;
        include geo/mm_tz.txt;
    }

    map $tz_geo $tz {
        "" $tz_mm;
        default $tz_geo;
    }
# Tor
    geo $is_tor {
        ranges;
        default 0;
        include geo/tor.txt;
    }
# Proxy
    geo $is_proxy {
        ranges;
        default 0;
        include geo/ip2proxy_net.txt;
    }

Таким образом, IP адреса в файлах записаны в виде диапазона (range) и отсортированы по возрастанию IP. Карты сделаны каскадно, чтобы решить проблему пересечений диапазонов. IPGeobase используется в первую очередь, и если адрес там не найден, то MaxMind.

Для того, чтобы название города всегда отдавалось корректно - оно кодируется в base64 от utf8 (если не указан флаг -nobase64).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].