Add location data to the list of active sessions

Description

This issue discusses how to add location data to the list of active sessions.

Follow-up to https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/17867

Proposal

Currently only the IP is shown, without any location lookup. There are some geo2location options available on the internet, most of which are proprietary.

Provider URLs Comment
Maxmind https://freegeoip.net
https://dev.maxmind.com/geoip/geoip2/geolite2/
Proprietary
HostIp http://www.hostip.info/dl/index.html Seems to belong to maxmind. Attributed company doesn't seem to exist anymore.
Data doesn't seem to be current.
ip2location https://lite.ip2location.com/database/ip-country-region-city
https://github.com/ip2location/ip2location-ruby
> You can redistribute one copy of the LITE database with your application with attribution. However, you need to inform all users to register for an individual license in http://lite.ip2location.com to download monthly updates. Third party database repository is not allowed.
ip2c http://about.ip2c.org
http://software77.net/geo-ip/
FOSS
returns only countries, no city data available
donationware license

In summary these are the 2 options:

  • Use the ip2c database to get the country
  • Use any other proprietary service to get an accurate location (city level)

Updating of data

Comment by @jameslopez:

I think the problem here is, do we want to maintain it? It means we'll have to have resources to keep it up to date (so it's meaningful) and store it somewhere.

My answer:

Yes, either maintain it as part of GitLab releases, or have the installation take of it (either by having the instance-admin manually update the database or by creating a background job that regularly updates the database).

The update frequency doesn't need to be that high. According to http://software77.net/geo-ip/:

probably once a month should be fine

Considering this I believe that making the update part of the GitLab releases seems the best option to me. But I'll have your inputs on that.

Links / references

Assignee Loading
Time tracking Loading