vichan-devel / vichan

Vichan is the most popular and widely used imageboard software in the world. It is a free, light-weight, fast, highly configurable and user-friendly imageboard software package.
https://vichan.info
Other
636 stars 198 forks source link

Feature request: Using IPinfo IP to Country database #841

Open abdullahdevrel opened 2 days ago

abdullahdevrel commented 2 days ago

I am requesting to add support for IPinfo's IP to Country database to the project. The database has the following features:

Database schema

Field Name Example Data Type Description
start_ip 1.0.16.0 TEXT Starting IP address of an IP address range
end_ip 1.0.31.255 TEXT Ending IP address of an IP address range
country JP TEXT ISO 3166 country code of the location
country_name Japan TEXT Name of the country
continent AS TEXT Continent code of the country
continent_name Asia TEXT Name of the continent

Documentation: https://ipinfo.io/developers/ip-to-country-database

The database can be downloaded simply by accessing the storage URI with an access token.

curl -L https://ipinfo.io/data/free/country.mmdb?token=<YOUR_TOKEN> -o country.mmdb

Let me know what you think. Thanks!

Zankaria commented 2 days ago

Is that db schema compatible with the geoip2 library? If so, we could just add a note in the README

abdullahdevrel commented 2 days ago

Is that db schema compatible with the geoip2 library? If so, we could just add a note in the README

The DB schema is not compatible with MM's, unfortunately.

The mmdb reader library can read our MMDB database, but we have a different database schema.

https://community.ipinfo.io/t/migrating-from-maxmind-geolite2-country-to-ipinfo-country-mmdb-edition/56