Plugin helper to get country information from an IP #5195
Labels
Component: PeerTube Plugin 📦
Features that can be developed in a plugin, but require PeerTube plugin API development
Type: Feature Request ✨
Describe the problem to be solved
Some time ago, I created the plugin georegister. With this plugin, you can configure a set of countries allowes to create account, or disallowed to create account.
I then use the IP provided to the hook filter:api.user.signup.allowed.result to check the country.
I didn't want to download and maintain a geoip list at the time I wrote this plugin. So I use the
whois
command, and check the country in the whois result.Describe the solution you would like
Now that Peertube has an (optional) geoip database (used for viewing stats), it would be nice to provide the IP's country as parameter here:
PeerTube/server/lib/server-config-manager.ts
Lines 261 to 268 in 76ab020
Of course, only if the geoip database is configured. If not, just don't pass any
country
attribute.The text was updated successfully, but these errors were encountered: