Add IP info lookup for Admins

Yeah, it looks like ipinfo.io doesn’t support ipv6-Addresses at all http://ipinfo.io/2001:4860:4860::8888 gives me Please provide a valid IP address.

@coderholic, any idea of any provider that does?

I’ve just added IPv6 support http://ipinfo.io, so hopefully this should now just work. Here’s what’s coming back for the example IP you posted:

$ curl http://ipinfo.io/2001:4860:4860::8888
{
  "ip": "2001:4860:4860::8888",
  "hostname": "No Hostname",
  "city": null,
  "region": null,
  "country": "US",
  "loc": "38.0000,-97.0000",
  "org": "AS15169 Google Inc."
}

One thing I should probably draw your attention to is the fact that the free ipinfo.io plan is limited to 1,000 lookups per day, and beyond that it’ll return a 429 error. If you’re expecting to do more than 1,000 IP lookups a day then get in touch via http://ipinfo.io/contact and I’m sure we can work something out.

4 Likes

Awesome! As this is an admin-only on demand, manual click action I highly doubt any Discourse install would come anywhere remotely close to 1k lookups per day.

3 Likes

FIY: I fixed the issue when you were using HTTPS

https://github.com/discourse/discourse/commit/59b5ba7c0f3d4f2f86d00b5f08e0cfef8de4ffe1

This also makes IPV6 lookups work thanks @coderholic!

4 Likes