GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - hzxie/voj: A cross-platform online judge system based on Spring framework and ActiveMQ.

BranchesTags
Open more actions menu

Latest commit

 

History

1,099 Commits
1,099 Commits

Folders and files

NameName
Last commit message
Last commit date
.circleci
.circleci
 
 
.github/workflows
.github/workflows
 
 
docker
docker
 
 
docs
docs
 
 
judger
judger
 
 
scripts
scripts
 
 
sql
sql
 
 
web
web
 
 
.dockerignore
.dockerignore
 
 
.env.example
.env.example
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
appveyor.yml
appveyor.yml
 
 
docker-compose.yml
docker-compose.yml
 
 
pom.xml
pom.xml
 
 

Repository files navigation

Verwandlung Online Judge

CircleCI Build status codecov Docker Pulls License: GPL v3

Official Demo · Project Page · Change Log

Introduction

Verwandlung Online Judge is a self-hostable, open-source online judge for competitive programming. It presents algorithmic problems, accepts submissions in multiple languages, then compiles, runs and evaluates them against predefined test cases, reporting correctness, run time and memory usage.

Highlights:

  • Cross-platform native judging. Submissions are judged natively on Linux and Windows through JNI, rather than relying on a Linux-only runtime.
  • Sandboxed execution. On Linux each submission runs under kernel-enforced resource limits, a seccomp syscall filter that also cuts off the network and Landlock rules that keep its writes in its own work directory, as an unprivileged user; on Windows it runs under a separate low-privilege account inside a Job Object that caps the process count and enforces resource limits.
  • Real-time feedback streamed to the browser with Server-Sent Events (SSE), so results appear progressively as each test case finishes.
  • Horizontally scalable judging. The judgers take the pending submissions from the shared database and stream their progress to the web app through Apache ActiveMQ, so you can run as many judgers in parallel as you need.
  • Contests and internationalization (English and Chinese) out of the box.

It is built on Spring Boot with the MyBatis persistence framework.

Architecture

Verwandlung has two components, the web application and one or more judgers, sharing the database and communicating over ActiveMQ:

Software Architecture

Getting Started

Run with Docker (recommended)

The fastest way to stand up the whole stack (database, message queue, web app and a judger) — two equivalent options:

git clone https://github.com/hzxie/voj.git
cd voj

# A) Docker Compose
cp .env.example .env    # then set VOJ_JUDGER_API_TOKEN and VOJ_JUDGER_PASSWORD
docker compose up -d

# B) Plain `docker run`, no compose
scripts/run-docker.sh

Both bring up the voj.web and voj.judger containers and persist the database in a named volume, so the web UI is available at http://localhost:8080/voj and your data survives image updates. run-docker.sh also generates strong random secrets and prints them once; to run the prebuilt Docker Hub images instead of building locally, use VOJ_PULL=1 scripts/run-docker.sh (or docker compose up, which pulls by default).

Configuration (database, mail, URLs, the judgers' secrets) is read from VOJ_* environment variables at runtime, so you can reconfigure or sit behind a reverse proxy without rebuilding. See docker/README.md for the full configuration, persistence and reverse-proxy details.

Build from source

Web application produces a self-contained executable JAR (embedded Tomcat):

cd web
mvn package -DskipTests        # -> web/target/voj.web.jar
java -jar target/voj.web.jar

Judger builds a Spring Boot jar plus the JNI native library, so a C++ toolchain is required:

# Linux build prerequisites: g++, make and libseccomp
sudo apt-get install -y g++ make libseccomp-dev

cd judger
mvn package -DskipTests        # -> judger/target/voj.judger.jar

On Windows the JNI library is built with MinGW-w64 g++ and make; see Native build prerequisites (Windows).

Convenience wrappers live in scripts/: build-jars.sh, build-docker.sh, run-web.sh and run-judger.sh (the run scripts preflight MySQL/ActiveMQ and import sql/schema.sql and sql/seed.sql on first launch, and the sample data of sql/demo.sql with VOJ_DEMO=1). On its first start the web application creates an administrator with a random password and prints it once on its standard output.

Both components read a voj.properties file (database, mail, message queue, sandbox, etc.). See docs/configuration.md for the full property reference.

Upgrading an existing installation? Some releases need a one-time database script from sql/upgrades/; see Upgrading the web application.

Requirements

Component Requirement
Java JDK 17+ (tested through JDK 25)
Database MySQL 8.0+ or MariaDB 10.4+
Message queue ActiveMQ 6.0+ (Jakarta JMS)
Judger (Linux build) GCC/g++, make, libseccomp
Judger OS Linux 5.13+ with Landlock enabled (6.2+ for a judger not running as root), or Windows

Security model

Untrusted submissions run inside a sandbox so they cannot harm the judging host:

  • Linux (isolate, recommended). With judger.sandbox = isolate, a judger running as root runs every compilation and run in a box of the external isolate tool, with mount, network, PID and IPC namespaces of its own and a cgroup that accounts for its memory and processes; it sees only the system directories and its own judging.
  • Linux (native). Each submission runs in a forked child with setrlimit (CPU time, memory backstop, output size and thread caps), a seccomp syscall filter (blocking creating processes, ptrace, mount, module loading, leaving the process group, creating namespaces, network sockets other than AF_UNIX, System V IPC, etc.), Landlock rules that let it write only in its own work directory (so nothing it leaves behind outlives it or reaches a later submission), a private network namespace where one can be created, and privileges dropped to an unprivileged user (system.username, defaulting to nobody). A run is a single process, so its CPU time and peak memory are exactly those of the program, and nothing it starts outlives it. Each Go submission gets its own build cache. If the judger runs as root and cannot drop privileges, or any part of the sandbox cannot be set up, the submission is refused (a system error) rather than run unconfined. This is the backend for a judger that is not root (development, CI) and for hosts without isolate.
  • Windows (native). Each submission runs with a restricted, Low-integrity token of a separate Windows account (CreateProcessWithTokenW), on a desktop of its own, off the network (filters of the Windows Filtering Platform), inside a Job Object that keeps a run to a single process, enforces CPU time, memory and output limits, applies UI restrictions, and kills the whole process tree when the run ends.

Both backends get the same command line, environment (the judger's locale and toolchain variables only, never its secrets) and limits from the judger, which judges what they measure the same way.

The native sandbox confines what a submission writes, not what it reads. Reference answers and configuration are protected by file permissions (the work directory is handed to the sandbox user, while the checkpoint directory stays readable only by the judger), but a submission can still read world-readable host files; isolate shows it only the system directories and its own judging.

For shared, multi-tenant hosts, create a dedicated unprivileged account for system.username instead of reusing nobody. See docs/deployment.md for the filesystem layout and permissions a root deployment expects.

The origin of "Verwandlung"

In 2011, LinkedIn released the Kafka message queue, named after the author Franz Kafka. A year later, Alibaba introduced MetaQ, built on Kafka, a nod to Kafka's novella Metamorphosis. Since the message queue is central to this application, it took the name "Verwandlung", the German title of Metamorphosis.

Contributing

Contributions are welcome:

  • Report bugs and request features on the issues page.
  • For new features, please open an issue to discuss before sending a pull request.
  • Translators for additional languages are especially appreciated.

License

This project is open-sourced under the GNU GPL v3.

About

A cross-platform online judge system based on Spring framework and ActiveMQ.

voj.infinitescript.com

Topics

activemqdockerjavajnionline-judgespring-boot

Resources

Readme
GPL-3.0 license
Activity

Stars

614 stars

Watchers

25 watching

Forks

118 forks
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.