mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: add server.url check
This commit is contained in:
1 parent
e8d0881082
commit
998248e212
4 files changed
+11
-12
No files matched your search
@@ -22,11 +22,7 @@ const checks: Dictionary<CheckItem> = {
|
||||
error(`Mongo Error: Database read-write failed.\n${e.message}`);
|
||||
}
|
||||
},
|
||||
async checkPerm(ctx, log, warn) {
|
||||
const { username } = os.userInfo();
|
||||
if (username === 'root') warn('Hydro should not be run as root.');
|
||||
// TODO check cwd read-write
|
||||
},
|
||||
// TODO check storage
|
||||
async checkSystem(ctx, log, warn) {
|
||||
const platform = os.platform();
|
||||
if (platform !== 'linux') {
|
||||
@@ -37,7 +33,9 @@ const checks: Dictionary<CheckItem> = {
|
||||
const from = system.get('smtp.from');
|
||||
if (!from) warn('SMTP account was not provided, email verification disabled.');
|
||||
},
|
||||
async checkIpHeader(ctx, log, warn) {
|
||||
async checkSetting(ctx, log, warn) {
|
||||
const url = system.get('server.url');
|
||||
if (url === '/') warn("server.url wasn't set.");
|
||||
const header = system.get('server.xff');
|
||||
if (header && !ctx.request.ip) warn('IP header seems incorrect.\nCheck dashboard>settings>server.');
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user