This is a web interface for Plagiabot's Copyright RC feed.
- Clone the repository and run
composer install
. - Edit the
.env
file that was created by composer.- Get Oauth tokens by registering a new consumer on Meta at Special:OAuthConsumerRegistration.
- To use Redis caching, also add
REDIS_HOST
andREDIS_PORT
; without these, a local filesystem cache will be used.
- Make the
cache/
directory writable by the web server. - Rewrite your routing, if needed.
For Lighttpd, use this in your.lighttpd.conf
:
url.rewrite-if-not-file += ( "(.*)" => "/copypatrol/index.php/$0" )
Or for Apache, this (in.htaccess
at the root of the project):
DirectorySlash Off RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^public_html(.*)$ public_html/index.php$1 [L]
- Open up an SSH tunnel to access the databases on Tool Labs (substitute your own username).
$ ssh -L 4711:enwiki.web.db.svc.eqiad.wmflabs:3306 -L 4712:tools-db:3306 YOU@tools-login.wmflabs.org -N
This application makes of use the Wikimedia-slimapp library and uses Twig as its templating engine.
- Add it to en.json
- Update the qqq.json documentation accordingly
- Call it in Twig as
{{ '<message-key>'|message }}
. If the message contains any HTML, you'll need to append the|raw
filter aftermessage
. - To use a translation message in JavaScript, add it as a global variable in
templates/base.html
. Then simply access it in the JS. - To get a message in PHP, use
$this->i18nContext->message( '<message-key>' )
To add a new language, follow these steps:
- Make sure the language is supported by iThenticate. This list is available at http://www.ithenticate.com/products/faqs. Look for the "Which international languages does iThenticate have content for in its database?" section.
- Make sure there is community consensus for CopyPatrol. This helps ensure they will regularly make use of CopyPatrol. EranBot, which powers the CopyPatrol feed, is expensive in terms of the resources it uses. Any languages that are not regularly being used should be removed.
- Make sure the corresponding
-wikipedia
message inpublic_html/i18n/en.json
(and qqq.json) exists and is translated in the desired language. - On Toolforge,
become community-tech-tools
, thenbecome eranbot
. Add the following to the crontab, replcaingenwiki
and-lang:en
accordingly:
*/10 * * * * jsub -N enwiki -mem 500m -l h_rt=4:05:00 -once -quiet -o /data/project/eranbot/outs python /data/project/eranbot/gitPlagiabot/plagiabot/plagiabot.py -lang:en -blacklist:User:EranBot/Copyright/Blacklist -live:on -reportlogger
- Monitor the
.err
file (i.e. enwiki.err) for output. If looks similar to the other .err files, you know it's running properly. Once a copyvio is found and stored in the database, the feed for the new language in CopyPatrol should show up within 7 days (due to caching).
- Remove the entry from
eranbot
's crontab. - Remove all relevant rows from the database. While logged in as eranbot, run:
sql local
MariaDB [(none)]> USE s51306__copyright_p;
MariaDB [s51306__copyright_p]> DELETE FROM copyright_diffs WHERE lang = 'xx'