mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
bump version
This commit is contained in:
43 files changed
+96
-53
No files matched your search
@@ -0,0 +1,22 @@
|
|||||||
|
cff-version: 1.2.0
|
||||||
|
title: Hydro
|
||||||
|
message: >-
|
||||||
|
If you use this software, please cite it using the
|
||||||
|
metadata from this file.
|
||||||
|
type: software
|
||||||
|
authors:
|
||||||
|
- given-names: Yi
|
||||||
|
family-names: Huang
|
||||||
|
email: i@undefined.moe
|
||||||
|
- given-names: Haojun
|
||||||
|
family-names: Pan
|
||||||
|
email: panda@hydro.ac
|
||||||
|
- name: All Hydro Project Developers
|
||||||
|
repository-code: 'https://github.com/hydro-dev/Hydro'
|
||||||
|
url: 'https://hydro.js.org'
|
||||||
|
keywords:
|
||||||
|
- Online Judge
|
||||||
|
- ICPC
|
||||||
|
- OI
|
||||||
|
- Competitive Programming
|
||||||
|
license: AGPL-3.0-or-later
|
||||||
@@ -111,7 +111,7 @@ Hydro 用户群:1085853538
|
|||||||
<details>
|
<details>
|
||||||
<summary><h2>更新日志(点击展开)</h2></summary>
|
<summary><h2>更新日志(点击展开)</h2></summary>
|
||||||
|
|
||||||
## Unreleased
|
## Hydro 5.0.0-beta.0 / UI 4.58.0-beta.0
|
||||||
|
|
||||||
- judge: 添加 checker 编译缓存
|
- judge: 添加 checker 编译缓存
|
||||||
- ui: 优化题目详情页面 OGP 信息
|
- ui: 优化题目详情页面 OGP 信息
|
||||||
@@ -135,6 +135,8 @@ Hydro 用户群:1085853538
|
|||||||
- core: 支持存储并显示提交记录重测历史
|
- core: 支持存储并显示提交记录重测历史
|
||||||
- core: 新的加域逻辑
|
- core: 新的加域逻辑
|
||||||
- ui: UserSelect.Multi: 支持批量粘贴用户名
|
- ui: UserSelect.Multi: 支持批量粘贴用户名
|
||||||
|
- ui: 修复在线 IDE 右键菜单
|
||||||
|
- ui: 修复未登录用户查看题目文件页
|
||||||
- core: oauth: 支持绑定/解绑三方平台账户 (#971)
|
- core: oauth: 支持绑定/解绑三方平台账户 (#971)
|
||||||
- ui: 修复暗色模式表格边框 (#968)
|
- ui: 修复暗色模式表格边框 (#968)
|
||||||
- core: 优化 icpc 题目包导入 (#966)
|
- core: 优化 icpc 题目包导入 (#966)
|
||||||
@@ -154,6 +156,9 @@ Hydro 用户群:1085853538
|
|||||||
- core: 升级至 Mongo Driver 6
|
- core: 升级至 Mongo Driver 6
|
||||||
- core: 移除 registerResolver, registerValue, registerUnion (使用 ctx.api.resolver/...)
|
- core: 移除 registerResolver, registerValue, registerUnion (使用 ctx.api.resolver/...)
|
||||||
- core: 移除 paginate, rank (使用 ctx.db.paginate, ctx.db.ranked)
|
- core: 移除 paginate, rank (使用 ctx.db.paginate, ctx.db.ranked)
|
||||||
|
- core: 移除 setting.yaml
|
||||||
|
- core: oauth: 改为使用 ctx.oauth.provide() 注册
|
||||||
|
- framework: 移除 ready 与 dispose 事件 (使用 ctx.effect 代替)
|
||||||
|
|
||||||
## Hydro 4.19.0 / UI 4.57.0
|
## Hydro 4.19.0 / UI 4.57.0
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/eslint-config",
|
"name": "@hydrooj/eslint-config",
|
||||||
"version": "1.1.2",
|
"version": "2.0.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"main": "base.mjs",
|
"main": "base.mjs",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint-react/eslint-plugin": "^1.40.0",
|
"@eslint-react/eslint-plugin": "^1.40.1",
|
||||||
"@eslint/compat": "^1.2.7",
|
"@eslint/compat": "^1.2.8",
|
||||||
"@eslint/eslintrc": "^3.3.1",
|
"@eslint/eslintrc": "^3.3.1",
|
||||||
"@stylistic/eslint-plugin": "^4.2.0",
|
"@stylistic/eslint-plugin": "^4.2.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.29.0",
|
"@typescript-eslint/eslint-plugin": "^8.29.0",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/framework",
|
"name": "@hydrooj/framework",
|
||||||
"version": "0.2.0-alpha.0",
|
"version": "0.2.0-beta.0",
|
||||||
"main": "index.ts",
|
"main": "index.ts",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
|||||||
@@ -424,7 +424,7 @@ ${c.response.status} ${endTime - startTime}ms ${c.response.length}`);
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.ctx.on('dispose', () => {
|
this.ctx.effect(() => () => {
|
||||||
fs.emptyDirSync(uploadDir);
|
fs.emptyDirSync(uploadDir);
|
||||||
});
|
});
|
||||||
// if killed by ctrl-c, on('dispose') will not be called
|
// if killed by ctrl-c, on('dispose') will not be called
|
||||||
@@ -461,17 +461,17 @@ ${c.response.status} ${endTime - startTime}ms ${c.response.length}`);
|
|||||||
} catch (e) { }
|
} catch (e) { }
|
||||||
});
|
});
|
||||||
socket.pause();
|
socket.pause();
|
||||||
const c: any = koa.createContext(request, {} as any); // eslint-disable-line
|
const KoaContext: any = koa.createContext(request, {} as any);
|
||||||
await executeMiddlewareStack(c, this.wsLayers);
|
await executeMiddlewareStack(KoaContext, this.wsLayers);
|
||||||
for (const manager of router.wsStack) {
|
for (const manager of router.wsStack) {
|
||||||
if (manager.accept(socket, request, c)) return;
|
if (manager.accept(socket, request, KoaContext)) return;
|
||||||
}
|
}
|
||||||
socket.close();
|
socket.close();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async listen() {
|
async listen() {
|
||||||
this.ctx.on('dispose', () => {
|
this.ctx.effect(() => () => {
|
||||||
httpServer.close();
|
httpServer.close();
|
||||||
wsServer.close();
|
wsServer.close();
|
||||||
});
|
});
|
||||||
@@ -727,7 +727,7 @@ ${c.response.status} ${endTime - startTime}ms ${c.response.length}`);
|
|||||||
const dispose = router.disposeLastOp;
|
const dispose = router.disposeLastOp;
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
this.ctx.parallel(`handler/register/${name}`, HandlerClass);
|
this.ctx.parallel(`handler/register/${name}`, HandlerClass);
|
||||||
this.ctx.on('dispose', () => {
|
this.ctx.effect(() => () => {
|
||||||
this.registrationCount[name]--;
|
this.registrationCount[name]--;
|
||||||
if (!this.registrationCount[name]) delete this.registry[name];
|
if (!this.registrationCount[name]) delete this.registry[name];
|
||||||
dispose();
|
dispose();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/blog",
|
"name": "@hydrooj/blog",
|
||||||
"version": "0.0.4",
|
"version": "0.1.0-beta.0",
|
||||||
"license": "AGPL-3.0-or-later"
|
"license": "AGPL-3.0-or-later"
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/common",
|
"name": "@hydrooj/common",
|
||||||
"main": "./index.ts",
|
"main": "./index.ts",
|
||||||
"version": "0.0.1",
|
"version": "0.0.2",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@hydrooj/utils": "workspace:^"
|
"@hydrooj/utils": "workspace:^"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/components",
|
"name": "@hydrooj/components",
|
||||||
"version": "1.0.0-alpha.0",
|
"version": "1.0.0-beta.0",
|
||||||
"main": "./frontend/index.ts",
|
"main": "./frontend/index.ts",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"diff": "^7.0.0",
|
"diff": "^7.0.0",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/elastic-search",
|
"name": "@hydrooj/elastic-search",
|
||||||
"version": "1.2.0-alpha.0",
|
"version": "1.2.0-beta.0",
|
||||||
"main": "index.ts",
|
"main": "index.ts",
|
||||||
"repository": "https://github.com/hydro-dev/Hydro",
|
"repository": "https://github.com/hydro-dev/Hydro",
|
||||||
"author": "undefined <i@undefined.moe>",
|
"author": "undefined <i@undefined.moe>",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/fps-importer",
|
"name": "@hydrooj/fps-importer",
|
||||||
"version": "1.5.14",
|
"version": "1.6.0-beta.0",
|
||||||
"description": "Import FPS problems",
|
"description": "Import FPS problems",
|
||||||
"main": "index.ts",
|
"main": "index.ts",
|
||||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/geoip",
|
"name": "@hydrooj/geoip",
|
||||||
"version": "1.3.3",
|
"version": "1.4.0-beta.0",
|
||||||
"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>",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/hydrojudge",
|
"name": "@hydrooj/hydrojudge",
|
||||||
"bin": "bin/hydrojudge.js",
|
"bin": "bin/hydrojudge.js",
|
||||||
"version": "3.5.0-alpha.0",
|
"version": "3.5.0-beta.0",
|
||||||
"main": "./src/index.ts",
|
"main": "./src/index.ts",
|
||||||
"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",
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import { JudgeSettings, overrideConfig } from './config';
|
|||||||
export const Config = JudgeSettings;
|
export const Config = JudgeSettings;
|
||||||
|
|
||||||
export function apply(ctx: Context, config: ReturnType<typeof Config>) {
|
export function apply(ctx: Context, config: ReturnType<typeof Config>) {
|
||||||
if (process.env.NODE_APP_INSTANCE !== '0') return;
|
|
||||||
overrideConfig(config);
|
overrideConfig(config);
|
||||||
|
if (process.env.NODE_APP_INSTANCE !== '0') return;
|
||||||
// eslint-disable-next-line consistent-return
|
// eslint-disable-next-line consistent-return
|
||||||
if (!config.disable) return require('./hosts/builtin').apply(ctx);
|
if (!config.disable) return require('./hosts/builtin').apply(ctx);
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "5.0.0-alpha.0",
|
"version": "5.0.0-beta.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",
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ export async function load(ctx: Context) {
|
|||||||
await ctx.plugin(ConfigService);
|
await ctx.plugin(ConfigService);
|
||||||
await require('../model/system').runConfig();
|
await require('../model/system').runConfig();
|
||||||
ctx = await new Promise((resolve) => {
|
ctx = await new Promise((resolve) => {
|
||||||
ctx.inject(['loader', 'config'], (c) => {
|
ctx.inject(['loader', 'config', 'db'], (c) => {
|
||||||
resolve(c);
|
resolve(c);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ export async function apply(ctx: Context) {
|
|||||||
const modelSystem = require('../model/system');
|
const modelSystem = require('../model/system');
|
||||||
await modelSystem.runConfig();
|
await modelSystem.runConfig();
|
||||||
ctx = await new Promise((resolve) => {
|
ctx = await new Promise((resolve) => {
|
||||||
ctx.inject(['loader', 'config'], (c) => {
|
ctx.inject(['loader', 'config', 'db'], (c) => {
|
||||||
resolve(c);
|
resolve(c);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -437,8 +437,9 @@ class OauthCallbackHandler extends Handler {
|
|||||||
noCheckPermView = true;
|
noCheckPermView = true;
|
||||||
|
|
||||||
async get(args: any) {
|
async get(args: any) {
|
||||||
if (!this.ctx.oauth.providers[args.type]) throw new UserFacingError('Oauth type');
|
const provider = this.ctx.oauth.providers[args.type];
|
||||||
const r = await this.ctx.oauth.providers[args.type].callback.call(this, args);
|
if (!provider) throw new UserFacingError('Oauth type');
|
||||||
|
const r = await provider.callback.call(this, args);
|
||||||
if (this.session.oauthBind === args.type) {
|
if (this.session.oauthBind === args.type) {
|
||||||
delete this.session.oauthBind;
|
delete this.session.oauthBind;
|
||||||
const existing = await this.ctx.oauth.get(args.type, r._id);
|
const existing = await this.ctx.oauth.get(args.type, r._id);
|
||||||
@@ -456,6 +457,7 @@ class OauthCallbackHandler extends Handler {
|
|||||||
this.response.redirect = '/';
|
this.response.redirect = '/';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!provider.canRegister) throw new ForbiddenError('No binded account found');
|
||||||
this.checkPriv(PRIV.PRIV_REGISTER_USER);
|
this.checkPriv(PRIV.PRIV_REGISTER_USER);
|
||||||
let username = '';
|
let username = '';
|
||||||
r.uname ||= [];
|
r.uname ||= [];
|
||||||
|
|||||||
@@ -31,12 +31,12 @@ class BlackListModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function apply(ctx: Context) {
|
export async function apply(ctx: Context) {
|
||||||
coll = db.collection('blacklist');
|
coll = ctx.db.collection('blacklist');
|
||||||
ctx.on('ready', () => db.ensureIndexes(
|
await ctx.db.ensureIndexes(
|
||||||
coll,
|
coll,
|
||||||
{ key: { expireAt: -1 }, name: 'expire', expireAfterSeconds: 0 },
|
{ key: { expireAt: -1 }, name: 'expire', expireAfterSeconds: 0 },
|
||||||
));
|
);
|
||||||
}
|
}
|
||||||
export default BlackListModel;
|
export default BlackListModel;
|
||||||
global.Hydro.model.blacklist = BlackListModel;
|
global.Hydro.model.blacklist = BlackListModel;
|
||||||
@@ -34,6 +34,7 @@ export interface OAuthProvider {
|
|||||||
hidden?: boolean;
|
hidden?: boolean;
|
||||||
get: (this: Handler) => Promise<void>;
|
get: (this: Handler) => Promise<void>;
|
||||||
callback: (this: Handler, args: Record<string, any>) => Promise<OAuthUserResponse>;
|
callback: (this: Handler, args: Record<string, any>) => Promise<OAuthUserResponse>;
|
||||||
|
canRegister?: boolean;
|
||||||
lockUsername?: boolean;
|
lockUsername?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Filter } from 'mongodb';
|
import { Filter } from 'mongodb';
|
||||||
|
import { Context } from '../context';
|
||||||
import { TokenDoc } from '../interface';
|
import { TokenDoc } from '../interface';
|
||||||
import bus from '../service/bus';
|
|
||||||
import db from '../service/db';
|
import db from '../service/db';
|
||||||
import { ArgMethod } from '../utils';
|
import { ArgMethod } from '../utils';
|
||||||
|
|
||||||
@@ -107,10 +107,12 @@ class TokenModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bus.on('ready', () => db.ensureIndexes(
|
export async function apply(ctx: Context) {
|
||||||
TokenModel.coll,
|
await ctx.db.ensureIndexes(
|
||||||
{ key: { uid: 1, tokenType: 1, updateAt: -1 }, name: 'basic', sparse: true },
|
TokenModel.coll,
|
||||||
{ key: { expireAt: -1 }, name: 'expire', expireAfterSeconds: 0 },
|
{ key: { uid: 1, tokenType: 1, updateAt: -1 }, name: 'basic', sparse: true },
|
||||||
));
|
{ key: { expireAt: -1 }, name: 'expire', expireAfterSeconds: 0 },
|
||||||
|
);
|
||||||
|
}
|
||||||
export default TokenModel;
|
export default TokenModel;
|
||||||
global.Hydro.model.token = TokenModel;
|
global.Hydro.model.token = TokenModel;
|
||||||
@@ -104,7 +104,7 @@ class ApiService extends Service {
|
|||||||
constructor(ctx: Context) {
|
constructor(ctx: Context) {
|
||||||
super(ctx, 'api');
|
super(ctx, 'api');
|
||||||
this.rebuild = debounce(this.rebuild.bind(this), 500, { trailing: true });
|
this.rebuild = debounce(this.rebuild.bind(this), 500, { trailing: true });
|
||||||
ctx.on('ready', this.rebuild);
|
this.rebuild();
|
||||||
}
|
}
|
||||||
|
|
||||||
private rebuild() {
|
private rebuild() {
|
||||||
|
|||||||
@@ -178,10 +178,10 @@ export class MongoService extends Service {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** @deprecated use ctx.db instead */
|
/** @deprecated use ctx.db instead */
|
||||||
const db = new Proxy({} as MongoService, {
|
const deprecatedDb = new Proxy({} as MongoService, {
|
||||||
get(target, prop) {
|
get(target, prop) {
|
||||||
return app.get('db')?.[prop];
|
return app.get('db')?.[prop];
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export default db;
|
export default deprecatedDb;
|
||||||
@@ -63,6 +63,7 @@ export default class MigrationService extends Service {
|
|||||||
dbVer++;
|
dbVer++;
|
||||||
await system.set(name, dbVer);
|
await system.set(name, dbVer);
|
||||||
}
|
}
|
||||||
|
logger.success('Database upgraded [%s]: current version %d', channel, dbVer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -11,6 +11,7 @@ async function terminate() {
|
|||||||
}, 1000);
|
}, 1000);
|
||||||
try {
|
try {
|
||||||
await bus.parallel('app/exit');
|
await bus.parallel('app/exit');
|
||||||
|
await app.scope.dispose();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
hasError = true;
|
hasError = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/import-hoj",
|
"name": "@hydrooj/import-hoj",
|
||||||
"version": "0.0.5",
|
"version": "0.0.6-beta.0",
|
||||||
"description": "Import HOJ problem export",
|
"description": "Import HOJ problem export",
|
||||||
"main": "index.ts",
|
"main": "index.ts",
|
||||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/import-qduoj",
|
"name": "@hydrooj/import-qduoj",
|
||||||
"version": "1.5.9",
|
"version": "1.6.0-beta.0",
|
||||||
"description": "Import QDUOJ problem export",
|
"description": "Import QDUOJ problem export",
|
||||||
"main": "index.ts",
|
"main": "index.ts",
|
||||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ export default class LoginWithGithubService extends Service {
|
|||||||
id: Schema.string().description('Github OAuth AppID').required(),
|
id: Schema.string().description('Github OAuth AppID').required(),
|
||||||
secret: Schema.string().description('Github OAuth Secret').role('secret').required(),
|
secret: Schema.string().description('Github OAuth Secret').role('secret').required(),
|
||||||
endpoint: Schema.string().description('Github Endpoint'),
|
endpoint: Schema.string().description('Github Endpoint'),
|
||||||
|
canRegister: Schema.boolean().default(true),
|
||||||
});
|
});
|
||||||
|
|
||||||
constructor(ctx: Context, config: ReturnType<typeof LoginWithGithubService.Config>) {
|
constructor(ctx: Context, config: ReturnType<typeof LoginWithGithubService.Config>) {
|
||||||
@@ -21,6 +22,7 @@ export default class LoginWithGithubService extends Service {
|
|||||||
text: 'Login with Github',
|
text: 'Login with Github',
|
||||||
name: 'Github',
|
name: 'Github',
|
||||||
icon,
|
icon,
|
||||||
|
canRegister: config.canRegister,
|
||||||
callback: async function callback({ state, code }) {
|
callback: async function callback({ state, code }) {
|
||||||
const s = await TokenModel.get(state, TokenModel.TYPE_OAUTH);
|
const s = await TokenModel.get(state, TokenModel.TYPE_OAUTH);
|
||||||
if (!s) throw new ValidationError('token');
|
if (!s) throw new ValidationError('token');
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/login-with-github",
|
"name": "@hydrooj/login-with-github",
|
||||||
"version": "0.2.0",
|
"version": "0.3.0-beta.0",
|
||||||
"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>",
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ export default class GoogleOAuthService extends Service {
|
|||||||
id: Schema.string().description('Google OAuth AppID').required(),
|
id: Schema.string().description('Google OAuth AppID').required(),
|
||||||
secret: Schema.string().description('Google OAuth Secret').role('secret').required(),
|
secret: Schema.string().description('Google OAuth Secret').role('secret').required(),
|
||||||
proxy: Schema.string().description('Google OAuth Proxy').role('proxy'),
|
proxy: Schema.string().description('Google OAuth Proxy').role('proxy'),
|
||||||
|
canRegister: Schema.boolean().default(true),
|
||||||
});
|
});
|
||||||
|
|
||||||
constructor(ctx: Context, config: ReturnType<typeof GoogleOAuthService.Config>) {
|
constructor(ctx: Context, config: ReturnType<typeof GoogleOAuthService.Config>) {
|
||||||
@@ -38,6 +39,7 @@ export default class GoogleOAuthService extends Service {
|
|||||||
ctx.oauth.provide('google', {
|
ctx.oauth.provide('google', {
|
||||||
text: 'Login with Google',
|
text: 'Login with Google',
|
||||||
name: 'Google',
|
name: 'Google',
|
||||||
|
canRegister: config.canRegister,
|
||||||
callback: async function callback(this: Handler, {
|
callback: async function callback(this: Handler, {
|
||||||
state, code, error,
|
state, code, error,
|
||||||
}) {
|
}) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/login-with-google",
|
"name": "@hydrooj/login-with-google",
|
||||||
"version": "0.2.0",
|
"version": "0.3.0-beta.0",
|
||||||
"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>",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/migrate",
|
"name": "@hydrooj/migrate",
|
||||||
"version": "0.4.4-alpha.0",
|
"version": "0.5.0-beta.0",
|
||||||
"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>",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/onlyoffice",
|
"name": "@hydrooj/onlyoffice",
|
||||||
"version": "1.4.5",
|
"version": "1.5.0-beta.0",
|
||||||
"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>",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/onsite-toolkit",
|
"name": "@hydrooj/onsite-toolkit",
|
||||||
"version": "0.0.5-alpha.0",
|
"version": "0.1.0-beta.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@react-spring/web": "^9.7.5",
|
"@react-spring/web": "^9.7.5",
|
||||||
"react-use": "^17.6.0"
|
"react-use": "^17.6.0"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/prom-client",
|
"name": "@hydrooj/prom-client",
|
||||||
"version": "0.2.0-alpha.0",
|
"version": "0.2.0-beta.0",
|
||||||
"main": "index.ts",
|
"main": "index.ts",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"prom-client": "^15.1.3"
|
"prom-client": "^15.1.3"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/scoreboard-xcpcio",
|
"name": "@hydrooj/scoreboard-xcpcio",
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
"version": "0.0.4",
|
"version": "0.0.5-beta.0",
|
||||||
"main": "index.ts",
|
"main": "index.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "node -r @hydrooj/register install.ts"
|
"postinstall": "node -r @hydrooj/register install.ts"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/sonic",
|
"name": "@hydrooj/sonic",
|
||||||
"version": "1.4.0-alpha.0",
|
"version": "1.4.0-beta.0",
|
||||||
"description": "Sonic search service",
|
"description": "Sonic search service",
|
||||||
"main": "index.ts",
|
"main": "index.ts",
|
||||||
"preferUnplugged": true,
|
"preferUnplugged": true,
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ export default class TelegramService extends Service {
|
|||||||
token: Schema.string().role('secret').required(),
|
token: Schema.string().role('secret').required(),
|
||||||
botLogin: Schema.string().required(),
|
botLogin: Schema.string().required(),
|
||||||
endpoint: Schema.string().default('https://api.telegram.org/bot'),
|
endpoint: Schema.string().default('https://api.telegram.org/bot'),
|
||||||
|
canRegister: Schema.boolean().default(false),
|
||||||
});
|
});
|
||||||
|
|
||||||
constructor(ctx: Context, config: ReturnType<typeof TelegramService.Config>) {
|
constructor(ctx: Context, config: ReturnType<typeof TelegramService.Config>) {
|
||||||
@@ -21,6 +22,7 @@ export default class TelegramService extends Service {
|
|||||||
text: 'Login with Telegram',
|
text: 'Login with Telegram',
|
||||||
name: 'Telegram',
|
name: 'Telegram',
|
||||||
icon,
|
icon,
|
||||||
|
canRegister: config.canRegister,
|
||||||
callback: async function callback({ payload }) {
|
callback: async function callback({ payload }) {
|
||||||
const parsed = JSON.parse(payload);
|
const parsed = JSON.parse(payload);
|
||||||
const hash = parsed.hash;
|
const hash = parsed.hash;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/telegram",
|
"name": "@hydrooj/telegram",
|
||||||
"version": "0.0.1"
|
"version": "0.0.2-beta.0"
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/ui-default",
|
"name": "@hydrooj/ui-default",
|
||||||
"version": "4.58.0-alpha.0",
|
"version": "4.58.0-beta.0",
|
||||||
"author": "undefined <i@undefined.moe>",
|
"author": "undefined <i@undefined.moe>",
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"main": "index.ts",
|
"main": "index.ts",
|
||||||
|
|||||||
@@ -52,7 +52,8 @@ export async function apply(ctx: Context) {
|
|||||||
render: async (name, args, context) => await vite.transformIndexHtml(context.handler.context.req.url, html),
|
render: async (name, args, context) => await vite.transformIndexHtml(context.handler.context.req.url, html),
|
||||||
});
|
});
|
||||||
|
|
||||||
ctx.on('dispose', async () => {
|
// eslint-disable-next-line consistent-return
|
||||||
|
return async () => {
|
||||||
await vite.close().catch((e) => console.error(e));
|
await vite.close().catch((e) => console.error(e));
|
||||||
});
|
};
|
||||||
}
|
}
|
||||||
@@ -12,6 +12,8 @@ import type * as superagent from 'superagent';
|
|||||||
export * as yaml from 'js-yaml';
|
export * as yaml from 'js-yaml';
|
||||||
export * as fs from 'fs-extra';
|
export * as fs from 'fs-extra';
|
||||||
|
|
||||||
|
Factory.formatters['d'] = (value, exporter) => Reggol.color(exporter, 3, value);
|
||||||
|
|
||||||
const factory = new Factory();
|
const factory = new Factory();
|
||||||
|
|
||||||
factory.addExporter(new Exporter.Console({
|
factory.addExporter(new Exporter.Console({
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/utils",
|
"name": "@hydrooj/utils",
|
||||||
"version": "1.4.34-alpha.0",
|
"version": "1.4.34-beta.0",
|
||||||
"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",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/vjudge",
|
"name": "@hydrooj/vjudge",
|
||||||
"version": "1.9.16",
|
"version": "1.10.0-beta.0",
|
||||||
"description": "Submit problems to remote oj",
|
"description": "Submit problems to remote oj",
|
||||||
"main": "./src/index.ts",
|
"main": "./src/index.ts",
|
||||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||||
|
|||||||
Reference in new issue
Block a user