- nodejs
- postgresql
- rabbitmq
- redis
- msmtp-mta (for sending e-mails, also need to setup an smtp provider in
/etc/msmtprc
, e.g. Setup Aliyun DirectMail) - auth system (other oauth providers like GitLab are also possible)
- prepare git repo
git submodule init
git submodule update
- prepare python environment
# prepare a python virtual environment first
pip install -r requirements.txt
- build front-end
For node version >= 17:
cd angular
npm i
NODE_OPTIONS=--openssl-legacy-provider npm run build
cd ..
For node version < 17:
cd angular
npm i
npm run build
cd ..
- setup database
createuser submit -P
# put a new password when prompt
createdb submit -O submit
- build email templates
cd mail_templates/mjml
npm i
npm run build
cd ../..
- Access
<auth-system-url>/admin/oauth/clients/new
- Input details of submit app. The
Redirect URL
should be<submit-system-url>/oauth-callback
. - Click 'Add' button
- Click 'Download Client Configuration File' button to download the oauth config file, put it in project root.
cp config.example.json config.json
# edit config.json
- Update
SECRET_KEY
with a good random string, e.g. using the following script to generate one:
python3 -c 'import secrets; print(secrets.token_urlsafe(8))'
- Update
SQLALCHEMY_DATABASE_URI
with a postgresql db connection url,postgresql://submit:PASSWORD@127.0.0.1:5432/submit
. (replacePASSWORD
with real password) - Delete
SYNC_WORKER
- Edit
SITE
andMAIL
according to real setup - Delete
broker_use_ssl
inAUTO_TEST
export PYTHONPATH="$PWD:$PWD/submit-testbot"
export FLASK_APP=server.py
flask create-db
flask init-db
flask init-email-subscriptions
The following environment variables are required to run the following servers
export PYTHONPATH="$PWD:$PWD/submit-testbot"
export FLASK_APP=server.py
flask run -p 8888
python period_worker.py
celery -A testbot.bot worker -Q testbot_meta -l info -n 'metabot@%h' -c 1
First, need to start a server separately
python anti_plagiarism/api_server.py
Then, start the bot process
celery -A testbot.bot worker -Q testbot_anti_plagiarism -l info -n 'apbot@%h' -c 1
For deployment in production environment, please refer to notes for auth system
See testbot project