Code Monkey home page Code Monkey logo

syzoj's Introduction

SYZOJ 2

An OnlineJudge System for OI.

The UI is powered by Semantic UI.
Template designed & coded by Sengxian and Menci.

Deploying

There's currently no stable version of SYZOJ 2, but you can use the unstable version from git.

git clone https://github.com/syzoj/syzoj
cd syzoj

Install dependencies with npm install or yarn. Also, follow the instructions here to install 7z executable used by the node-7z package.

Copy config-example.json to config.json, and make necessary changes.

Database

SYZOJ 2 uses Sequelize, which supports many database systems, including MySQL and Sqlite.

By default it use the Sqlite database syzoj.db, you can change it in config.json

Security

You should change the session_secret and judge_token in config.json.

Administration

In the database, the is_admin field in user table describes whether a user is admin or not.

To make a user be an admin, the only way is via database.

Judge

SYZOJ 2 uses a Docker-based sandboxed judger. Please go to syzoj-judge.

Advanced

System Service

Run SYZOJ 2

Add SYZOJ 2 to system services.

vim [syzoj2 path]/runsyzoj

Edit runsyzoj as as follows.

#!/bin/bash
cd [syzoj2 path]
npm start > log.txt 2>&1

Please change [syzoj2 path].

Run SYZOJ-JUDGE

Add SYZOJ-JUDGE to system services.

vim [syzoj-judge path]/runjudge

Edit runjudge as as follows.

#!/bin/bash
cd [syzoj-judge path]
npm start > jlog.txt 2>&1

Please change [syzoj-judge path].

Add To System Service

vim /etc/systemd/system/syzoj.service

Edit /etc/systemd/system/syzoj.service as as follows.

[Unit]
Description=SYZOJ Online Judge
After=network.target

[Service]
Type=simple
PIDFile=/run/syzoj.pid
WorkingDirectory=[syzoj2 path]
ExecStart=[syzoj2 path]/runsyzoj
StandardOutput=null
StandardError=null

[Install]
WantedBy=multi-user.target

Please change [syzoj2 path].

vim /etc/systemd/system/syzoj-judge.service

Edit /etc/systemd/system/syzoj-judge.service as as follows.

[Unit]
Description=SYZOJ Judge Daemon
After=network.target

[Service]
Type=simple
PIDFile=/run/syzoj-judge.pid
WorkingDirectory=[syzoj-judge path]
ExecStart=[syzoj-judge path]/runjudge
StandardOutput=null
StandardError=null

[Install]
WantedBy=multi-user.target

Please change [syzoj-judge path].

Usage

Start

systemctl start syzoj
systemctl start syzoj-judge

Stop

systemctl stop syzoj
systemctl stop syzoj-judge

Restart

systemctl restart syzoj
systemctl restart syzoj-judge

syzoj's People

Contributors

menci avatar pisces000221 avatar q234rty avatar xehoth avatar sengxian avatar t123yh avatar

Watchers

James Cloos avatar  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.