This project currently runs on PythonAnywhere with flask
https://flask.palletsprojects.com/en/1.1.x/installation/
Setup
git clone https://github.com/mb/rcj-server
cd rcj-server
python3 -m venv venv
. venv/bin/activate
pip install Flask Flask-HTTPAuth fire flask-cors requestsRunning the development version:
FLASK_APP=src/rcj_flask.py flask run
Example rcj_config.ini
[db]
filename = "rcj_database.sqlite"Example events.ini
[auth]
token = token-authorizing-rcjserver-123456
[events]
run-started--1 = http://localhost:1338/v1/event
run-finished--1 = http://localhost:1338/v1/event
run-finished--2 = http://localhost:5001/calcGenerate authorization string for user NL with password wbSwFU6tY1c: base64("NL:wbSwFU6tY1c") = Tkw6d2JTd0ZVNnRZMWM=
Example http request:
POST /api/v1/submit_run HTTP/1.1
Authorization: Basic Tkw6d2JTd0ZVNnRZMWM=
Content-Type: application/json
Content-Length: 370
{
referee: {
name: "NL",
auth: "wbSwFU6tY1c"
},
competition: "2020-berlin-line",
arena: "Arena A",
round: 2,
teamname: "pi++",
time_duration: 57,
time_start: 1554854400,
time_end: 1558665000,
scoring: {
teamStarted: true
score: 5
},
comments: "",
confirmed: true,
complaints: ""
}
See https://github.com/rcjberlin/rcj-dss#evaluation for more details.
Each POST request needs to have the object referee with name and auth (when authentication is required).
{
referee: {
name: "NL",
auth: "wbSwFU6tY1c"
},
...
}
The response is always a JSON.