Extension:IPInfo
IPInfo Release status: beta |
|
---|---|
Author(s) | Trust and Safety Product, Wikimedia Foundation |
Latest version | 0.0.0 |
Compatibility policy | Snapshots releases along with MediaWiki. Master is not backward compatible. |
MediaWiki | >= 1.43 |
Database changes | Yes |
License | MIT License |
Download | |
|
|
|
|
Quarterly downloads | 15 (Ranked 122nd) |
Public wikis using | 871 (Ranked 297th) |
Translate the IPInfo extension if it is available at translatewiki.net | |
Issues | Open tasks · Report a bug |
The IP Info extension is a feature for displaying IP information to help trusted users in their anti-vandalism workflows. The IP Info feature is being built by the Trust and Safety Product team (previously Anti-Harassment Tools) as part of the Temporary Accounts project.
Features
editThe IP Information 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, the Special:Log page, the Special:RecentChanges page and the Special:Watchlist 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.
When a user views IP information from the information box or popup and when they enable or disable the IP Info extension using the Special:Preferences page, these activities are tracked on the Special:Log page. Users with assigned privileges can access the IP information log.
Installation
edit- Download and move the extracted
IPInfo
folder to yourextensions/
directory.
Developers and code contributors should install the extension from Git instead, using:cd extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/IPInfo - 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 file:
wfLoadExtension( 'IPInfo' );
- Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
Granting rights to use the IP Information feature
edit
The IP Information 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.
Other rights are also available that allow a user to view basic, full and log information. To grant them add the following to LocalSettings.php
:
$wgGroupPermissions['sysop']['ipinfo-view-basic'] = true
Gives the user the right to view some IP information.
$wgGroupPermissions['sysop']['ipinfo-view-full'] = true;
Gives the user the right to view full IP information.
$wgGroupPermissions['sysop']['ipinfo-view-log'] = true;
Gives the user the right to view logs on IP information.
Usage
editEnabling the extension
Step 1:
- Navigate to the upper right corner of the page (you must be logged in and Beta features enabled) and click on the person and beta icons as shown.
- This action will take you to the Special:Preferences#mw-prefsection-betafeatures page with the Beta Features tab selected.
- Locate the IP Information Extension in the list of extensions, tick the box to enable or deactivate it. To complete the modifications, click the Save button as shown.
Step 2:
- On the Special:Preferences page, click on the User profile tab as shown.
- Scroll down to the IP Information section and check the box as shown. Click the Save button to complete the modifications.
Utilizing the extension
- Navigate to the Special:Contributions page, enter a valid IP address and click the search button as shown.
- This action will prompt you to accept the use of the IP Info extension. Accept the agreement by checking the box and clicking on the Enable IP Information tool as shown.
- This will now enable you to see pertinent information about IP Addresses such as: Location, ASN, etc.
- If no edits have been made with that IP address an error will occur as shown.
- The IP Information can be found on popups on the Special:Log page as shown.
- The IP Information can also be found on popups on the View History page as shown.
- If no data is available, an error is displayed as shown.
Data
editThe IP Info extension currently supports displaying data from MaxMind's GeoIP2 databases. The databases must be added to your server, and the $wgIPInfoGeoLite2Prefix
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 data
edit
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 $wgIPInfoGeoLite2Prefix
variable to the path to the directory containing the .mmdb files, plus the prefix GeoLite2-
. Do this by adding the following to LocalSettings.php:
$wgIPInfoGeoLite2Prefix = '$pathToDir/GeoLite2-';
replacing $pathToDir with the path to the directory containing the .mmdb files.
Note that the test databases only have data for a few IP addresses. For IP addresses that are not in the test database, the data will appear as not available when you view the IP information.
Paid data
editFor 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. Extract them and move all the .mmdb files into the same directory.
Then set the $wgIPInfoGeoIP2EnterprisePath
variable to the path to the directory containing the .mmdb files. Do this by adding the following to LocalSettings.php:
$wgIPInfoGeoIP2EnterprisePath = '$pathToDir';
replacing $pathToDir
with the path to the directory containing the .mmdb files. Note that, unlike with the free data, you should not include a prefix.
IPoid
edit- See also wikitech:Service/IPoid for details of Wikimedia's IPoid installation.
Spur is a proxy and VPN detection tools, and IPoid provides integration of IPInfo and Spur. If you have IPoid installed you can config IPInfo to use it via $wgIPInfoIpoidUrl. Note Spur's data feed is non-free and therefore Wikimedia's IPoid installation is not open for third party to use.
Configuration
editSetting name | Default value | Description |
---|---|---|
$wgIPInfoGeoLite2Prefix | false
|
Path to the directory containing GeoIP2 database files, plus the prefix GeoLite2-
|
$wgIPInfoGeoIP2EnterprisePath | false
|
Path to the directory containing GeoIP2 Enterprise database files |
This extension is being used on one or more Wikimedia projects. This probably means that the extension is stable and works well enough to be used by such high-traffic websites. Look for this extension's name in Wikimedia's CommonSettings.php and InitialiseSettings.php configuration files to see where it's installed. A full list of the extensions installed on a particular wiki can be seen on the wiki's Special:Version page. |
This extension is included in the following wiki farms/hosts and/or packages: This is not an authoritative list. Some wiki farms/hosts and/or packages may contain this extension even if they are not listed here. Always check with your wiki farms/hosts or bundle to confirm. |