Jump to content

擴充功能:StopForumSpam

From mediawiki.org
This page is a translated version of the page Extension:StopForumSpam and the translation is 41% complete.
MediaWiki扩展手册
StopForumSpam
发行状态: 稳定版
实现 页面操作
描述 使用stopforumspam.com防止垃圾内容
作者
最新版本 0.4.0
MediaWiki >= 1.46
许可协议 GNU通用公眾授權條款2.0或更新版本
下載
  • $wgSFSValidateIPListLocationMD5
  • $wgSFSDenyListCacheDuration
  • $wgSFSProxy
  • $wgSFSIPListLocation
  • $wgSFSReportOnly
  • $wgSFSIPThreshold
  • sfsblock-bypass
前往translatewiki.net翻譯StopForumSpam扩展
問題 开启的任务 · 报告错误

StopForumSpam擴充功能允許維基農場利用和貢獻資料至stopforumspam.com. 它具有自動封鎖IP功能和一個簡單的介面給管理員提交資料。

安裝

  • 下载文件,并解压StopForumSpam文件夹到extensions/目录中。
    开发者和代码贡献人员应改从Git安装此扩展,输入:
    cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/StopForumSpam
    
  • 請新增下列代码到您的LocalSettings.php 文件的底部:
    wfLoadExtension( 'StopForumSpam' );
    
  • Configure as required.
  • Yes 完成 – 請导航至您的wiki上的Special:Version,以验证此扩展已成功安装。

配置

  • $wgSFSReportOnly - Enables a mode where users are not blocked from non-read actions after tripping the deny list.
  • $wgSFSIPListLocation - Location of an IP address deny list.
  • $wgSFSValidateIPListLocationMD5 - Location of the MD5 sum file to be used to validate $wgSFSIPListLocation.
  • $wgSFSIPThreshold - 一組IP位置要被封鎖所需要的最少回報次數。
  • $wgSFSDenyListCacheDuration - Cache duration for the deny list in seconds. Adjust as required.
  • $wgSFSProxy - HTTP proxy to be used for outbound requests to download IP lists.

重要提醒

Use of the IP deny list requires that you use some kind of object caching. 如果您將$wgMainCacheType 設為CACHE_NONE的話,它將不會產生作用。 If neither APC or Memcached is an option, the simplest approach is to fallback to storing the object cache in your MySQL database. The following preset (in LocalSettings.php) will do that: $wgMainCacheType = CACHE_DB;

用户权限

  • sfsblock-bypass - allows users to bypass deny-listed IP blocks

Logging

To log reports about who StopForumSpam is exempting and blocking, you can enable the "StopForumSpam" channel in your structured logging configuration. All reports for the extension are logged at a level of INFO. If you do not have structured logging configured, you can log to a file by configuring $wgDebugLogGroups in your LocalSettings.php, like so:

$wgDebugLogGroups['StopForumSpam'] = '/var/log/mediawiki/stopforumspam.log';

This will write the log to a file located in /var/log/mediawiki/stopforumspam.log. MediaWiki will need access to write to this log file and the file should not be accessible via the web as it will contain private details of your users (such as usernames, page names, and IP addresses).

The simple logging using $wgDebugLogGroups will omit details compared to using a structured logging solution such as monolog .

AbuseFilter integration

當使用AbuseFilter(滥用过滤器) 時,一個被命名為「sfs_blocked」的變數會被加入。 這個值會是false如果一位使用者不是垃圾訊息發送者,並且會是true如果他是的話。

IP封禁

你可以下載IP封鎖列表,並使用maintenance/updateDenyList.php的程式碼匯入它們。 StopForumSpam has several lists; we recommend using the "listed_ip_30_all" list. Once you choose the list you want, download and extract it to somewhere on your server, then point $wgSFSIPListLocation in the LocalSettings.php file at it. We recommend setting up a nightly cron job to download and extract new versions of the list and subsequently running the updateDenyList maintenance script.

If that IP tries to edit, or a user tries to edit through that IP address, they will be prevented from editing. 如果要使一位使用者繞過封鎖,請授予他sfsblock-bypass權限。