From 8a047da2bedb6fb80631ba48966bcf96dc8cbcf1 Mon Sep 17 00:00:00 2001 From: virusdefender Date: Sat, 16 Dec 2017 02:19:11 +0800 Subject: [PATCH] update docs --- .python-version | 1 + docs/_sidebar.md | 1 + docs/judgeserver/api.md | 1 - docs/onlinejudge/guide/https.md | 19 +++++++++++++++++++ docs/onlinejudge/guide/intranet_problems.md | 2 +- 5 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 .python-version create mode 100644 docs/onlinejudge/guide/https.md diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..b727628 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.6.2 diff --git a/docs/_sidebar.md b/docs/_sidebar.md index 62301f1..48fcdcd 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -10,6 +10,7 @@ - [多个评测机](onlinejudge/guide/multi_judge_server.md) - [内网运行的问题](onlinejudge/guide/intranet_problems.md) - [代码升级说明](onlinejudge/guide/upgrade.md) + - [HTTPS相关问题](onlinejudge/guide/https.md) - [常见问题](onlinejudge/faq.md) - [交流群](onlinejudge/guide/qq_group.md) - [从旧版迁移](onlinejudge/from_old.md) diff --git a/docs/judgeserver/api.md b/docs/judgeserver/api.md index 3273ca8..4373ed6 100644 --- a/docs/judgeserver/api.md +++ b/docs/judgeserver/api.md @@ -24,7 +24,6 @@ { "judger_version": "2.0.1", "hostname": "d3765528134e", - "running_task_number": 2, // number of cpu cores, this value will determine the number of concurrent tasks "cpu_core": 1, // usage of cpu and memory diff --git a/docs/onlinejudge/guide/https.md b/docs/onlinejudge/guide/https.md new file mode 100644 index 0000000..24e91bc --- /dev/null +++ b/docs/onlinejudge/guide/https.md @@ -0,0 +1,19 @@ +# HTTPS 相关问题 + +OnlineJudge 强烈推荐使用 HTTPS 协议 + + - 数据传输加密,提高安全性,防劫持 + - 可以使用 HTTP2,加快访问速度(默认配置) + +OnlineJudge 的部署脚本默认情况下会生成一个自签名证书,浏览器会提示不信任,可以自己去申请对应域名的可信证书,OnlineJudge 也提供了下面两个特性方便 HTTPS 证书的申请和使用。 + +## 申请 HTTPS 证书 + +`/.well-known` 的 url 前缀,会自动使用 `data/ssl/.well-known` 目录下面的文件,默认情况下 `data/ssl/` 已经存在,所以可以手动的创建 `.well-known` 及其子文件夹,比如需要 url 为 `/.well-known/pki-validation/fileauth.txt` 的验证文件,就可以创建 `data/ssl/.well-known/pki-validation/fileauth.txt` 文件,内容为指定的内容。 + +然后替换 `data/ssl/` 下面的证书和私钥文件。 + +## FORCE_HTTPS + +如果 HTTPS 配置成功,为了增强安全性,推荐重定向 HTTP 流量到 HTTPS 流量,这时候可以取消注释 `docker-compose.yml` 文件中的 `FORCE_HTTPS=1` 这一行,然后 `docker-compose up -d` 重启即可。 + diff --git a/docs/onlinejudge/guide/intranet_problems.md b/docs/onlinejudge/guide/intranet_problems.md index 3378018..d4648ec 100644 --- a/docs/onlinejudge/guide/intranet_problems.md +++ b/docs/onlinejudge/guide/intranet_problems.md @@ -1,6 +1,6 @@ # 内网运行的问题 -OJ的MathJax是从cdn加载的,因此若是在网络隔离的环境运行,将无法无法使用MathJax显示数学公式 +OJ的MathJax是从cdn加载的,因此若是在网络隔离的环境运行,将无法使用MathJax显示数学公式 > 为何不将Mathjax打包进OJ? >