summary refs log tree commit diff
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-12-23 22:06:11 +0100
committerRory& <root@rory.gay>2025-12-23 22:06:11 +0100
commit55b34169571fa5fed4e30c4d27f4bc030d4b8c12 (patch)
tree55c7fe7ed56a1f5650199f894ebf710ca5a33235
parentSet low cache-control headers for static pages (diff)
downloadserver-ts-55b34169571fa5fed4e30c4d27f4bc030d4b8c12.tar.xz
Add server name config option for use in client redirects
-rw-r--r--src/util/config/types/GeneralConfiguration.ts1
-rw-r--r--src/util/util/Config.ts13
2 files changed, 10 insertions, 4 deletions
diff --git a/src/util/config/types/GeneralConfiguration.ts b/src/util/config/types/GeneralConfiguration.ts

index beafe01c..f4f76441 100644 --- a/src/util/config/types/GeneralConfiguration.ts +++ b/src/util/config/types/GeneralConfiguration.ts
@@ -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; diff --git a/src/util/util/Config.ts b/src/util/util/Config.ts
index 1ca455ff..e31b541f 100644 --- a/src/util/util/Config.ts +++ b/src/util/util/Config.ts
@@ -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");