Extension:GlobalBlocking - MediaWiki (original) (raw)

MediaWiki extensions manual

GlobalBlocking Release status: stable
Implementation Special page , User identity , API , Database
Description Allows IP addresses and accounts to be blocked on multiple wikis
Author(s) Andrew Garrett, Trust and Safety Product Team, Dreamy Jazz
Compatibility policy Snapshots releases along with MediaWiki. Master is not backward compatible.
Database changes Yes
Virtual domain virtual-globalblocking
Tables globalblocks global_block_whitelist
Parameters wgGlobalBlockingAutoblockExemptionswgGlobalBlockingAutoblockExemptions wgGlobalBlockingAutoblockExemptionswgGlobalBlockRemoteReasonUrl wgGlobalBlockingMassGlobalBlockMaxTargetswgGlobalBlockingMassGlobalBlockMaxTargets wgGlobalBlockingMassGlobalBlockMaxTargetswgGlobalBlockingAllowedRanges wgGlobalBlockingBlockXFFwgGlobalBlockingBlockXFF wgGlobalBlockingBlockXFFwgGlobalBlockingMaximumIPsToRetroactivelyAutoblock wgGlobalBlockingAutoblockExpirywgGlobalBlockingAutoblockExpiry wgGlobalBlockingAutoblockExpirywgApplyGlobalBlocks wgGlobalBlockingCentralWikiContentLanguagewgGlobalBlockingCentralWikiContentLanguage wgGlobalBlockingCentralWikiContentLanguagewgGlobalBlockingCentralWiki $wgGlobalBlockingCIDRLimit
Added rights globalblock globalblock-whitelist globalblock-exempt
Hooks used CentralAuthInfoFields ContributionsToolLinks GetBlockErrorMessageKey GetLogTypesOnUser GetUserBlock LoadExtensionSchemaUpdates OtherBlockLogLink SpecialContributionsBeforeMainOutput SpreadAnyEditBlock UserMergeAccountFields
Hooks provided GlobalBlockingGetRetroactiveAutoblockIPs GlobalBlockingGlobalBlockAudit
Licence GNU General Public License 2.0 or later
Download Download extension Git [?]: Browse repository (GitHub) Gerrit code review Git commit log Download source tarball
Translate the GlobalBlocking extension if it is available at translatewiki.net
Vagrant role globalblocking
Issues Open tasks · Report a bug

The GlobalBlocking extension allows a user with the appropriate permissions to block an IP address, IP address range, or an account (but not accounts before MediaWiki 1.43) on all wikis in a group sharing the same globalblocking database. It is intended to be used for combating severe cross-wiki vandalism and spam.

Config variable Description
$wgApplyGlobalBlocks Whether to respect global blocks on this wiki. This is used so that global blocks can be set on one wiki, but not actually applied there (i.e. so people can contest them on that wiki).
wgGlobalBlockingBlockXFF∣TheflagwgGlobalBlockingBlockXFF The flag wgGlobalBlockingBlockXFFTheflagwgGlobalBlockingBlockXFF, set to true by default, causes blocks to apply to all of the IP addresses in the X-Forwarded-For (XFF) header. Set this flag to false to disable this feature. For more details, see T25343.
wgGlobalBlockingCIDRLimit∣Largestglobalrangeblocksallowed,setbyCIDRprefix.Theformatisthesameas[wgGlobalBlockingCIDRLimit Largest global rangeblocks allowed, set by CIDR prefix. The format is the same as [wgGlobalBlockingCIDRLimitLargestglobalrangeblocksallowed,setbyCIDRprefix.TheformatisthesameaswgBlockCIDRLimit and the default values are /16 for IPv4 and /19 for IPv6, as with $wgBlockCIDRLimit.
$wgGlobalBlockingDatabase MediaWiki version: ≤ 1.41 The name of the database used to store the globalblocks table. This table is on a different database because only one table is used for all wikis in a wiki farm.
$wgGlobalBlockRemoteReasonUrl Full path to api.php to use to expand templates in block reasons.
$wgGlobalBlockingAllowedRanges A list of ranges or IP addresses which are exempted from all global blocks which target the ranges or IP addresses. This exemption does not apply to global account blocks (even if the user is on an exempt range or IP address).
$wgGlobalBlockingCentralWiki The ID of the central wiki where global blocks are performed. Used to provide a link to the global block log which is likely to have entries, instead of the local log which is unlikely to contain entries. If the value is false, then the local log is used.
$wgGlobalBlockingMaximumIPsToRetroactivelyAutoblock MediaWiki version: ≥ 1.43 The maximum number of IP addresses that can be retroactively autoblocked when a user is globally blocked and global autoblocking has been enabled for the global block.
$wgGlobalBlockingMassGlobalBlockMaxTargets MediaWiki version: ≥ 1.44 The maximum number of targets that can be globally blocked or unblocked in one use of Special:MassGlobalBlock.

Two API modules are provided, one to (un)block users, and another to view existing global blocks. They are documented at Extension:GlobalBlocking/API.

Globally (un)blocking

[edit]

The following requires appropriate permissions, assigned by default to stewards, which by default can be added or removed by bureaucrats.

GlobalBlock

To make a global block:

  1. Go to Special:GlobalBlock.
  2. Enter the target you want to block. This can be an account post MediaWiki 1.43, an IPv4 address or range up to wgGlobalBlockingCIDRLimit(bydefault/16,andalso/16hardcodedbeforethatvariablewasintroduced),oranyIPv6addressorrangeuptowgGlobalBlockingCIDRLimit (by default /16, and also /16 hardcoded before that variable was introduced), or any IPv6 address or range up to wgGlobalBlockingCIDRLimit(bydefault/16,andalso/16hardcodedbeforethatvariablewasintroduced),oranyIPv6addressorrangeuptowgGlobalBlockingCIDRLimit (by default /19; /4 before that variable was introduced).
  3. You may decide you want to only block anonymous users, which can only be done for blocks on IPv4 or IPv6 addresses. To only block anonymous users, check the checkbox.
  4. Submit the form. The target of the block is now globally blocked on your wikis that opt in to the global blocking. Account creation is blocked (even if you selected "anonymous users only": phab:T42190), and the blocked user cannot edit any associated user talk pages on any wiki affected and opted in to the global block. If Extension:AbuseFilter is installed, globally blocked IP addresses are prohibited from viewing the abuse log if the particular wiki is opted in to the block.

GlobalUnblock

To remove a global block:

  1. Go to Special:GlobalUnblock and click "Remove a global block".
  2. Enter the target of the block you want to remove and the reason, and submit the form. The account, IP address, or IP range will no longer be globally blocked.

MassGlobalBlock

MediaWiki version: ≥ 1.44

You can remove, modify, and create global blocks using Special:MassGlobalBlock for many targets at once. The first step of this form is to lookup the global block status of a list of targets provided in an input. Then you can use the form to globally block or globally unblock, with the relevant parameters applied to each target.

Administrators can disable the global block on the wiki where they have administrator rights. This is done through using the Special:GlobalBlockStatus page.

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.