Ruby API for accessing recent suspected plagiarism detected by CopyPatrol
This is essentially a rewrite of just the webservice from https://github.com/valhallasw/plagiabot/blob/master/webservice/api.py
Toolforge webservice implementation based on https://phabricator.wikimedia.org/T141388#6258714
-
create a tool and log in to it
-
clone this repo into
www/ruby/src -
turn
replica.my.cnfintocnf.ymland move it to the git directory -
add
ithenticate_userandithenticate_passwordvalues tocnf.yml. -
create
service.templatelike this:backend: kubernetes type: ruby2.7 -
Enter a webservice shell then install the gems from within the shell. This will install them using the bundler version of the
ruby2.7Docker container (rather than the version available to the tool account) so that it will be run successfully.webservice shellcd www/ruby/srcbundle install --path $HOME/www/ruby/vendor
-
Create a
start.shscript to start the server:#!/bin/sh cd $HOME/www/ruby/src APP_ENV=production bundle exec ruby server.rb -
Make the script executable
-
webservice ruby2.7 start $HOME/start.sh
- stop the webservice:
webservice stop - pull in the new code:
cd www/ruby/srcgit pull
- repeat
bundle installprocess from a shell, if any gem requirements changed - restart the webservice:
webservice ruby2.7 start $HOME/start.sh