Next generation of Vijos, built with asyncio on Python 3.5.
- Problem Categories and Tags
- Solution Sharing & Voting
- Online Coding and Testing (a.k.a. Scratchpad Mode)
- Discussions & Comments
- Trainings
- Contests (ACM & OI)
- Dynamic Ranking System
- Real-time Status Updates
- Online Judge as a Service (a.k.a. Domain): create your own OJ website without dev-ops!
- Management UI
- Sandboxed & Distributed Judging: see jd4, winjudge and windows-container
- High Performance Web Server
- Cross Platform (both Judge and Web Server can be run on Linux & Windows)
- Secure (we are also CTF players)
- Modern Architecture
- Modern User Interface
- SEO Optimized
- CDN Friendly
- Python 3.5+
- MongoDB 3.0+
- Node.js 0.11.15+ - better use a modern version ;)
- RabbitMQ
In the root of the repository, where requirements.txt and package.json locates:
python3.5 -m pip install -r requirements.txt
npm install # cnpm installYou don't need root privilege to run npm install. It installs stuffs in the project directory.
You may want to use cnpm and tuna
if you are in China. Make sure to use cnpm by adding alias to npm instead of installing cnpm cli-tool.
Some requirements may need Python.h. In Ubuntu/Debian simply use
apt install python3-devto resolve the problem.
To enable IP geo-location translation, you need to obtain a MaxMind GeoLite City DB and put it in the project root directory:
curl "http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz" | gunzip -c > GeoLite2-City.mmdbYou may also want to install libmaxminddb for higher performance.
In the root of the repository:
npm run build # or: npm run build:watch
python3.5 -m vj4.server --debugSet
--listen(default: http://127.0.0.1:8888) to listen on a different address.
As an intuitive example, you may want to add a super administator and a problem to start:
alias pm="python3.5 -m"
pm vj4.model.user add -1 icebox 12345 icebox@iceboy.org
pm vj4.model.user set_superadmin -1
pm vj4.model.adaptor.problem add system "Dummy Problem" "# It *works*" -1 1000 # you can also use web UIYou need to run these scripts on a regular basis to maintain correct RP and ranks for all users:
pm vj4.job.rp recalc_all
pm vj4.job.rank run_allFrontend source codes can be recompiled automatically by running:
npm run build:watchHowever you need to manually restart the server for server-side code to take effect.
npm run build:production
python3.5 -OO -m vj4.server --listen=unix:/var/run/vj4.sock- Set
--listen(default: http://127.0.0.1:8888) to listen on a different address. - Set
--prefork(default: 1) to specify the number of worker processes. - Set
--ip-header(default: X-Forwarded-For) to use IP address in request headers. - Set
--url-prefix(default: https://vijos.org) to set URL prefix. - Set
--cdn-prefix(default: /) to set CDN prefix. - Set
--smtp-host,--smtp-userand--smtp-passwordto specify a SMTP server. - Set
--db-host(default: localhost) and/or--db-name(default: test) to use a different database.
Have fun!
Maximum line width: 100
Indentation: 2 spaces