qbittorrent / qBittorrent

qBittorrent BitTorrent client
https://www.qbittorrent.org
Other
27.84k stars 3.93k forks source link

Using IPinfo IP to Country database #21376

Open abdullahdevrel opened 1 month ago

abdullahdevrel commented 1 month ago

Suggestion

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

Use case

This would replace the existing DB-IP database which is used for geoip functionality. Compared to DBIP, IPinfo's database provides full accuracy and comes with daily updates. The database will be used for resolving the countries of peers. Because the database uses active measurement geolocation information is higher then traditional IP geolocation databases.

Extra info/examples/attachments

Database schema

Field Name Example Data Type Description
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

Samples are available here: https://github.com/ipinfo/sample-database/tree/main/IP%20to%20Country

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!

Danny3 commented 4 days ago

As a user I wish these kind of databases are as accurate as possible and would be embedded in the program at the build time and are afterwards updated only if the anonymous mode is not used or other type of consent is used.

I assume there are not many other programs downloading updates for this kind of databases and someone monitoring the network at any level can infer from the updates of this database what program is used for the traffic.

abdullahdevrel commented 2 days ago

@Danny3 This is entirely possible. Look at our licensing terms; we do allow distribution of the database. The MMDB binary database is quite small and will get smaller as we do further engineering development. The IP database we have is as accurate as it can be.

Danny3 commented 2 days ago

@Danny3 This is entirely possible. Look at our licensing terms; we do allow distribution of the database. The MMDB binary database is quite small and will get smaller as we do further engineering development. The IP database we have is as accurate as it can be.

That's really great to hear! Hopefully the developers of this program will want to rise the privacy and security of it a bit by giving us more control about its automatic connections that it does. I'm one of those who thinks that when the maximum level of privacy and security is chosen, like with enabling the anonymous mode, the least amount of connections should be done. But of course, I would prefer even without that, the program has absolute everything what it needs and and some components like databases are enhanced / updates only if I want that too as I'm agreeing with a bit of privacy / security loss.

BTW, one more thing I wanted to ask you about the database? Does it or can it also contain information about the the ISPs / networks a IP address belongs to? For curiosity, like with the client that peers use, I would like to see which ISP / network they use, especially when they happen to be from my country.

I haven't activated this thing for years in this program as I don't want that the privacy and security of the peers that I connect to to be weakened by sending all their IPs to some online database which get the ISPs / networks for them. It's not explained anywhere AFAIK that this happen only on my comptuer and IPs are not sent anywhere.

If your database has also this information and lookup would be done only on my computer, I would enable such feature to see this information too.

abdullahdevrel commented 2 days ago

We are extremely concerned about privacy, which some folks might find surprising to hear given that we also provide an IP geolocation service.

We have a city-level free API that provides 1,000 daily lookups just based on unique IP addresses. Even though with a free account you get up to 50K lookups, the perk with API without using a token is that the rate limit is based on a unique IP address. Now, the reason I recommend this database is that it is a local database isolated within your own environment. Now, our license terms, unlike the rest of the industry, come without an EULA (End User License Agreement), making it extremely generous when it comes to distribution. We even permit commercial distribution through only providing an attribution to us (IPinfo).

The benefit is that you can package the database itself with the repo and distribute it across your users. From our end, we only see the initial download of the database, and have no clue how it gets distributed. It is as privacy-friendly as it gets, in my opinion.

The goal is to provide the best possible quality, reliability, and OSS-friendly data that we can. Developer experience always been the case with us.


Does it or can it also contain information about the the ISPs / networks a IP address belongs to?

I think the project abd you should use the free IP to Country ASN database.

It contains ASN/ISP. :)

Check all the free database we have here: https://ipinfo.io/products/free-ip-database

The project could use that single database to get both country and ASN/ISP data from it. Or, if they want to limit their engineering investment, they can just use the IP to Country database.

We also have a version that only contains ASN/ISP and comes without the country information: https://ipinfo.io/developers/ip-to-asn-database

Let me know if you have more ideas or questions. Happy to help!