njudge

command module
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

README

njudge

Tests Go Reference Go Report Card

Online Judge system written in golang. A running version can be found here.

It consists of two main parts:

  • A group of reusable components, located in pkg/, which can be used in a variety ways related to the conversion, running and modification of algorithmic/olympiad tasks.
  • A web based online judge system, located in internal/.

How to run the online judge

Disclaimer: it's possible to run the system without docker, but it's much more of a hassle to set up the environment.

First, build the containers:

docker-compose build base
docker-compose build

Then, run the migrations:

docker-compose run web ./njudge web migrate --up

Modify the environment files web.env and judge.env. Typically only web.env needs to be changed. A quite minimal web.env file for example would be:

NJUDGE_MODE="production"
NJUDGE_HOSTNAME="yourhost.domain"
NJUDGE_URL="https://yourhost.domain"
NJUDGE_COOKIESECRET="somesecretstring"

Probably you would want some of NJUDGE_SENDGRID, NJUDGE_SMTP, NJUDGE_GOOGLEAUTH as well to provide OAuth login and email sending capabilities. For the full list of the configuration options supported by the web component check out config.go.

Then you can start all containers necessary via:

docker-compose up

To make problems available to the system you have two options:

  1. Use the automatically created njudge_problems volume, copy the problems there via docker cp.
  2. Modify the docker-compose.yml to use a bind mount pointing to a directory on your host system.

If both the judge and web component sees the problems, you have to use the admin panel (or some sql client) to create the necessary ProblemRels for it to be displayed on the frontend.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
gotext-update-templates
Command gotext-update-templates merge translations and generates a catalog.
Command gotext-update-templates merge translations and generates a catalog.
internal
web
mocks
pkg
problems
Package problems contains utilities useful for parsing, displaying, judging (submission for) problems
Package problems contains utilities useful for parsing, displaying, judging (submission for) problems
problems/checker
Package checker contains different implementation of the interface defined as github.com/mraron/njudge/pkg/problems.Checker
Package checker contains different implementation of the interface defined as github.com/mraron/njudge/pkg/problems.Checker

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL