From 35d00cde5ca3d3e795b236842e8b3fc66598be2d Mon Sep 17 00:00:00 2001 From: Menci Date: Tue, 26 Mar 2019 13:34:32 +0800 Subject: [PATCH 1/6] Upgrade dependencies --- package.json | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 2f0f048..bdf6bb5 100644 --- a/package.json +++ b/package.json @@ -24,12 +24,12 @@ "homepage": "https://github.com/syzoj/syzoj#readme", "dependencies": { "amqplib": "^0.5.2", - "ansi-to-html": "^0.6.9", - "async-lock": "^1.1.3", + "ansi-to-html": "^0.6.10", + "async-lock": "^1.2.0", "body-parser": "^1.15.2", "cheerio": "^1.0.0-rc.1", - "command-line-args": "^5.0.2", - "cookie-parser": "^1.4.3", + "command-line-args": "^5.1.0", + "cookie-parser": "^1.4.4", "cssfilter": "0.0.10", "download": "^7.1.0", "ejs": "^2.5.2", @@ -39,11 +39,11 @@ "fs-extra": "^7.0.1", "gravatar": "^1.8.0", "javascript-time-ago": "^1.0.30", - "js-yaml": "^3.9.0", + "js-yaml": "^3.13.0", "jsdom": "^14.0.0", "jsondiffpatch": "0.2.5", - "jsonwebtoken": "^8.4.0", - "mariadb": "^2.0.2-rc", + "jsonwebtoken": "^8.5.1", + "mariadb": "^2.0.3", "moment": "^2.24.0", "msgpack-lite": "^0.1.26", "multer": "^1.2.0", @@ -54,19 +54,19 @@ "randomstring": "^1.1.5", "redis": "^2.8.0", "request": "^2.74.0", - "request-promise": "^4.1.1", + "request-promise": "^4.2.4", "sendmail": "^1.1.1", - "sequelize": "^5.0.0-beta.15", + "sequelize": "^5.1.1", "serialize-javascript": "^1.6.1", "session-file-store": "^1.0.0", "socket.io": "^2.2.0", - "stream-to-string": "^1.1.0", + "stream-to-string": "^1.2.0", "syzoj-divine": "^1.0.2", "syzoj-renderer": "^1.0.3", "tempfile": "^2.0.0", "tmp-promise": "^1.0.3", "waliyun": "^3.1.1", - "winston": "^3.1.0", - "xss": "^1.0.3" + "winston": "^3.2.1", + "xss": "^1.0.6" } } From ad01e9c3f8b1562961566aba8d3407c8d938c728 Mon Sep 17 00:00:00 2001 From: Menci Date: Tue, 26 Mar 2019 16:40:34 +0800 Subject: [PATCH 2/6] Upgrade syzoj-renderer --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3b8f512..d4d77c3 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "socket.io": "^2.2.0", "stream-to-string": "^1.2.0", "syzoj-divine": "^1.0.2", - "syzoj-renderer": "^1.0.4", + "syzoj-renderer": "^1.0.5", "tempfile": "^2.0.0", "tmp-promise": "^1.0.3", "waliyun": "^3.1.1", From a699fc52214cc953bff4ede276021583e200a8ef Mon Sep 17 00:00:00 2001 From: Menci Date: Tue, 26 Mar 2019 18:46:11 +0800 Subject: [PATCH 3/6] Remove unfinished custom test, close #102 --- views/problem.ejs | 88 ----------------------------------------------- 1 file changed, 88 deletions(-) diff --git a/views/problem.ejs b/views/problem.ejs index 0655a62..ceb3df4 100644 --- a/views/problem.ejs +++ b/views/problem.ejs @@ -336,7 +336,6 @@ div[class*=ace_br] {
-
<% } %> @@ -384,93 +383,6 @@ div[class*=ace_br] { }); - - - - <% } else { %> + +<% include footer %> diff --git a/views/header.ejs b/views/header.ejs index 9d786c1..f91a8de 100644 --- a/views/header.ejs +++ b/views/header.ejs @@ -72,6 +72,7 @@ 修改资料 <% if (user.is_admin) { %> 后台管理 + 重启服务 <% } %> 注销 From 4b649698ec15aea2b428355aa13ac74754b8bcd7 Mon Sep 17 00:00:00 2001 From: Menci Date: Wed, 27 Mar 2019 02:39:53 +0800 Subject: [PATCH 5/6] Update README --- README.en.md | 2 ++ README.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/README.en.md b/README.en.md index 886a02f..8ddde47 100644 --- a/README.en.md +++ b/README.en.md @@ -48,3 +48,5 @@ ALTER TABLE `user` ADD `prefer_formatted_code` TINYINT(1) NOT NULL DEFAULT 1 AFT To make code formatting work, `clang-format` needs to be installed. [migrates/format-old-codes.js](migrates/format-old-codes.js) may help formating old submissions' codes. Who upgraded from a commit BEFORE [c192e8001ac81cab132ae033b39f09a094587633](https://github.com/syzoj/syzoj/commit/c192e8001ac81cab132ae033b39f09a094587633) (Mar 23, 2019) **MUST** install `redis-server` and [pygments](http://pygments.org/) on the web server. Markdown contents may be broken by switching to new renderer, [migrates/html-table-merge-cell-to-md.js](migrates/html-table-merge-cell-to-md.js) may help the migration。 + +Who upgraded from a commit BEFORE [7b03706821c604f59fe8263286203d57d634c421](https://github.com/syzoj/syzoj/commit/c192e8001ac81cab132ae033b39f09a094587633) (Mar 27, 2019) **MUST** add `RemainAfterExit=yes` to the systemd config file `syzoj-web.service`'s `[Service]` section to make sure that restart service can work properly. diff --git a/README.md b/README.md index de290c4..eed47d8 100644 --- a/README.md +++ b/README.md @@ -48,3 +48,5 @@ ALTER TABLE `user` ADD `prefer_formatted_code` TINYINT(1) NOT NULL DEFAULT 1 AFT 为使代码格式化功能正常工作,`clang-format` 需要被安装。[migrates/format-old-codes.js](migrates/format-old-codes.js) 可能对格式化旧提交记录的代码有帮助。 从该 commit [c192e8001ac81cab132ae033b39f09a094587633](https://github.com/syzoj/syzoj/commit/c192e8001ac81cab132ae033b39f09a094587633)(2019 年 3 月 23 日)前更新的用户**必须**在网站服务器上安装 `redis-server` 与 [pygments](http://pygments.org/)。旧的 Markdown 内容可能因切换到新渲染器被破坏,[migrates/html-table-merge-cell-to-md.js](migrates/html-table-merge-cell-to-md.js) 可能对迁移有所帮助。 + +从该 commit [7b03706821c604f59fe8263286203d57d634c421](https://github.com/syzoj/syzoj/commit/c192e8001ac81cab132ae033b39f09a094587633)(2019 年 3 月 27 日)前更新的用户**必须**在其 systemd 配置文件 `syzoj-web.service` 中的 `[Service]` 中加入一行 `RemainAfterExit=yes`,以使得重启服务功能正常工作。 From 35baf6b893021503a26a35fbf643d24a7da6de71 Mon Sep 17 00:00:00 2001 From: Menci Date: Wed, 27 Mar 2019 16:26:42 +0800 Subject: [PATCH 6/6] Fix config validate --- app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.js b/app.js index aeaa9fe..d004a82 100644 --- a/app.js +++ b/app.js @@ -27,7 +27,7 @@ global.syzoj = { async run() { // Check config if (syzoj.config.session_secret === '@SESSION_SECRET@' - || syzoj.config.email_jwt_secret === '@EMAIL_JWT_SECRET@' + || (syzoj.config.email_jwt_secret === '@EMAIL_JWT_SECRET@' && syzoj.config.register_mail) || syzoj.config.db.password === '@DATABASE_PASSWORD@') { console.log('Please generate and fill the secrets in config!'); process.exit();