Jump to content

Extension:CheckUser(用户查核)

本頁使用了標題或全文手工轉換
From mediawiki.org
This page is a translated version of the page Extension:CheckUser and the translation is 81% complete.
本页面是关于扩展本身的安装。 關於維基媒體基金會的用户查核政策,請參見用户查核方针。 关于如何使用此扩展,详见Help:Extension:CheckUser(用户查核)
MediaWiki扩展手册
CheckUser
发行状态: 稳定版
实现 特殊页面 , 用户身份 , API , 函数钩 , 数据库
描述
CheckUser功能可以讓拥有权限的用户可以去查核所给定的用户名使用了哪些IP地址和给定的IP使用了哪些用户名,而无须直接手动在数据库中运行查询。
作者 Tim Starling, Aaron Schulz, Dreamy Jazz
最新版本 2.5 (持續更新)
兼容性政策 快照跟随MediaWiki发布。 master分支不向后兼容。
PHP 7.4.3+
数据库更改
虚拟域 virtual-checkuser-global
cu_changes
cu_log_event
cu_private_event
cu_log
cu_useragent_clienthints
cu_useragent_clienthints_map
cu_useragent
cuci_wiki_map
cuci_temp_edit
cuci_user
cusi_case
cusi_signal
cusi_user
许可协议 GNU通用公眾授權條款2.0或更新版本
下載
帮助 Help:Extension:CheckUser/zh
  • $wgCheckUserGBtoollink
  • $wgCheckUserCAMultiLock
  • $wgCheckUserClientHintsEnabled
  • $wgCheckUserUserInfoCardCentralWikiId
  • $wgCheckUserLogLogins
  • $wgCheckUserDeveloperMode
  • $wgCheckUserCollapseCheckUserHelperByDefault
  • $wgCheckUserMaxBlocks
  • $wgCheckUserGlobalContributionsSkippedWikiIds
  • $wgCheckUserSuggestedInvestigationsHidden
  • $wgCheckUserClientHintsValuesToHide
  • $wgCheckUserAlwaysSetClientHintHeaders
  • $wgCheckUserAutoRevealMaximumExpiry
  • $wgCheckUserUserAgentTableMigrationStage
  • $wgCheckUserClientHintsSpecialPages
  • $wgCheckUserLogSuccessfulBotLogins
  • $wgCheckUserClientHintsUnsetHeaderWhenPossible
  • $wgCheckUserEnableUserInfoCardInstrumentation
  • $wgCheckUserUserInfoCardShowXToolsLink
  • $wgCheckUserSuggestedInvestigationsUseGlobalContributionsLink
  • $wgCheckUserClientHintsRestApiMaxTimeLag
  • $wgCheckUserSpecialPagesWithoutIPRevealButtons
  • $wgCheckUserSuggestedInvestigationsEnabled
  • $wgCheckUserCentralIndexRangesToExclude
  • $wgCheckUserLogMaxRangeToShowInLog
  • $wgCheckUserCIDRLimit
  • $wgCheckUserMaximumIPsToAutoblock
  • $wgCheckUserUserInfoCardFeatureVisible
  • $wgCheckUserDisableCheckUserAPI
  • $wgCheckUserGlobalContributionsCentralWikiId
  • $wgCheckUserForceSummary
  • $wgCheckUserInvestigateMaximumRowCount
  • $wgCheckUserCuciUserRandomChanceDebounceCutoff
  • $wgCheckUserWriteToCentralIndex
  • $wgCheckUserCAtoollink
  • $wgCheckUserCentralIndexGroupsToExclude
  • $wgCUDMaxAge
  • $wgCheckUserMaximumRowCount
  • $wgCheckUserTemporaryAccountMaxAge
  • $wgCheckUserClientHintsForDisplay
  • $wgCheckUserClientHintsHeaders

  • checkuser
  • checkuser-log
  • checkuser-temporary-account
  • checkuser-temporary-account-auto-reveal
  • checkuser-temporary-account-log
  • checkuser-temporary-account-no-preference
  • investigate
前往translatewiki.net翻譯CheckUser扩展
問題 开启的任务 · 报告错误

CheckUser此擴充功能可讓具備checkuser權限的使用者,無需手動直接查詢資料庫,即可查驗特定使用者名稱所使用的 IP地址,以及特定IP所對應的使用者名稱。 這個扩展目前正在所有維基媒體的維基上運作。

更新将根据维基媒体基金会的wiki的需要进行,或在发现关键漏洞时进行。 如何使用此扩展提供工具的详情請參閱Help:Extension:CheckUser(用户查核)

安装

此扩展随附于MediaWiki 1.44及更新版本,因此您無需下載它。 但其余的配置的指示仍须依循執行。
  • 下载文件,并解压CheckUser文件夹到extensions/目录中。
    开发者和代码贡献人员应改从Git安装此扩展,输入:
    cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/CheckUser
    
  • 只有是從Git安裝的才需运行Composer来安装PHP依赖,通过发行composer install --no-dev至扩展的目录。 (参见T173141了解潜在问题。)
  • 請新增下列代码到您的LocalSettings.php 文件的底部:
    wfLoadExtension( 'CheckUser' );
    
  • 請运行更新脚本,它将自动创建此扩展所必须的数据库表。
  • 按需求配置。
  • Yes 完成 – 請导航至您的wiki上的Special:Version,以验证此扩展已成功安装。

使用MediaWiki-Docker

可按照MediaWiki-Docker/Extension/CheckUser 中的步骤,将此扩展安装在MediaWiki Docker实例中。

配置

这个工具可将最近的更改数据复制到单独的表格中,并在添加新条目时进行添加。 如果将$wgPutIPinRC 设置为false,复制的数据将不包含相关的IP地址。 然而,安装此扩展以后添加的项目会包含IP地址。

安装此扩展后,您可以减少$wgRCMaxAge 以缩短最近更改的时间,而不会影响查核用户。 使用$wgCUDMaxAge设置checkuser的查询日期,以秒为单位。

特定于查核用户的设置$wgCheckUserCIDRLimit决定了单次检查中可检查的最大范围。 他的格式与$wgBlockCIDRLimit 设置相同。 IPv6查核的默认限额为/19,IPv4查核的默认限额为/16

要运行此工具记录成功和失败的登录和登出尝试,请将$wgCheckUserLogLogins设为true。 如果您的wiki上有机器人账号,将$wgCheckUserLogSuccessfulBotLogins设为false可跳过将成功登录尝试记录到机器人账号上的操作。

MediaWiki版本:
1.43

若此擴充套件安裝於多個維基的環境中,則應將$wgVirtualDomainsMapping 設定為virtual-checkuser-global,使其指向中央資料庫的表格。 設定此選項將確保中央索引表確實位於中央資料庫中,從而使GlobalBlocking 全局自動封鎖與GUC設定生效。 完成此步驟後,您需要執行update.php指令以在中央維基上建立資料表。

MediaWiki版本:
1.45

在1.45版之後,CheckUser API預設會被停用。 若要啟用此功能,請將 $wgCheckUserDisableCheckUserAPI 設定為 false

Special:GlobalContributions功能故障排除

如果Special:GlobalContributions没有按预期返回修订版本(例如在另一个wiki上有修订版本且可以在该wiki上查看),则可能是错误的配置导致了内部故障,该故障不会对用户可见(因为用户无法解决)。 请检查下列事项:

  • 用户有中央账号,并且其在受影响wiki上的账号已关联。可以在Special:MergeAccount上检查。
  • 受影响的wiki设于wiki农场。 此在sites表中定义,可通过addSite维护脚本将wiki添加到此表中。 您需要确保填写可选参数pagepathfilepath,例如: php ./maintenance/run.php addSite globalId groupName --pagepath https://hostname/wiki/\$1 --filepath https://hostname/w/\$1 Special:GlobalContributions用此生成API查询和链接。
  • 中央数据库已设置virtual-checkuser-global(如$wgVirtualDomainsMapping['virtual-checkuser-global'] = [ 'db' => $wiki ];),且cuci_temp_edit表记录受影响 wiki 的修订。
  • 如有必要,应启用跨域cookie,因为centralauth令牌必须在两个wiki中都能正常工作。

授权权限以使用用户查核

要授予Special:CheckUserSpecial:InvestigateSpecial:CheckUserLog的使用权,用户权限管理用户必须访问Special:UserRights,在框中输入用户名,然后选择 「checkuser」选项。 完成此操作后,上述特殊页面将显示在该用户的Special:SpecialPages页面中。

要允许用户访问临时账号 的IP地址,他们应该要被授予checkuser-temporary-account权限。

要赋予系统管理员该扩展的所有权限,请在LocalSettings.php中输入以下内容:

$wgGroupPermissions['sysop']['checkuser'] = true;
$wgGroupPermissions['sysop']['checkuser-log'] = true;
$wgGroupPermissions['sysop']['investigate'] = true;
$wgGroupPermissions['sysop']['checkuser-temporary-account-log'] = true;
$wgGroupPermissions['sysop']['checkuser-temporary-account-no-preference'] = true;

要仅允许添加和删除checkuser权限,请使用以下代码:

$wgAddGroups['sysop'][] = 'checkuser';
$wgRemoveGroups['sysop'][] = 'checkuser';

更新

MediaWiki版本:
1.45

自MediaWiki 1.45起,GuidedTour从Special:Investigate中移除,故首选项checkuser-investigate-tour-seencheckuser-investigate-form-tour-seen不再使用。 如果在升级到1.45前使用过Special:Investigate,则对于某些用户来说,这些首选项可能会被不必要地存储。 要从user_properties表中移除这些偏好设置,请运行维护脚本:

$ php maintenance/run.php userOptions.php checkuser-investigate-tour-seen --delete
$ php maintenance/run.php userOptions.php checkuser-investigate-form-tour-seen --delete

配置

以下列出部分配置值。 这些配置值可供维基管理员修改。 为了保持列表简洁,此处未列出通常保留默认值的配置值,但这些配置值的详细信息可在extension.json文件中找到。

extension.json中的部分配置设置
配置名称 默认值 详情
$wgCUDMaxAge 7776000 (90 days) 保留多久用户查核日志(以秒为单位)
$wgCheckUserMaxBlocks 200 Special:Investigate中可被同时批量封禁的最大用户数
$wgCheckUserForceSummary false 如果要强制用户查核员通过Special:CheckUser为每个检查提供原因,请将此设置为true。 (不是很有用,因为用户查核员可以简单地给出一个摘要,例如“他们需要被检查”或“我想要檢查”并且软件不会知道是否合理。)
$wgCheckUserCIDRLimit [ 'IPv4' => 16, 'IPv6' => 19 ] 可以在任何单独范围检查中检查的最短CIDR限制
$wgCUPublicKey '' 用于加密私人数据的公共密钥,以后可能需要读取。 使用以下命令產生公開密鑰:

openssl genrsa -out cu.key 2048; openssl rsa -in cu.key -pubout > cu.pub 并在此处粘贴cu.pub的内容

与关联的私钥一起使用,用于加密某些不会向用户查核员显示但存储在cu_changes或cu_private_event表中的数据。 目前仅限于邮件收件人。 如果没有有效的公钥,数据将不会存储。

$wgCheckUserCAMultiLock false 这可用于通过中央认证向Special:CheckUser的查核结果表单表单添加Special:MultiLock的链接。 这需要在wiki上安装CentralAuth(中央认证) 扩展。 要启用此功能,请将其设置为一个数组,其中包含中央wiki的数据库名称和一个数组,其中包含要为其添加链接的全域用户组的名称。 例如:
$wgCheckUserCAMultiLock = [
    'centralDB' => 'metawiki',
    'groups' => [ 'steward' ]
];
$wgCheckUserCAtoollink false 77360f1cf1d2起。 这会将指向中央wiki的Special:CentralAuth链接添加到Special:CheckUser的“获取用户”结果中。 这需要在wiki上安装CentralAuth(中央认证) 扩展。 要启用此功能,请将其设置为中央wiki数据库名称。 例如:
$wgCheckUserCAtoollink = 'metawiki';
$wgCheckUserGBtoollink false 77360f1cf1d2起。 这会将指向本地或中央wiki的Special:GlobalBlock链接添加到Special:CheckUser的“获取用户”结果中。 这需要在wiki上安装全域封禁 扩展。 要启用此功能,如果配置了$wgConf ,请将其设置为一个数组,其中包含中央wiki的数据库名称和一个数组,其中包含要添加链接的本地(或全局,如果您安装了CentralAuth(中央认证) )组的名称。 例如:
$wgCheckUserGBtoollink = [
	'centralDB' => 'metawiki',
	'groups' => [ 'steward', 'staff' ]
];
$wgCheckUserEnableSpecialInvestigate (1.35-1.43) false (<=1.39)
true (1.40+)
57dcfe46d2e4起。 启用Special:Investigate(Special:CheckUser的升级版),允许在一次调查中检查多个用户账号和IP地址。
$wgCheckUserLogLogins false CheckUser是否应该记录登录和注销尝试(包括成功和失败)。
$wgCheckUserLogSuccessfulBotLogins true 如果$wgCheckUserLogLogins设置为true,CheckUser是否应该存储对机器人用户组账号的成功登录尝试。 仅在$wgCheckUserLogLogins为true时使用。
$wgCheckUserMaximumRowCount 5000 Special:CheckUser可以返回的最多结果数。 Before MediaWiki 1.39, in the 'Get edits' and 'Get IPs' results having over 5,000 results would return the results in a different format. From MediaWiki 1.39 this is the maximum number of results to show by page and more can be generated using the paging links
$wgCheckUserInvestigateMaximumRowCount 25000 类似于$wgCheckUserMaximumRowCount,但适用于Special:Investigate
$wgCheckUserCollapseCheckUserHelperByDefault (1.41+) 2500 Controls when the "CheckUser helper" summary table on Special:CheckUser should be collapsed. Specify true to always collapse by default, false to never collapse by default, and a number to collapse when more than that number of results are displayed on the page.
$wgCheckUserMaximumIPsToAutoblock (1.43+) 1 The maximum number of IP addresses to retroactively autoblock when a block is created with autoblocking enabled.
$wgCheckUserClientHintsEnabled (1.41+) true Used to control whether client hints should be collected and displayed in results by CheckUser.
$wgCheckUserClientHintsSpecialPages (1.41+) { "CreateAccount": "header", "Emailuser": "js", "PasswordReset": "js", "Userlogin": [ "js", "header" ], "Userlogout": "header"} The list of special pages where CheckUser will request client hints if $wgCheckUserClientHintsEnabled is true.
$wgCheckUserClientHintsHeaders (1.41+) { "Sec-CH-UA": "brands", "Sec-CH-UA-Arch": "architecture", "Sec-CH-UA-Bitness": "bitness", "Sec-CH-UA-Form-Factor": "", "Sec-CH-UA-Full-Version-List": "fullVersionList", "Sec-CH-UA-Mobile": "mobile", "Sec-CH-UA-Model": "model", "Sec-CH-UA-Platform": "platform", "Sec-CH-UA-Platform-Version": "platformVersion", "Sec-CH-UA-WoW64": ""} The list of client hint types that will be requested. Keys represent the client hint values requested using the Accept-CH header. Values represent the equivalent name when requesting them from the JS client side client hints API.
$wgCheckUserClientHintsForDisplay (1.41+) [ "model", "fullVersionList", "platformVersion", "platform", "brands", "formFactor", "architecture", "mobile", "bitness", "woW64" ] The list of Client Hints data to display in CheckUser results. The order of the array is used to determine what order to display the data.
$wgCheckUserClientHintsValuesToHide (1.41+) { "architecture": [ "x86" ], "bitness": [ "64" ], "woW64": [ false ]} Specifies Client Hint data values which should be hidden in the CheckUser results. This is done to hide commonly seen Client Hint data values in the cases where it's not useful to see this information unless it's a rare value.
$wgCheckUserTemporaryAccountMaxAge (1.40+) 86400 The number of seconds for which the temporary account API response is fresh.
$wgCheckUserSpecialPagesWithoutIPRevealButtons (1.40+) [ "Investigate", "InvestigateBlock", "CheckUser", "CheckUserLog", "Activeusers", "Listusers", "BlockList" ] A list of special page names where "Show IP" buttons are disabled, because they are not useful. The special page names are case sensitive and do not always match their appearance in the URL. For example Special:ListUsers is called Listusers in this array.
$wgCheckUserClientHintsUnsetHeaderWhenPossible (1.41+) true If true, the server will send an empty Accept-CH header when the user is viewing a page which does not need client hints data.
$wgCheckUserGlobalContributionsCentralWikiId (1.44+) null A string representing the name of the wiki to designate as the "central" wiki for Special:GlobalContributions. Setting this will redirect all other wiki's Special:GlobalContributions page to the central wiki's instead.
$wgCheckUserWriteToCentralIndex (1.43+) true Used to prevent adding entries to the CheckUser central index tables on the wiki. Use this when the wiki is not part of a larger wiki farm unified account system.
$wgCheckUserCentralIndexGroupsToExclude (1.43+) [ "bot" ] Users in any of the groups specified in this configuration value will not have their actions stored in the central index tables. Used to reduce the rate of writes to the central index tables for high activity users where there is no need to run CheckUser checks on these users. Users in these group are still checkable and have their IP and user agent logged.

API

下方章节。

使用CheckUser扩展

如何使用此扩展的细节可在Help:Extension:CheckUser(用户查核) 查看。 为了保持本页面篇幅适中,并将本页面重点放在扩展程序的安装和管理上,此处未包含此信息。

有一些特殊页面和API由本扩展提供。 特殊页面有:

此扩展还提供显示临时账号使用过的IP的功能。 在Help:Extension:CheckUser(用户查核) 中有描述。