Skip to content

Putong Online Judge -- An online judge with nothing special

License

Notifications You must be signed in to change notification settings

acm309/PutongOJ

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Putong Online Judge v2

(初代版本 here)

(English here)

Build Status Codecov Node JavaScript Style Guide License

预览

Demo (测试账号: 123456 / 123456)

文档

Currently Not available 如果问题,请直接在发起一个 issue。

Features

  • Docker 构建,一件部署
  • 单页应用
  • 多组测试样例
  • Powered by Vue.js, Koa.js, MongoDB, Redis

部署

注意,此 OJ 处于 beta 状态。

Docker

  1. 复制此仓库
git clone https://github.com/acm309/PutongOJ.git PutongOJ
  1. compose up
docker-compose up

or

daemon mode

docker-compose up -d

会在 80 端口启动。可以直接访问。默认管理员账户 admin, 密码 kplkplkpl

Enjoy it!

手动安装

推荐安装在 Ubuntu 上。可以尝试其他版本,但不保证稳定。

  1. 安装 Node.js mongodb && redis

  2. 安装其它依赖 (for ubuntu)

apt-get install libcairo2-dev libpango1.0-dev build-essential
  1. 复制此仓库
git clone https://github.com/acm309/PutongOJ.git
  1. 安装项目依赖
npm i -g pnpm
pnpm i
  1. 尝试连接数据库

设置环境变量

export redisURL='your redis url'
export dbURL='your mongodb url'

更新 config/index.js

const prod = {
  port: 3000 // the port the application will listen on
}
  1. 下载静态文件和启动判题端
node manager.js

pm2.config.json 会自动生成.

  1. 启动

安装 pm2

npm i -g pm2

用 pm2 启动

pm2 start pm2.config.json

迁移

找到并记住 mongodb 容器的 Container Id

docker ps

导出

<Container id> 替换为上一步中 mongodb 实际运行的 id

docker exec -it <Container id> mongodump --out /data/backup --db oj

数据会在 migrations/backup/

恢复

docker exec -it <Container Id> mongorestore --db oj --drop /data/backup/oj

静态文件

将文件复制到 public

<Container id> 替换为 oj 系统在运行的容器 id

docker cp <SRC_PATH> <Container Id>:/app/public

Browser Support

  • IE: NOT recommended
  • Chrome: 50 or above is recommended
  • Firefox: 50 or above is recommended
  • Edge: recommended

LICENSE

MIT

About

Putong Online Judge -- An online judge with nothing special

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages