cleanup + misc fixes

This commit is contained in:
Erik 2024-01-17 20:33:50 +02:00
parent 8bcc9530e9
commit 3dcb8cf74c
3 changed files with 6 additions and 10 deletions

View File

@ -9,18 +9,12 @@
},
"shardCount": 1,
"serverOptions": {
"domain": "YOUR DOMAIN HERE",
"serveFiles": "./files",
"callbackPath": "/api/login",
"http": {
"port": 4000
},
"validUserTypes": [
"user",
"service",
"system"
],
"registrationEnabled": true,
"requireCodeForRegister": true,
"OAuthProviders": [
{
"name": "Discord",

View File

@ -142,8 +142,8 @@ class Server extends EventEmitter
}
else
{
if (!options.domain)
this.#logger.warn('No domain provided in options.json:serverOptions');
if (!options.domain || options.domain.includes('YOUR DOMAIN HERE'))
throw Util.fatal('No domain provided in options.json:serverOptions');
this.#domain = options.domain;
}

View File

@ -265,8 +265,10 @@ class Util
* @throws {Error}
* @memberof Util
*/
static fatal (error: Error): never
static fatal (error: Error | string): never
{
if (typeof error === 'string')
error = new Error(error);
if (process.send)
process.send({ _fatal: true, message: error.message });
throw error;