Indirectly submit Codeforces problems using this tool! Look forward to added support for more online judges in the future.
Begin by cloning the repository:
$ git clone https://github.com/hnojedu/virtual-judge-server.git
$ cd virtual-judge-server
Install the required dependencies using pip:
$ pip install -r requirements.txt
Initiate the Redis server:
$ sudo systemctl start redis-server
Ensure that the Redis server is operational by running:
$ redis-cli ping
You should receive a response of PONG
.
Create a copy of the example configuration file:
$ cp env.example .env
KEY
: A 64-character key, obtainable by running$ python3 generate_key.py
. This should matchJUDGE_SERVER_KEY
in the online judge server.USERNAME, PASSWORD
: Codeforces account credentials (separated by commas).INTERVAL
: Time interval between requests in seconds. Be cautious not to set this too low, as it may result in Codeforces blocking your requests.ACCELERATION
: The increment in the time interval after each request, specified in seconds.MAX_ATTEMPTS
: The maximum number of attempts to retrieve submission results.ONLINE_JUDGE
: URL of the online judge platform where the server will send results.JOB_TIMEOUT
: Timeout duration for each request in seconds.REDIS_HOST
: Redis server hostname.REDIS_PORT
: Redis server port.
Initiate the server with the following command:
python3 judge.py
This will start the server using Flask's built-in server, running on the host defined by APPLICATION_HOST
and port APPLICATION_PORT
in configuration file. If necessary, you can use more advanced web servers like Gunicorn or uWSGI.