From 3dcb8cf74c7f7e9c8c117b543aa3b1b0e7c77336 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Wed, 17 Jan 2024 20:33:50 +0200 Subject: [PATCH] cleanup + misc fixes --- options.json | 8 +------- src/server/Server.ts | 4 ++-- src/util/Util.ts | 4 +++- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/options.json b/options.json index 98093f2..ce54b3b 100644 --- a/options.json +++ b/options.json @@ -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", diff --git a/src/server/Server.ts b/src/server/Server.ts index e538385..b7575ec 100644 --- a/src/server/Server.ts +++ b/src/server/Server.ts @@ -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; } diff --git a/src/util/Util.ts b/src/util/Util.ts index 5ee342b..8303455 100644 --- a/src/util/Util.ts +++ b/src/util/Util.ts @@ -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;