Official Demo · Project Page · Change Log
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.
Verwandlung has two components, the web application and one or more judgers, sharing the database and communicating over ActiveMQ:
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.
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++andmake; 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.
| 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 |
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 thanAF_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 tonobody). 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.
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.
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.
This project is open-sourced under the GNU GPL v3.