GithubHelp home page GithubHelp logo

dilancar / vj4 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vijos/vj4

0.0 0.0 0.0 5.89 MB

The online judge service with millions of submissions, since 2005.

Home Page: https://vijos.org

License: GNU Affero General Public License v3.0

Shell 0.04% JavaScript 20.19% Python 43.87% HTML 24.26% Stylus 11.64%

vj4's Introduction

vj4

Next generation of Vijos, built with asyncio on Python 3.


Overview

  • 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
  • Secure (we are also CTF players)
  • Modern Architecture & User Interface

Usage

Pre-built docker package

There is pre-built docker package at vijos/vj4. This is maintained by @moesoha. Source code is available at https://github.com/vijos/vj4-docker.

Manual build

Prerequisites

Install requirements

In the root of the repository, where requirements.txt and package.json locates:

python3 -m pip install -r requirements.txt
yarn

You don't need root privilege to run yarn. It installs stuffs in the project directory. We recommend using Node 10.

You may want to use tuna if you are in China.

Some requirements may need Python.h and ffi.h. In Debian/Ubuntu you can use

apt install python3-dev libffi-dev

to resolve this.

IP Geo-Location

To enable IP geo-location translation, you need to follow the instruction on MaxMind GeoLite2 to obtain a GeoLite2 City Database, unzip it, and put it in the project root directory with the filename GeoLite2-City.mmdb.

You may also want to install libmaxminddb for higher performance.

Development

In the root of the repository:

yarn build   # or: yarn build:watch
python3 -m vj4.server --debug

Set --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 administrator and a problem to start:

alias pm="python3 -m"
pm vj4.model.user add -1 icebox 12345 [email protected]
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 UI

You 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_all

Watch and Restart

Frontend source codes can be recompiled automatically by running:

yarn build:watch

However you need to manually restart the server for server-side code to take effect.

Production

yarn build:production
python3 -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: '') 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-user, --smtp-password, and --mail-from to specify a SMTP server.
  • Set --db-host (default: localhost) and/or --db-name (default: test) to use a different database.

Better to use a reverse proxy like Nginx or h2o.

Judging

To enable vj4 to judge, at least one judge user and one judge daemon instance are needed.

  • Use following commands to create a judge user:
alias pm="python3 -m"
pm vj4.model.user add -2 judge 123456 [email protected]
pm vj4.model.user set_judge -2

Use jd4

Use HydroJudge

Notes

Have fun!

Maximum line width: 100

Indentation: 2 spaces

JavaScript Style Guide

No commercial use, except get permission from us.

References

vj4's People

Contributors

twd2 avatar breezewish avatar iceboy233 avatar dependabot[bot] avatar moesoha avatar undefined-moe avatar sxkdz avatar mikumikuchan avatar blackbbc avatar samhjn avatar greenkeeper[bot] avatar bjrjk avatar lukexuan avatar macesuted avatar q234rty avatar masnn0 avatar ksyx avatar moetayuko avatar zzhou612 avatar monkey2000 avatar tc-imba avatar junukwon7 avatar joshoy avatar zsgsdesign avatar seiarotg avatar 0x3a2b avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.