Jump to content

Extension:GlobalBlocking

From mediawiki.org
This page is a translated version of the page Extension:GlobalBlocking and the translation is 14% complete.
MediaWiki 拡張機能マニュアル
GlobalBlocking
リリースの状態: 安定
実装 特別ページ , 利用者識別 , API , データベース
説明 Allows IP addresses and accounts to be blocked on multiple wikis
作者 Andrew Garrett, Trust and Safety Product Team, Dreamy Jazz
互換性の方針 MediaWiki とともにリリースされるスナップショット。 master には後方互換性がありません。
MediaWiki 1.39 and later
データベースの変更 はい
Virtual domain virtual-globalblocking
テーブル globalblocks
global_block_whitelist
ライセンス GNU 一般公衆利用許諾書 2.0 以降
ダウンロード
  • $wgApplyGlobalBlocks
  • $wgGlobalBlockingBlockXFF
  • $wgGlobalBlockingCentralWiki
  • $wgGlobalBlockRemoteReasonUrl
  • $wgGlobalBlockingAllowedRanges
  • $wgGlobalBlockingCIDRLimit
  • globalblock
  • globalblock-whitelist
  • globalblock-exempt
四半期ごとのダウンロード数 77 (Ranked 69th)
使用中の公開ウィキ 1,015 (Ranked 250th)
translatewiki.net で翻訳を利用できる場合は、GlobalBlocking 拡張機能の翻訳にご協力ください
Vagrant role globalblocking
問題点 未解決のタスク · バグを報告

The GlobalBlocking extension allows a user with the appropriate permissions to block an IP address or IP address range (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.

インストール

  • ダウンロードして、ファイルをextensions/フォルダー内のGlobalBlockingという名前のディレクトリ内に配置します。
    開発者とコード寄稿者は、上記の代わりに以下を使用してGitからインストールします:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/GlobalBlocking
  • 以下のコードを LocalSettings.php ファイルの末尾に追加します:
    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 named centralauth.
  • 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'; (replacing globalblocking 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'; where dbname is replaced with the name of the database you created in the steps above. If you called your database globalblocking then you can skip this step.
  • 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 in tables-generated-global_block_whitelist.sql to them.
  • Yes 完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。

設定

$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 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 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.
$wgGlobalBlockingDatabase
MediaWiki バージョン:
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.

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.

使用法

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:

  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 (by default /16, and also /16 hardcoded before that variable was introduced), or any IPv6 address or range up to $wgGlobalBlockingCIDRLimit (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.

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.

関連項目