diff --git a/server/server.ts b/server/server.ts index 8c16b986..6961aa11 100644 --- a/server/server.ts +++ b/server/server.ts @@ -873,6 +873,7 @@ function getClientConfiguration(data: AuthPerformData): SharedConfiguration | Lo useHexIp: Config.values.useHexIp, prefetch: Config.values.prefetch, fileUploadMaxFileSize: Uploader ? Uploader.getMaxFileSize() : undefined, // TODO can't be undefined? + networks: Config.networks }; const defaultsOverride = { diff --git a/shared/types/config.ts b/shared/types/config.ts index 4b7919ee..6f9d53ff 100644 --- a/shared/types/config.ts +++ b/shared/types/config.ts @@ -3,6 +3,14 @@ export type ConfigTheme = { name: string; themeColor: string | null; }; + +type NetworkTemplate = { + host: string, + port: number, + tls: boolean, + rejectUnauthorized: boolean // if TLS certificates are validated +}; + type SharedConfigurationBase = { public: boolean; useHexIp: boolean; @@ -16,6 +24,7 @@ type SharedConfigurationBase = { themes: ConfigTheme[]; defaultTheme: string; fileUploadMaxFileSize?: number; + networks: {[name: string]: NetworkTemplate}; }; export type ConfigNetDefaults = { @@ -34,6 +43,7 @@ export type ConfigNetDefaults = { saslAccount: string; saslPassword: string; }; + export type LockedConfigNetDefaults = Pick< ConfigNetDefaults, "name" | "nick" | "username" | "password" | "realname" | "join"