mirror of
https://github.com/spacebarchat/server.git
synced 2026-03-30 18:15:41 +00:00
Add server name config option for use in client redirects
This commit is contained in:
@@ -20,6 +20,7 @@ import { Snowflake } from "@spacebar/util";
|
||||
|
||||
export class GeneralConfiguration {
|
||||
instanceName: string = "Spacebar Instance";
|
||||
serverName: string | null = null;
|
||||
instanceDescription: string | null = "This is a Spacebar instance made in the pre-release days";
|
||||
frontPage: string | null = null;
|
||||
tosPage: string | null = null;
|
||||
|
||||
@@ -184,10 +184,15 @@ function validateFinalConfig(config: ConfigValue) {
|
||||
}
|
||||
}
|
||||
|
||||
assertConfig("api_endpointPublic", (v) => v != null, 'A valid public API endpoint URL, ex. "http://localhost:3001/api/v9"');
|
||||
assertConfig("cdn_endpointPublic", (v) => v != null, 'A valid public CDN endpoint URL, ex. "http://localhost:3003/"');
|
||||
assertConfig("cdn_endpointPrivate", (v) => v != null, 'A valid private CDN endpoint URL, ex. "http://localhost:3003/" - must be routable from the API server!');
|
||||
assertConfig("gateway_endpointPublic", (v) => v != null, 'A valid public gateway endpoint URL, ex. "ws://localhost:3002/"');
|
||||
assertConfig(
|
||||
"general_serverName",
|
||||
(v) => v != null,
|
||||
'A valid domain hosting your .well-known (defaulting to https at port 443), eg. "spacebar.chat" or "http://localhost:3001"',
|
||||
);
|
||||
assertConfig("api_endpointPublic", (v) => v != null, 'A valid public API endpoint URL, eg. "http://localhost:3001/api/v9"');
|
||||
assertConfig("cdn_endpointPublic", (v) => v != null, 'A valid public CDN endpoint URL, eg. "http://localhost:3003/"');
|
||||
assertConfig("cdn_endpointPrivate", (v) => v != null, 'A valid private CDN endpoint URL, eg. "http://localhost:3003/" - must be routable from the API server!');
|
||||
assertConfig("gateway_endpointPublic", (v) => v != null, 'A valid public gateway endpoint URL, eg. "ws://localhost:3002/"');
|
||||
|
||||
if (hasErrors) {
|
||||
console.error("[Config] Your config has invalid values. Fix them first https://docs.spacebar.chat/setup/server/configuration");
|
||||
|
||||
Reference in New Issue
Block a user