You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Natsu Kagami e120340783 Fix broken Register page (#108) 10 months ago
assets/sql Display Names and Organizations (#103) 10 months ago
cmd Test Data & Some Fixes (#99) 10 months ago
db BUGFIX: Update migration status after updating (#39) 11 months ago
docker Make a super mini docker image with only g++ (#61) 11 months ago
frontend Fix broken Register page (#108) 10 months ago
models fix calculating problem's first solver (#106) 10 months ago
scripts Test Data & Some Fixes (#99) 10 months ago
server Fix broken Register page (#108) 10 months ago
test Display Names and Organizations (#103) 10 months ago
tests Implement test-uploading 1 year ago
worker Tweak worker code (#107) 10 months ago
.dockerignore Minor UI Bugfixes (#100) 10 months ago
.drone.yml Test Data & Some Fixes (#99) 10 months ago
.gitattributes Ignore data files as SQL source code (#102) 10 months ago
.gitignore Test Data & Some Fixes (#99) 10 months ago
LICENSE Change license to AGPL 3.0 (#53) 11 months ago
README.md Change the license badge in README to AGPLv3 (#62) 11 months ago
doc.go We are 0.4.1 now (#101) 10 months ago
fileb0x.yaml Move templates > frontend 1 year ago
generate.go [#13] Set up CI (#14) 11 months ago
go.mod Upgrade frontend dependencies (#77) 11 months ago
go.sum Upgrade frontend dependencies (#77) 11 months ago
tools.go Go mod update for golang.org/x/tools 1 year ago

README.md

kjudge

Build Status Docker Image Version (latest semver) godoc License is AGPLv3

Project Goals

  • As lightweightedly deployable as possible (single binary, minimal dependencies)
  • User friendly
  • Doesn't get in the way (take minimal resources)

Quick start

The fastest way to get kjudge up and runnning is through the official Docker image.

It contains:

  • kjudge itself
  • Compilers for C++, Pascal, Java, Go, Rust, Python 2 and 3
  • The isolate sandbox

Please checkout the wiki for more information on how to get it up and running.

Need more details?

Check out the wiki!

Runtime dependencies

It should run on all platforms Go compiles to.

Required binaries:

  • isolate: The recommended sandbox. This is actually optional, however the only alternate sandbox implementation available (as of now) is the raw sandbox, which DOES NOT PROVIDE ANY GUARDS AGAINST FOREIGN CODE (which makes it okay to run when you are the only user). isolate is available on Linux systems only.

Command line switches

> ./kjudge --help
Usage of ./kjudge:
  -file string
    	Path to the database file (default "kjudge.db")
  -sandbox string
    	The sandbox implementation to be used (isolate, raw). If anything other than 'raw' is given, isolate is used. (default "isolate")

Build Instructions

External Dependencies:

cc:      anything that compiles SQLite 3
go:      >= 1.13
node.js: >= 9
yarn:    >= 1

Go dependencies: See tools.go. All Go dependencies can be installed with

scripts/install_tools.sh

Production build

Build steps:

scripts/production_build.sh

Development build

First, start the template generator and updater with

cd frontend
yarn && yarn dev

Note that it would block and watch for any updates on the front-end templates.

Now open a new terminal, run

go generate

to generate the models and load a development (live-reloading) version of the template packager.

Finally, run

go run cmd/kjudge/main.go

to run kjudge.

Directory Structure

assets:   # Static assets that gets compiled into the binary
    - sql # SQL migration schemas
cmd:          # Main commands
    - kjudge  # Main compile target
db # Database interaction library
docker    # Dockerfile and other docker-related packaging handlers
scripts   # Scripts that helps automating builds
models:          # Database entities
    - generate   # Generator for models
    - verify     # Model verification helpers
static # [GENERATED BY FILEB0X]
templates   # Generated templates from frontend
frontend:   # Template files and front-end related source codes
    - html  # HTML [template] files
    - css   # CSS files
    - ts    # TypeScript files
worker:        # Automatic judging logic
    - raw      # Raw and isolate are 2 sandbox implementations
    - isolate
server:        # Root of server logic
    - auth     # Authentication logic and session handlers
    - template # Template resolver and renderer implementation
    - user     # /user page handling and contexts
    - admin    # /admin (Admin Panel) page handling and contexts
    - contests # /contests (main contest UI) page handling and contexts

License

GNU Affero General Public License v3.0, which disallows distributing closed-source versions, so don't do it.