Coder Social home page Coder Social logo

wikimedia / copypatrol Goto Github PK

View Code? Open in Web Editor NEW
13.0 13.0 11.0 7.34 MB

A tool that allows you to see recent Wikipedia edits that are flagged as possible copyright violations

Home Page: https://copypatrol.wmcloud.org

License: GNU General Public License v3.0

PHP 60.44% JavaScript 8.64% Less 6.31% Dockerfile 2.90% Twig 15.70% Shell 1.12% CSS 4.89%
copyright-violation-detection wikipedia

copypatrol's Introduction

CopyPatrol

A tool that allows you to see recent Wikipedia edits that are flagged as possible copyright violations.

Installing manually

Prerequisites

This application makes use of the Symfony framework and the ToolforgeBundle. A bot is used to continually query recent changes against the Turnitin Core API (TCA), record possible copyright violations in a user database, and CopyPatrol then reads from that database. Unless you need to work on the bot code, there's no reason to bother with bot integration, and instead connect to the existing user database on Toolforge (more on this below).

Instructions

  1. Copy .env to .env.local and fill in the appropriate details.
    1. Use the credentials in your replica.my.cnf file in the home directory of your Toolforge account for REPLICAS_USERNAME, REPLICAS_PASSWORD.
    2. Set the TROVE_* variables to that of the installation of the CopyPatrol database (COPYPATROL_DB_NAME).
    3. If you need to test OAuth, obtain tokens by registering a new consumer on Meta at Special:OAuthConsumerRegistration. Alternatively, you can set LOGGED_IN_USER to any value to simulate being that user after clicking on 'Login'.
    4. If you need to test the "iThenticate report" functionality, set TCA_DOMAIN and TCA_KEY. Reports older than AppController::ITHENTICATE_V2_TIMESTAMP need to connect to the older iThenticate API, using the credentials set by ITHENTICATE_USERNAME and ITHENTICATE_PASSWORD.
  2. Run composer install
  3. Open up an SSH tunnel to access the databases on Toolforge. This assumes you have left the REPLICAS_HOST_* and REPLICAS_PORT_* variables at their defaults.
    symfony console toolforge:ssh --trove=hxmnwriu2vm.svc.trove.eqiad1.wikimedia.cloud
    Review OpenStack browser for the current Trove host name if the above does not work.
  4. Start the Symfony web server with symfony serve
  5. Visit the URL provided by the Symfony CLI to access the application.

Asset changes

Assets are compiled using Webpack Encore. The compiled assets must be committed to the repository.

  • Run npm run dev to compile assets for development and watch for changes.
  • Run npm run build to compile assets for production.

Running tests

  • Run composer test to run the unit tests and PHP CodeSniffer.
  • Run npm test to run the linting tests for JavaScript and CSS.

Installing using Docker

A new Docker image needs to be created following the move to Wikimedia VPS. You can use the manual installation instructions above in the meantime.

Adding new languages

  1. Make sure the language is supported by iThenticate. This list is available at https://www.ithenticate.com/resources under the "General" section of the FAQ. Look for "Which international languages does iThenticate have content for in its database?".
  2. Make sure there is community consensus for CopyPatrol. This helps ensure they will regularly make use of CopyPatrol. The bot 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.
  3. Make sure the corresponding -wikipedia message in i18n/en.json (and qqq.json exists and is translated in the desired language.
  4. Update the .copypatrol.ini file in the bot repository and add the new languages to the APP_ENABLED_LANGS variable in .env.

Removing a language

  1. In .copypatrol.ini of the bot repository, set the enabled key for the desired language to false, or remove the definition entirely.
  2. Remove the language from the APP_ENABLED_LANGS variable in .env.

Deployment

The master branch is automatically deployed to the staging environment when changes are pushed. The production instance is updated when a new version is tagged:

  1. Update the APP_VERSION in .env to the new version, using the CalVer format.
  2. Push the changes to the master branch.
  3. Create a new release on GitHub with the same tag.

The production instance should be updated within 10 minutes.

copypatrol's People

Contributors

bd808 avatar catrope avatar chlodalejandro avatar dependabot-preview[bot] avatar dependabot[bot] avatar eranroz avatar framawiki avatar kaldari avatar kostajh avatar ladsgroup avatar maxsem avatar mooeypoo avatar musikanimal avatar niharika29 avatar nikerabbit avatar ricordisamoa avatar samwilson avatar siebrand avatar sohomdatta1 avatar suecarmol avatar theresnotime avatar translatewiki avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.