From 2d5eef8d085f506bf10e43d1d3679a351e085c3e Mon Sep 17 00:00:00 2001 From: undefined Date: Thu, 16 Jul 2020 15:18:55 +0800 Subject: [PATCH] +nginx.conf; update scratchpad --- TODO | 2 + examples/h2o.conf | 9 +++ examples/nginx.conf | 17 ++++++ hydro/error.ts | 24 ++++---- hydro/handler/contest.ts | 7 ++- hydro/handler/homework.ts | 11 +++- hydro/handler/misc.ts | 1 + hydro/handler/problem.ts | 28 +++++---- hydro/interface.ts | 2 +- hydro/model/builtin.ts | 10 ---- hydro/model/problem.ts | 2 +- hydro/model/record.ts | 2 +- hydro/model/setting.ts | 20 ++++--- hydro/model/user.ts | 6 +- hydro/service/server.ts | 43 +++++++------- locales/zh_CN.yaml | 2 +- package.json | 8 +-- templates/partials/footer.html | 5 +- templates/problem_detail.html | 5 +- templates/problem_upload.html | 22 +++---- tool/checkTranslation.js | 24 +++++++- .../scratchpad/ScratchpadPretestContainer.js | 58 +++++++------------ .../ScratchpadPretestTabPaneContainer.js | 49 ---------------- .../scratchpad/ScratchpadToolbarContainer.js | 13 ++--- ui/components/scratchpad/reducers/pretest.js | 55 +++++++----------- ui/components/scratchpad/reducers/records.js | 5 -- ui/pages/problem_detail.page.js | 2 +- wiki/admin/deploy.md | 4 +- 28 files changed, 206 insertions(+), 230 deletions(-) create mode 100644 examples/h2o.conf create mode 100644 examples/nginx.conf delete mode 100644 ui/components/scratchpad/ScratchpadPretestTabPaneContainer.js diff --git a/TODO b/TODO index 887a0dd39..8c9e71d4d 100644 --- a/TODO +++ b/TODO @@ -7,3 +7,5 @@ web端运行脚本似乎异常 举报功能 SETTINGS_PRIVACY.allowRegisteredUsers model.setting.ui.name +pdoc.secretConfig? +在线IDE 更换颜色主题 diff --git a/examples/h2o.conf b/examples/h2o.conf new file mode 100644 index 000000000..f031b48b0 --- /dev/null +++ b/examples/h2o.conf @@ -0,0 +1,9 @@ +listen: + port: 8080 +hosts: + "*": + paths: + /: + proxy.reverse.url: "http://[unix:/home/hydro/hydro.sock]" + proxy.preserve-host: ON + proxy.websocket: ON \ No newline at end of file diff --git a/examples/nginx.conf b/examples/nginx.conf new file mode 100644 index 000000000..f42b9c3fb --- /dev/null +++ b/examples/nginx.conf @@ -0,0 +1,17 @@ +server { + listen 8080; + server_name localhost; + root /tmp/hydro/public; + + location / { + try_files $uri @proxy_to_app; + } + + location @proxy_to_app { + proxy_pass http://unix:/home/hydro/hydro.sock; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade; + proxy_set_header X-Forwarded-For $remote_addr; + } +} \ No newline at end of file diff --git a/hydro/error.ts b/hydro/error.ts index a985b8eee..e1ef92c8c 100644 --- a/hydro/error.ts +++ b/hydro/error.ts @@ -2,7 +2,7 @@ const { isClass } = require('./utils'); interface IHydroError { - new(...args: any[]): HydroError + new(...args: any[]): HydroError } const Err = (name: string, ...info: Array) => { @@ -29,19 +29,19 @@ const Err = (name: string, ...info: Array