Extension:GlobalBlocking
From Linux Web Expert
GlobalBlocking Release status: beta |
|
---|---|
File:Global block interface (2021-04-29).png | |
Implementation | Special page , User identity , API |
Description | Allows IP addresses to be blocked on multiple wikis |
Author(s) | Andrew Garrett (Werdnatalk) |
MediaWiki | 1.13-alpha and later |
Database changes | Yes |
Tables | globalblocks global_block_whitelist |
License | GNU General Public License 2.0 or later |
Download | |
|
|
|
|
Quarterly downloads | Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin'). |
Public wikis using | Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin'). |
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 or IP address range (but not accounts) 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.
Installation
- <translate> [[<tvar name=2>Special:ExtensionDistributor/GlobalBlocking</tvar>|Download]] and move the extracted <tvar name=name>
GlobalBlocking
</tvar> folder to your <tvar name=ext>extensions/
</tvar> directory.</translate>
<translate> Developers and code contributors should install the extension [[<tvar name=git>Special:MyLanguage/Download from Git</tvar>|from Git]] instead, using:</translate>cd extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/GlobalBlocking - <translate> Add the following code at the bottom of your <tvar name=1>LocalSettings.php </tvar> file:</translate>
wfLoadExtension( 'GlobalBlocking' );
- You will also need to create a dedicated database for this extension to work. At a minimum (all wikis running on the same host), you need to create a local database for the global tables. Usually this database is named
globalblocking
, but you can choose a different name. For example, on WMF wikis this table is on a database namedcentralauth
. - Grant all database users that your wikis run as full permissions on the database created in the above step (at a minimum,
SELECT, UPDATE, INSERT, DELETE
). - Do either of the following depending on the version of MediaWiki you are running:
- If you run MediaWiki 1.42 or above, define the configuration
$wgDatabaseVirtualDomains['virtual-globalblocking'] = 'globalblocking';
(replacingglobalblocking
with the name of the database created in the steps above). See Manual:$wgVirtualDomainsMapping for more detail on how this configuration value works. - If you run MediaWiki 1.41 or below, define the configuration
$wgGlobalBlockingDatabase = 'dbname';
wheredbname
is replaced with the name of the database you created in the steps above. If you called your databaseglobalblocking
then you can skip this step.
- If you run MediaWiki 1.42 or above, define the configuration
- After creating the database, you should import the SQL from
tables-generated-globalblocks.sql
into the global blocking database. - You also need to run
update.php
on each of your local databases, or otherwise import the SQL schema intables-generated-global_block_whitelist.sql
to them. - File:OOjs UI icon check-constructive.svg <translate> Done</translate> – <translate> Navigate to <tvar name=special>Special:Version</tvar> on your wiki to verify that the extension is successfully installed.</translate>
Configuration
- $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
- The flag
$wgGlobalBlockingBlockXFF
, set totrue
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 <translate> task <tvar name=1>T25343</tvar></translate>. - $wgGlobalBlockingCIDRLimit
- Largest global rangeblocks allowed, set by CIDR prefix. The format is the same as $wgBlockCIDRLimit and the default values are /16 for IPv4 and /19 for IPv6, as with $wgBlockCIDRLimit.
<translate> ≤</translate> 1.41
<translate> MediaWiki version:</translate> |
- $wgGlobalBlockingDatabase
- 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.
API
Two API modules are provided, one to (un)block users, and another to view existing global blocks. They are documented at Extension:GlobalBlocking/API.
Usage
The following requires appropriate permissions, assigned by default to stewards, which by default can be added or removed by bureaucrats. To make a global block:
- Go to Special:GlobalBlock.
- Enter the IPv4 address or range up to $wgGlobalBlockingCIDRLimit (by default /16, and also /16 hardcoded before that variable was introduced) that you wish to block (or any IPv6 address or range up to $wgGlobalBlockingCIDRLimit (by default /19; /4 before that variable was introduced) if you made the schema changes prescribed in the installation instructions section of this page or you have the latest revision), and decide if you want to only block anonymous users. To only block anonymous users, check the checkbox.
- Submit the form. The IP address or range 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 IP or range 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.
To remove a global block:
- Go to Special:GlobalUnblock and click "Remove a global block".
- Enter the IP address or range to unblock and the reason, and submit the form. The IP address or range will no longer be globally blocked.
See also
- Combating spam
- Combating vandalism
- BulkBlock Extension — an extension that allows administrators to easily block multiple users at once on a MediaWiki website.
File:Wikimedia-logo black.svg | <translate> This {{<tvar name=1>#ifeq:Extension|Extension</tvar>|extension|skin}} is being used on one or more [[<tvar name=2>m:Special:MyLanguage/Wikimedia projects</tvar>|Wikimedia projects]].</translate> <translate> This probably means that the {{<tvar name=1>#ifeq:Extension|Extension</tvar>|extension|skin}} is stable and works well enough to be used by such high-traffic websites.</translate> <translate> Look for this {{<tvar name=1>#ifeq:Extension|Extension</tvar>|extension's|skin's}} name in Wikimedia's <tvar name=2>CommonSettings.php</tvar> and <tvar name=3>InitialiseSettings.php</tvar> configuration files to see where it's installed.</translate> <translate> A full list of the {{<tvar name=1>#ifeq:Extension|Extension</tvar>|extensions|skins}} installed on a particular wiki can be seen on the wiki's <tvar name=ver>Special:Version</tvar> page.</translate> |
Global block interface (2021-04-29).png |
Categories:
- Pages with script errors
- Pages with broken file links
- Beta status extensions
- Special page extensions
- User identity extensions
- API extensions
- Extensions without a compatibility policy
- Extensions with manual MediaWiki version
- GPL licensed extensions
- Extensions in Wikimedia version control
- ContributionsToolLinks extensions
- GetBlockErrorMessageKey extensions
- GetLogTypesOnUser extensions
- GetUserBlock extensions
- LoadExtensionSchemaUpdates extensions
- OtherBlockLogLink extensions
- SpecialContributionsBeforeMainOutput extensions
- SpecialPasswordResetOnSubmit extensions
- UserIsBlockedGlobally extensions
- UserMergeAccountFields extensions
- All extensions
- Extensions used on Wikimedia
- Extensions for data exchange with other local wikis