mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +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",
|
"name": "hydrooj",
|
||||||
"version": "2.12.1",
|
"version": "2.12.2",
|
||||||
"main": "dist/loader.js",
|
"main": "dist/loader.js",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||||
|
|||||||
@@ -38,17 +38,6 @@ const checks: Dictionary<CheckItem> = {
|
|||||||
const from = await system.get('smtp.from');
|
const from = await system.get('smtp.from');
|
||||||
if (!from) warn('SMTP account was not provided, email verification disabled.');
|
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) {
|
async checkIpHeader(ctx, log, warn) {
|
||||||
const header = await system.get('server.xff');
|
const header = await system.get('server.xff');
|
||||||
if (header && !ctx.request.ip) warn('IP header seems incorrect.\nCheck dashboard>settings>server.');
|
if (header && !ctx.request.ip) warn('IP header seems incorrect.\nCheck dashboard>settings>server.');
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
} from './common';
|
} from './common';
|
||||||
|
|
||||||
export async function load() {
|
export async function load() {
|
||||||
let pending = global.addons;
|
const pending = global.addons;
|
||||||
const fail = [];
|
const fail = [];
|
||||||
const active = [];
|
const active = [];
|
||||||
require('../lib/i18n');
|
require('../lib/i18n');
|
||||||
@@ -49,7 +49,6 @@ export async function load() {
|
|||||||
for (const i of builtinScript) require(`../script/${i}`);
|
for (const i of builtinScript) require(`../script/${i}`);
|
||||||
await script(pending, fail, active);
|
await script(pending, fail, active);
|
||||||
for (const postInit of global.Hydro.postInit) await postInit();
|
for (const postInit of global.Hydro.postInit) await postInit();
|
||||||
pending = [];
|
|
||||||
await server.start();
|
await server.start();
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
process.send({ event: 'stat', count: global.Hydro.stat.reqCount });
|
process.send({ event: 'stat', count: global.Hydro.stat.reqCount });
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import { ValidationError } from '../error';
|
import { ValidationError } from '../error';
|
||||||
|
|
||||||
const RE_UID = /^-?\d+$/i;
|
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_UNAME = /[^\s\u3000](.{,254}[^\s\u3000])?$/i;
|
||||||
const RE_ROLE = /^[_0-9A-Za-z]{1,256}$/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;
|
const RE_MAIL = /^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)+$/i;
|
||||||
|
|||||||
Reference in new issue
Block a user