Page MenuHomePhabricator

Support IP ranges in XTools
Closed, ResolvedPublicFeature

Description

For the Global Contribs tool specifically: Frequently, cross-wiki vandals use a certain CIDR range instead of a single IP address. With the progress of IPv6 deployment, this would happen more often. However, there are no tools supporting global contributions of IP ranges currently, which makes it hard for stewards to check possible overkill of global range blocks, leading to reluctance to take actions against ranges.

Now ip_changes table is available, the getRevisions and getDbNamesAndActorIds functions in GlobalContribsRepository.php may be changed to utilize that table and query something like ipc_hex BETWEEN <start> AND <end> to fetch range contribs on each wiki.

We might as well make the whole suite support CIDR ranges.

Event Timeline

WhitePhosphorus changed the subtype of this task from "Task" to "Feature Request".Apr 2 2021, 5:26 AM

I wanted to implement this like 2+ years ago, but meta:IP Editing: Privacy Enhancement and Abuse Mitigation questioned whether it would be worth the while. Yet, here we still are with no clear path forward on that project. If time allows, I might just give this a go, as a steward myself I certainly could use it. But you sound like you have an engineering background, so should you feel inclined to help it would be most appreciated! :) I suspect it's a bit more complicated than you explain it, however. The first thing it does is check the actor table on each wiki so that we know which wikis the IP actually has edits on. That won't work for IP ranges. Also methods in the User class may need to be updated.

Hi @MusikAnimal, thanks for the quick reply. I would like to help and was wondering if there are any existing test environments on Toolforge (or maybe docker image?) available for development purposes like this, or shall I create a new tool and set up the environment following the doc? Thanks :)

Hi @MusikAnimal, thanks for the quick reply. I would like to help and was wondering if there are any existing test environments on Toolforge (or maybe docker image?) available for development purposes like this, or shall I create a new tool and set up the environment following the doc? Thanks :)

We're actually in the middle of migrating the docs to mediawiki.org (T276867). The current docs at https://xtools.readthedocs.io are largely out of date, and have too much focus on supporting non-Wikimedia installations which is something we're phasing out.

We do have a test installation at https://xtools-dev.toolforge.org, but I unfortunately don't know that if I can give you access... That wouldn't be a good way to develop anyway.

A Docker image has long been on my to-do list. Admittedly I am not-so-great at setting them up, with a few past failed attempts... but I will definitely give this another try! Let me get back to you :) In the meantime, if you are feeling brave, https://xtools.readthedocs.io/en/stable/development.html is the guide you'd want to go by for a local installation, but note the docs on the configuration parameters are for sure out of date. It may be easiest for me to walk you through that over IRC or something (freenode channel #wikimedia-xtools), if you're up for it. Otherwise just hold off while I figure out this Docker thing ;) Thanks for your interest in contributing!

@WhitePhosphorus I was unsuccessful at creating a Docker container. I will need to seek assistance from someone more familiar with Docker. I've filed T280734.

I did however finish migrating the relevant docs to medaiwki.org. If you are experienced with PHP and have the right set of dependencies on your local machine (namely PHP 7.2+), then this guide should help get you up and running: https://www.mediawiki.org/wiki/XTools/Development. Again let me know if you need any help! See contact venues at https://www.mediawiki.org/wiki/XTools/Development#Additional_help

Starting preliminary work on this.

MusikAnimal renamed this task from Support global contributions of IP ranges to Support IP ranges in XTools.May 19 2021, 4:38 AM
MusikAnimal triaged this task as High priority.
MusikAnimal updated the task description. (Show Details)
MusikAnimal closed this task as Resolved.EditedMay 25 2021, 8:03 PM

Example: https://xtools.wmflabs.org/globalcontribs/ipr-2603:8001:400:2:563:B92:AF2F:AFED/64

All tools except Pages Created support IP ranges. Same CIDR limits as the wiki (/18 for IPv4, /32 for IPv6).

Same CIDR limits as the wiki (/18 for IPv4, /32 for IPv6).

I was pretty sure the MediaWiki limit for IPv4 is /16. This is also what https://meta.wikimedia.org/wiki/Special:Contributions/0.0.0.0/0 suggests: "The requested IP range is larger than the CIDR limit of /16."

Edit: Oh, I see, XTools seems to support /17 and /16 ranges after all. Looks like that was a typo then.