Update config validation to check datastores instead of webserver
This commit is contained in:
parent
3a9045ef87
commit
7914ff7e45
1 changed files with 16 additions and 8 deletions
|
|
@ -27,16 +27,24 @@ export class Validate {
|
||||||
valid = false;
|
valid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Assert data in the web server object
|
if (!conf.websocket.permitted_hosts) {
|
||||||
if (conf.webserver.enabled) {
|
log.error(`Can't have a blank or null websocket.permitted_hosts`);
|
||||||
if (!conf.webserver.port) {
|
valid = false;
|
||||||
log.error(`Invalid webserver port value: ${conf.webserver.port}`);
|
};
|
||||||
|
|
||||||
|
if (!conf.datastores) {
|
||||||
|
log.error(`Datastores object must be defined`);
|
||||||
|
valid = false;
|
||||||
|
} else {
|
||||||
|
if (conf.datastores.enabled == null) {
|
||||||
|
log.error(`datastores.enabled must be defined`);
|
||||||
|
valid = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
if (conf.datastores.enabled && conf.datastores.directory?.length > 0) {
|
||||||
|
log.error(`datastores.directory must be a filepath if datastores.enabled is set to true`);
|
||||||
valid = false;
|
valid = false;
|
||||||
};
|
};
|
||||||
};
|
|
||||||
if (!conf.websocket.permitted_hosts) {
|
|
||||||
log.error(`Can't have a blank or null webserver.hostname`);
|
|
||||||
valid = false;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Config is valid
|
// Config is valid
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue