mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
bug fix
This commit is contained in:
1 parent
1f1d12ad73
commit
8389519249
4 files changed
+3
-15
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hydrooj",
|
||||
"version": "2.12.1",
|
||||
"version": "2.12.2",
|
||||
"main": "dist/loader.js",
|
||||
"bin": "bin/hydrooj.js",
|
||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||
|
||||
@@ -38,17 +38,6 @@ const checks: Dictionary<CheckItem> = {
|
||||
const from = await system.get('smtp.from');
|
||||
if (!from) warn('SMTP account was not provided, email verification disabled.');
|
||||
},
|
||||
async checkProxy(ctx, log, warn) {
|
||||
const [github, google, proxy] = await system.getMany([
|
||||
'oauth.githubappid', 'oauth.googleappid', 'proxy',
|
||||
]);
|
||||
if (proxy) {
|
||||
superagent.get('https://www.google.com/').timeout(10000).proxy(proxy)
|
||||
.catch(() => warn('The proxy configured seem to be invalid.'));
|
||||
} else if (github || google) {
|
||||
warn('OAuth enabled. But for well-known reasons, a proxy is required.');
|
||||
}
|
||||
},
|
||||
async checkIpHeader(ctx, log, warn) {
|
||||
const header = await system.get('server.xff');
|
||||
if (header && !ctx.request.ip) warn('IP header seems incorrect.\nCheck dashboard>settings>server.');
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
} from './common';
|
||||
|
||||
export async function load() {
|
||||
let pending = global.addons;
|
||||
const pending = global.addons;
|
||||
const fail = [];
|
||||
const active = [];
|
||||
require('../lib/i18n');
|
||||
@@ -49,7 +49,6 @@ export async function load() {
|
||||
for (const i of builtinScript) require(`../script/${i}`);
|
||||
await script(pending, fail, active);
|
||||
for (const postInit of global.Hydro.postInit) await postInit();
|
||||
pending = [];
|
||||
await server.start();
|
||||
setInterval(() => {
|
||||
process.send({ event: 'stat', count: global.Hydro.stat.reqCount });
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { ValidationError } from '../error';
|
||||
|
||||
const RE_UID = /^-?\d+$/i;
|
||||
const RE_PID = /^([a-zA-Z]+[a-zA-Z0-9]*)|$/i;
|
||||
const RE_PID = /^[a-zA-Z]+[a-zA-Z0-9]*$/i;
|
||||
const RE_UNAME = /[^\s\u3000](.{,254}[^\s\u3000])?$/i;
|
||||
const RE_ROLE = /^[_0-9A-Za-z]{1,256}$/i;
|
||||
const RE_MAIL = /^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)+$/i;
|
||||
|
||||
Reference in new issue
Block a user