bump version

This commit is contained in:
undefined committed 2023-03-03 18:19:19 +08:00
1 parent 476b17153a
commit 44a579878b
21 files changed
+58 -40

No files matched your search

+19
View File
@@ -40,6 +40,25 @@ Telegram [@webpack_exports_undefined](https://t.me/webpack_exports_undefined)
<details> <details>
<summary><h2>更新日志(点击展开)</h2></summary> <summary><h2>更新日志(点击展开)</h2></summary>
### HYdro 4.8.0 / UI 4.47.6
- core: 升级至 mongodb@5
- ui: 评测详情中显示子任务得分
- core: 修复测试数据文件名以空格开头导致操作异常的问题
- dev: 升级 devcontainer 环境
- ui: 优化 IDE 页面布局
- ui: 使用 cordis 进行生命周期管理(移除旧 bus)
- blog: 移动功能到独立的 `@hydrooj/blog` 插件
- core: 支持动态设置
- judge: 性能模式(关闭单点回调)
- ui: 支持为作业设置维护者
- core: 放行提交答案题至提交语言白名单
- import-qduoj: 修复空标签导致无法导入的问题
- ui: 精简 serviceworker 逻辑
- ui: 修复训练计划加入失败的问题
- core: 简化 user 返回字段列表
- core&ui: contest.rule.ioi.strict
- 其他漏洞修复和体验优化
### Hydro 4.7.3 / UI 4.47.3 ### Hydro 4.7.3 / UI 4.47.3
- core: 修复无输入自测 - core: 修复无输入自测
- core: 修复 endpointForUser 域名不一致导致的 token 无效问题 - core: 修复 endpointForUser 域名不一致导致的 token 无效问题
+2 -2
View File
@@ -36,8 +36,8 @@
"@types/node": "^18.14.1", "@types/node": "^18.14.1",
"@types/semver": "^7.3.13", "@types/semver": "^7.3.13",
"@types/supertest": "^2.0.12", "@types/supertest": "^2.0.12",
"@typescript-eslint/eslint-plugin": "^5.53.0", "@typescript-eslint/eslint-plugin": "^5.54.0",
"@typescript-eslint/parser": "^5.53.0", "@typescript-eslint/parser": "^5.54.0",
"autocannon": "^7.10.0", "autocannon": "^7.10.0",
"cac": "^6.7.14", "cac": "^6.7.14",
"chokidar": "^3.5.3", "chokidar": "^3.5.3",
+1 -3
View File
@@ -1,14 +1,13 @@
{ {
"name": "@hydrooj/hydrojudge", "name": "@hydrooj/hydrojudge",
"bin": "bin/hydrojudge.js", "bin": "bin/hydrojudge.js",
"version": "3.1.18", "version": "3.1.19",
"main": "package.json", "main": "package.json",
"author": "undefined <i@undefined.moe>", "author": "undefined <i@undefined.moe>",
"repository": "https://github.com/hydro-dev/Hydro.git", "repository": "https://github.com/hydro-dev/Hydro.git",
"dependencies": { "dependencies": {
"@hydrooj/utils": "workspace:*", "@hydrooj/utils": "workspace:*",
"cac": "^6.7.14", "cac": "^6.7.14",
"fs-extra": "^11.1.0",
"mongodb": "^5.1.0", "mongodb": "^5.1.0",
"p-queue": "^7.3.4", "p-queue": "^7.3.4",
"schemastery": "^3.7.1", "schemastery": "^3.7.1",
@@ -19,7 +18,6 @@
"preferUnplugged": true, "preferUnplugged": true,
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
"devDependencies": { "devDependencies": {
"@types/fs-extra": "^11.0.1",
"@types/shell-quote": "^1.7.1", "@types/shell-quote": "^1.7.1",
"@types/ws": "^8.5.4" "@types/ws": "^8.5.4"
} }
+1 -1
View File
@@ -2,7 +2,7 @@ import './utils';
import path from 'path'; import path from 'path';
import cac from 'cac'; import cac from 'cac';
import fs from 'fs-extra'; import { fs } from '@hydrooj/utils';
import { getConfig } from './config'; import { getConfig } from './config';
import { Logger } from './log'; import { Logger } from './log';
+3 -3
View File
@@ -1,9 +1,9 @@
/* eslint-disable no-await-in-loop */ /* eslint-disable no-await-in-loop */
import path from 'path'; import path from 'path';
import fs from 'fs-extra'; import {
changeErrorType, fs, normalizeSubtasks, readSubtasksFromFiles, yaml,
} from '@hydrooj/utils';
import readYamlCases, { convertIniConfig } from '@hydrooj/utils/lib/cases'; import readYamlCases, { convertIniConfig } from '@hydrooj/utils/lib/cases';
import { normalizeSubtasks, readSubtasksFromFiles } from '@hydrooj/utils/lib/common';
import { changeErrorType, yaml } from '@hydrooj/utils/lib/utils';
import { ProblemConfigFile } from 'hydrooj'; import { ProblemConfigFile } from 'hydrooj';
import { getConfig } from './config'; import { getConfig } from './config';
import { FormatError, SystemError } from './error'; import { FormatError, SystemError } from './error';
+1 -2
View File
@@ -1,9 +1,8 @@
import os from 'os'; import os from 'os';
import path from 'path'; import path from 'path';
import cac from 'cac'; import cac from 'cac';
import fs from 'fs-extra';
import Schema from 'schemastery'; import Schema from 'schemastery';
import { yaml } from '@hydrooj/utils'; import { fs, yaml } from '@hydrooj/utils';
const argv = cac().parse(); const argv = cac().parse();
+1 -1
View File
@@ -15,8 +15,8 @@
~ */ ~ */
import './utils'; import './utils';
import fs from 'fs-extra';
import PQueue from 'p-queue'; import PQueue from 'p-queue';
import { fs } from '@hydrooj/utils';
import { getConfig } from './config'; import { getConfig } from './config';
import HydroHost from './hosts/hydro'; import HydroHost from './hosts/hydro';
import log from './log'; import log from './log';
+1 -1
View File
@@ -1,7 +1,7 @@
// Hydro Integration // Hydro Integration
/* eslint-disable no-await-in-loop */ /* eslint-disable no-await-in-loop */
import path from 'path'; import path from 'path';
import fs from 'fs-extra'; import { fs } from '@hydrooj/utils';
import { import {
JudgeResultBody, RecordModel, SettingModel, JudgeResultBody, RecordModel, SettingModel,
StorageModel, SystemModel, TaskModel, StorageModel, SystemModel, TaskModel,
+1 -1
View File
@@ -1,10 +1,10 @@
/* eslint-disable no-await-in-loop */ /* eslint-disable no-await-in-loop */
import path from 'path'; import path from 'path';
import fs from 'fs-extra';
import { ObjectId } from 'mongodb'; import { ObjectId } from 'mongodb';
import PQueue from 'p-queue'; import PQueue from 'p-queue';
import superagent from 'superagent'; import superagent from 'superagent';
import WebSocket from 'ws'; import WebSocket from 'ws';
import { fs } from '@hydrooj/utils';
import { LangConfig } from '@hydrooj/utils/lib/lang'; import { LangConfig } from '@hydrooj/utils/lib/lang';
import * as sysinfo from '@hydrooj/utils/lib/sysinfo'; import * as sysinfo from '@hydrooj/utils/lib/sysinfo';
import type { JudgeResultBody } from 'hydrooj'; import type { JudgeResultBody } from 'hydrooj';
+2 -2
View File
@@ -1,6 +1,6 @@
/* eslint-disable no-sequences */ /* eslint-disable no-sequences */
import { unlinkSync } from 'fs';
import { basename } from 'path'; import { basename } from 'path';
import { fs } from '@hydrooj/utils';
import { STATUS } from '@hydrooj/utils/lib/status'; import { STATUS } from '@hydrooj/utils/lib/status';
import checkers from '../checkers'; import checkers from '../checkers';
import compile, { compileChecker, compileValidator } from '../compile'; import compile, { compileChecker, compileValidator } from '../compile';
@@ -26,7 +26,7 @@ export async function judge(ctx: Context) {
compileValidator(session.getLang, config.validator, judgeExtraFiles).then(markCleanup), compileValidator(session.getLang, config.validator, judgeExtraFiles).then(markCleanup),
ctx.session.fetchFile(ctx.files.hack), ctx.session.fetchFile(ctx.files.hack),
]); ]);
ctx.clean.push(async () => unlinkSync(input)); ctx.clean.push(() => fs.unlink(input));
ctx.next({ status: STATUS.STATUS_JUDGING, progress: 0 }); ctx.next({ status: STATUS.STATUS_JUDGING, progress: 0 });
const validateResult = await run( const validateResult = await run(
validator.execute, validator.execute,
+2 -3
View File
@@ -1,6 +1,5 @@
import assert from 'assert'; import assert from 'assert';
import { readFile } from 'fs-extra'; import { fs, yaml } from '@hydrooj/utils';
import { yaml } from '@hydrooj/utils';
import { STATUS } from '@hydrooj/utils/lib/status'; import { STATUS } from '@hydrooj/utils/lib/status';
import { FormatError } from '../error'; import { FormatError } from '../error';
import { Context } from './interface'; import { Context } from './interface';
@@ -10,7 +9,7 @@ export async function judge({
}: Context) { }: Context) {
next({ status: STATUS.STATUS_JUDGING, progress: 0 }); next({ status: STATUS.STATUS_JUDGING, progress: 0 });
const answer = ('src' in code) const answer = ('src' in code)
? await readFile(code.src, 'utf-8') ? await fs.readFile(code.src, 'utf-8')
: ('content' in code) : ('content' in code)
? code.content.toString().replace(/\r/g, '') ? code.content.toString().replace(/\r/g, '')
: ''; : '';
@@ -1,5 +1,5 @@
import { basename } from 'path'; import { basename } from 'path';
import { readFile } from 'fs-extra'; import { fs } from '@hydrooj/utils';
import { STATUS } from '@hydrooj/utils/lib/status'; import { STATUS } from '@hydrooj/utils/lib/status';
import checkers from '../checkers'; import checkers from '../checkers';
import { compileChecker } from '../compile'; import { compileChecker } from '../compile';
@@ -13,7 +13,7 @@ function judgeCase(c: NormalizedCase) {
const chars = /[a-zA-Z0-9_.-]/; const chars = /[a-zA-Z0-9_.-]/;
const name = (ctx.config.filename && /^[a-zA-Z0-9-_#.]+$/.test(ctx.config.filename)) const name = (ctx.config.filename && /^[a-zA-Z0-9-_#.]+$/.test(ctx.config.filename))
? ctx.config.filename.replace('#', c.id.toString()) ? ctx.config.filename.replace('#', c.id.toString())
: await readFile(c.input, 'utf-8').then((res) => res.trim().split('').filter((i) => chars.test(i)).join('')); : await fs.readFile(c.input, 'utf-8').then((res) => res.trim().split('').filter((i) => chars.test(i)).join(''));
let file = ctx.code; let file = ctx.code;
let status = STATUS.STATUS_ACCEPTED; let status = STATUS.STATUS_ACCEPTED;
let message: any = ''; let message: any = '';
+1 -1
View File
@@ -1,4 +1,4 @@
import fs from 'fs-extra'; import { fs } from '@hydrooj/utils';
import { LangConfig } from '@hydrooj/utils/lib/lang'; import { LangConfig } from '@hydrooj/utils/lib/lang';
import { STATUS } from '@hydrooj/utils/lib/status'; import { STATUS } from '@hydrooj/utils/lib/status';
import type { import type {
+1 -2
View File
@@ -1,7 +1,6 @@
import path from 'path'; import path from 'path';
import fs from 'fs-extra';
import { parse } from 'shell-quote'; import { parse } from 'shell-quote';
import { sleep } from '@hydrooj/utils/lib/utils'; import { fs, sleep } from '@hydrooj/utils';
import { FormatError } from './error'; import { FormatError } from './error';
const EMPTY_STR = /^[ \r\n\t]*$/i; const EMPTY_STR = /^[ \r\n\t]*$/i;
+6 -6
View File
@@ -1,6 +1,6 @@
{ {
"name": "hydrooj", "name": "hydrooj",
"version": "4.7.9", "version": "4.8.0",
"bin": "bin/hydrooj.js", "bin": "bin/hydrooj.js",
"main": "src/plugin-api", "main": "src/plugin-api",
"module": "src/plugin-api", "module": "src/plugin-api",
@@ -12,11 +12,11 @@
}, },
"preferUnplugged": true, "preferUnplugged": true,
"dependencies": { "dependencies": {
"@aws-sdk/client-s3": "^3.279.0", "@aws-sdk/client-s3": "^3.282.0",
"@aws-sdk/lib-storage": "^3.279.0", "@aws-sdk/lib-storage": "^3.282.0",
"@aws-sdk/middleware-endpoint": "^3.272.0", "@aws-sdk/middleware-endpoint": "^3.282.0",
"@aws-sdk/s3-presigned-post": "^3.279.0", "@aws-sdk/s3-presigned-post": "^3.282.0",
"@aws-sdk/s3-request-presigner": "^3.279.0", "@aws-sdk/s3-request-presigner": "^3.282.0",
"@graphql-tools/schema": "^9.0.16", "@graphql-tools/schema": "^9.0.16",
"@hydrooj/utils": "workspace:*", "@hydrooj/utils": "workspace:*",
"@simplewebauthn/server": "^7.0.1", "@simplewebauthn/server": "^7.0.1",
+6 -2
View File
@@ -94,8 +94,12 @@ class UserLoginHandler extends Handler {
let udoc = await user.getByEmail(domainId, uname); let udoc = await user.getByEmail(domainId, uname);
udoc ||= await user.getByUname(domainId, uname); udoc ||= await user.getByUname(domainId, uname);
if (!udoc) throw new UserNotFoundError(uname); if (!udoc) throw new UserNotFoundError(uname);
if (system.get('system.contestmode') && udoc._loginip && udoc._loginip !== this.request.ip) { if (system.get('system.contestmode') && !udoc.hasPriv(PRIV.PRIV_EDIT_SYSTEM)) {
if (!udoc.hasPriv(PRIV.PRIV_EDIT_SYSTEM)) throw new ValidationError('ip'); if (udoc._loginip && udoc._loginip !== this.request.ip) throw new ValidationError('ip');
if (system.get('system.contestmode') === 'strict') {
const udocs = await user.getMulti({ loginip: this.request.ip, _id: { $ne: udoc._id } }).toArray();
if (udocs.length) throw new ValidationError('ip');
}
} }
await Promise.all([ await Promise.all([
this.limitRate('user_login', 60, 30, false), this.limitRate('user_login', 60, 30, false),
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@hydrooj/migrate", "name": "@hydrooj/migrate",
"version": "0.2.2", "version": "0.2.3",
"main": "index.ts", "main": "index.ts",
"repository": "git@github.com:hydro-dev/Hydro.git", "repository": "git@github.com:hydro-dev/Hydro.git",
"author": "undefined <i@undefined.moe>", "author": "undefined <i@undefined.moe>",
@@ -94,7 +94,7 @@ monaco.languages.registerCompletionItemProvider('markdown', {
suggestions: users.map((i) => ({ suggestions: users.map((i) => ({
label: { label: `@${i.uname}`, description: `UID=${i._id}` }, label: { label: `@${i.uname}`, description: `UID=${i._id}` },
kind: monaco.languages.CompletionItemKind.Property, kind: monaco.languages.CompletionItemKind.Property,
documentation: { value: `[](#loader) ![avatar](${i.avatarUrl})`, isTrusted: true }, documentation: { value: `[](#loader) ![avatar](${new URL(i.avatarUrl, window.location.href)})`, isTrusted: true },
insertText: `@[](/user/${i._id}) `, insertText: `@[](/user/${i._id}) `,
range, range,
sortText: i.priv === 0 ? '0' : '1', sortText: i.priv === 0 ? '0' : '1',
+3 -3
View File
@@ -1,6 +1,6 @@
{ {
"name": "@hydrooj/ui-default", "name": "@hydrooj/ui-default",
"version": "4.47.5", "version": "4.47.6",
"author": "undefined <i@undefined.moe>", "author": "undefined <i@undefined.moe>",
"license": "AGPL-3.0", "license": "AGPL-3.0",
"main": "index.ts", "main": "index.ts",
@@ -14,7 +14,7 @@
"cli": false "cli": false
}, },
"devDependencies": { "devDependencies": {
"@blueprintjs/core": "4.15.1", "@blueprintjs/core": "4.17.4",
"@fontsource/dm-mono": "^4.5.10", "@fontsource/dm-mono": "^4.5.10",
"@fontsource/fira-code": "^4.5.13", "@fontsource/fira-code": "^4.5.13",
"@fontsource/inconsolata": "^4.5.10", "@fontsource/inconsolata": "^4.5.10",
@@ -66,7 +66,7 @@
"jquery.transit": "^0.9.12", "jquery.transit": "^0.9.12",
"matchmedia-polyfill": "^0.3.2", "matchmedia-polyfill": "^0.3.2",
"moment": "^2.29.4", "moment": "^2.29.4",
"monaco-editor": "0.33.0", "monaco-editor": "0.36.1",
"monaco-editor-nls": "^2.0.0", "monaco-editor-nls": "^2.0.0",
"monaco-themes": "^0.4.3", "monaco-themes": "^0.4.3",
"monaco-yaml": "^4.0.4", "monaco-yaml": "^4.0.4",
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "@hydrooj/utils", "name": "@hydrooj/utils",
"version": "1.4.8", "version": "1.4.9",
"description": "hydrooj utils", "description": "hydrooj utils",
"main": "lib/utils.ts", "main": "lib/utils.ts",
"repository": "https://github.com/hydro-dev/Hydro.git", "repository": "https://github.com/hydro-dev/Hydro.git",
@@ -16,7 +16,7 @@
"mongodb": "^5.1.0", "mongodb": "^5.1.0",
"reggol": "^1.3.5", "reggol": "^1.3.5",
"source-map-support": "^0.5.21", "source-map-support": "^0.5.21",
"systeminformation": "^5.17.10" "systeminformation": "^5.17.12"
}, },
"devDependencies": { "devDependencies": {
"@types/fs-extra": "^11.0.1", "@types/fs-extra": "^11.0.1",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@hydrooj/vjudge", "name": "@hydrooj/vjudge",
"version": "1.8.3", "version": "1.8.4",
"description": "Submit problems to remote oj", "description": "Submit problems to remote oj",
"main": "src/model.ts", "main": "src/model.ts",
"repository": "https://github.com/hydro-dev/Hydro.git", "repository": "https://github.com/hydro-dev/Hydro.git",