diff --git a/_sidebar.md b/_sidebar.md index 844d917..0f8c565 100644 --- a/_sidebar.md +++ b/_sidebar.md @@ -1,3 +1,16 @@ +- Guide + - [Installation](en/guide/installation.md) + - [Configuration](en/guide/configuration.md) + - [Customize Judge Environment](en/guide/judge_language_customization.md) +- Management + - [Backup & Restore](en/management/backup_and_restore.md) +- Development + - [Architecture](en/development/architecture.md) + - [Build](en/development/build.md) + - [Contributor](en/development/contributor.md) + +--- + - 用户指南 - [部署](onlinejudge/guide/deploy.md) - [测试用例格式](onlinejudge/guide/test_case.md) diff --git a/en/development/architecture.md b/en/development/architecture.md new file mode 100644 index 0000000..e03d3c9 --- /dev/null +++ b/en/development/architecture.md @@ -0,0 +1,37 @@ +# Architecture + +```mermaid + +flowchart LR + api["API Server"] + static["Web Frontend"] + judge["Judge Server"] + + Internet --> Proxy + api --> judge + api --> Cache + api --> Database + + subgraph Backend + Proxy --> api + Proxy --> static + end +``` + +## Tech Stack + +### Proxy + +Nginx + +### Web Frontend + +Vue + Element UI + +### API Server + +Django + Dramatiq + +### Judge Server + +Flask + seccomp diff --git a/en/development/build.md b/en/development/build.md new file mode 100644 index 0000000..e6794dd --- /dev/null +++ b/en/development/build.md @@ -0,0 +1,19 @@ +# Build + +## Container Image + +### API + +```bash +git clone https://github.com/QingdaoU/OnlineJudge.git +cd OnlineJudge +docker buildx build . -t oj-image/backend:1.6.0 --load +``` + +### Judge Server + +```bash +git clone https://github.com/QingdaoU/JudgeServer.git +cd JudgeServer +docker buildx build . -t oj-image/judge:1.6.0 --load +``` diff --git a/en/development/contributor.md b/en/development/contributor.md new file mode 100644 index 0000000..8fa5637 --- /dev/null +++ b/en/development/contributor.md @@ -0,0 +1,45 @@ +# Contributors + +## v2.0 + +Main developers: + +- [virusdefender](https://virusdefender.net) +- [rawidn](https://rawidn.com) + +Thanks: + +- [heb1c](https://github.com/hebicheng) + +## v1.0 + +Main developers: + +- [virusdefender](https://virusdefender.net) +- [sxwxs](https://github.com/sxwxs) +- [hohoTT](https://github.com/hohoTT) +- [spxcds](https://github.com/spxcds) +- [ltwy](http://ltwy.me) + +Thanks: + +- [AIRobot](http://airobot.link) +- [minyu](http://www.yuntoo.com) +- [BIGBALLON](http://bigballon.github.io/) +- [SCaffrey](http://www.scaffrey.com/) +- [cjsoft](http://wallacenews.tk/) +- [湘江一桥](http://yiq.wang) +- [cnyali](http://blog.csdn.net/cnyali) +- [kam](https://github.com/ganting) +- [joe](https://github.com/xuse) +- [ltwy](http://ltwy.me/) +- [稗田千秋](https://wind.moe/) +- [伯伦希尔码农](http://qm.qq.com/cgi-bin/qm/qr?k=MeVkuAC2PmW4cdobY0te9djBPI5aFdT4) +- [joeyAC(acm新人)](https://github.com/joeyac) +- [千千](https://www.dreamwings.cn) +- [Cosima](http://blog.cosimahan.com) + +## Predecessors + +- 董延鑫 邢兆龙 +- 董延鑫 杨玉飞 徐可飞 王波 周鲁晓 diff --git a/en/guide/configuration.md b/en/guide/configuration.md new file mode 100644 index 0000000..9cc12b7 --- /dev/null +++ b/en/guide/configuration.md @@ -0,0 +1,22 @@ +# Configuration + +## Environment variables + +### Web Backend + +| Name | Default Value | Description | +| ---- | ----- | ----------- | +| POSTGRES_HOST | `postgres` | Postgres connection host | +| POSTGRES_PORT | `5432` | Postgres connection port | +| POSTGRES_DB | `onlinejudge` | Postgres database name | +| POSTGRES_USER | `onlinejudge` | Postgres user name | +| POSTGRES_PASSWORD | `onlinejudge` | Postgres user password | +| REDIS_HOST | `redis` | Redis connection host | +| REDIS_PORT | `6379` | Redis connection port | +| JUDGE_SERVER_TOKEN | (empty) | password used in judge server authentication | + +### Judge Server + +| Name | Default Value | Description | +| ---- | ----- | ----------- | +| JUDGE_SERVER_TOKEN | (empty) | password used in judge server authentication | diff --git a/en/guide/installation.md b/en/guide/installation.md new file mode 100644 index 0000000..2579244 --- /dev/null +++ b/en/guide/installation.md @@ -0,0 +1,30 @@ +# Installation + +## Requirements + +- Docker server + - Docker Engine (Linux) + - Docker Desktop (Windows, macOS and Linux) + - Colima (macOS) + - OrbStack (macOS) + - (others) +- Docker client +- Docker compose plugin + +## Steps + +1. Get necessary files from [QingdaoU/OnlineJudgeDeploy](https://github.com/QingdaoU/OnlineJudgeDeploy) releases. + + ```bash + git clone -b v1.6.0 https://github.com/QingdaoU/OnlineJudgeDeploy.git + ``` + +2. Pull and start containers. + + ```bash + docker compose up -d + ``` + +3. Done! + +!> Default account is `root` / `rootroot`, **please change the password as soon as possible**. diff --git a/en/guide/judge_language_customization.md b/en/guide/judge_language_customization.md new file mode 100644 index 0000000..f98f2dc --- /dev/null +++ b/en/guide/judge_language_customization.md @@ -0,0 +1,41 @@ +# Judge Language Customization + +1. Build custom judge server container image + + If you don't need to modify judge environment, you can skip this step. + + ```bash + git clone https://github.com/QingdaoU/JudgeServer.git + cd JudgeServer + # modify + docker buildx build . -t oj-judge --load + ``` + +2. Download [languages.py](https://raw.githubusercontent.com/QingdaoU/OnlineJudge/master/judge/languages.py) to the deploy folder. + +3. Edit and mount the languages.py + + ```yaml + services: + # ... + oj-backend: + # ... + volumes: + - ./data/backend:/data + - ./languages.py:/app/judge/languages.py:ro + ``` + +4. Start containers + + ```bash + docker compose up -d + ``` + +5. Overwrite judge language config in database from mounted languages.py + + ```bash + docker compose exec oj-backend python manage.py shell < "db-$(date -Iseconds).sql" + + # zstd + docker compose exec postgres pg_dumpall -c -U onlinejudge | zstd -o "db-$(date -Iseconds).sql.zst" + ``` + +- restore + + ```bash + docker compose exec postgres psql < "" + + # zstd + zstd -d "" | docker compose exec postgres psql + ``` + +## Test case + +- backup + + ```bash + tar -cf "testcase-$(date -Iseconds).tar" data/backend/test_case + + # zstd + tar --zstd -cf "testcase-$(date -Iseconds).tar.zst" data/backend/test_case + ``` + +- restore + + ```bash + tar -xf "" + + # zstd + tar --zstd -xf "" + ``` diff --git a/index.html b/index.html index 4e7bbc2..3efaa24 100644 --- a/index.html +++ b/index.html @@ -15,7 +15,7 @@
- +