Extension:IPInfo

MediaWiki extensions manual
OOjs UI icon advanced-invert.svg
IPInfo
Release status: experimental
Author(s) Wikimedia Anti-harassment tools team
Latest version 0.0.0
Compatibility policy Snapshots releases along with MediaWiki. Master is not backward compatible.
MediaWiki >= 1.36.0
License MIT License
Download
  • $wgIPInfoGeoIP2Prefix
  • $wgIPInfoGeoIP2EnterprisePath
  • ipinfo
Translate the IPInfo extension if it is available at translatewiki.net

Check usage and version matrix.

Issues Open tasks · Report a bug

The IP Info extension is a forthcoming feature for displaying IP information to help trusted users in their anti-vandalism workflows. The IP info feature is being built by the Anti-harassment tools team as part of the IP masking project.

FeaturesEdit

The IP info feature displays information about an IP address that would otherwise only be available from external tools.

Information buttons are added next to IP addresses on history pages and on the Special:Log page. Clicking on these buttons displays a popup with the information.

The same information is also added to the top of the Special:Contributions page for an IP address.

InstallationEdit

  • Download and place the file(s) in a directory called IPInfo in your extensions/ folder.
  • Only when installing from git run Composer to install PHP dependencies, by issuing composer install --no-dev in the extension directory. (See task T173141 for potential complications.)
  • Add the following code at the bottom of your LocalSettings.php:
    wfLoadExtension( 'IPInfo' );
    
  •   Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Granting rights to use the IP info featureEdit

The IP info feature is available to users who have the ipinfo right. To grant this right to all administrators on your wiki, add the following to LocalSettings.php:

$wgGroupPermissions['sysop']['ipinfo'] = true;

Once a user has this right, they will also need to enable the feature via Special:Preferences by checking the checkbox in the IP information section of the User profile tab.

DataEdit

The IPInfo extension currently supports displaying data from MaxMind's GeoIP2 databases. The databases must be added to your server, and the $wgIPInfoGeoIP2Prefix configuration variable must be set to the patch for these files, including the common prefix of the filenames (see the test data example).

Free test dataEdit

For development environments, free test data is available from https://dev.maxmind.com/geoip/geoip2/geolite2/. Download these databases, and move all the .mmdb files into the same directory. Then set the $wgIPInfoGeoIP2Prefix variable to the path to the directory containing the .mmdb files, plus the prefix GeoLite2-. Do this by adding the following to LocalSettings.php:

$wgIPInfoGeoIP2Prefix = '$pathToDir/GeoLite2-';

replacing $pathToDir with the path to the directory containing the .mmdb files.

ConfigurationEdit

Setting name Default value Description
$wgIPInfoGeoIP2Prefix false Path to the directory containing GeoIP2 database files

Edit

For development environments, we support the enterprise database data is available from https://www.maxmind.com/en/solutions/geoip2-enterprise-product-suite/enterprise-database and anonymous ip database https://www.maxmind.com/en/solutions/geoip2-enterprise-product-suite/anonymous-ip-database

Download these databases; GeoIP2 Anonymous IP(GZIP) and GeoIP2 Enterprise(ZIP) respectively. You can combine the 2 configuration tables into one table and put the information about enterprise support in the data section

Then set the $wgIPInfoGeoIP2EnterprisePath variable to the path to the directory containing the .mmdb files, plus the prefix GeoIP2-. Do this by adding the following to LocalSettings.php:

$wgIPInfoGeoIP2EnterprisePath = '/var/www/html/w/';

replacing $pathToDir with the path to the directory containing the .mmdb files.

ConfigurationEdit

Setting name Default value Description
$wgIPInfoGeoIP2EnterprisePath false Path to the directory containing GeoIP2 database files