summary refs log tree commit diff
path: root/src/util/config
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2026-03-26 15:14:18 +0100
committerRory& <root@rory.gay>2026-03-26 15:14:18 +0100
commit53ab01c4e2918fa6fd67ca8642efb21f5fc1a63a (patch)
tree3d68fe500558fab55e85ff5158f715890ae4263f /src/util/config
parentEmbedHandlers: use youtube handler for youtube music, use OrmUtils.mergeDeep ... (diff)
downloadserver-ts-53ab01c4e2918fa6fd67ca8642efb21f5fc1a63a.tar.xz
EmbedHandlers: more configuration for embeds, switch to storing all returned embeds
Diffstat (limited to 'src/util/config')
-rw-r--r--src/util/config/Config.ts2
-rw-r--r--src/util/config/types/EmbedConfiguration.ts29
-rw-r--r--src/util/config/types/index.ts1
3 files changed, 32 insertions, 0 deletions
diff --git a/src/util/config/Config.ts b/src/util/config/Config.ts

index 7fe879db..7549b8b6 100644 --- a/src/util/config/Config.ts +++ b/src/util/config/Config.ts
@@ -22,6 +22,7 @@ import { ComponentConfiguration, DefaultsConfiguration, EmailConfiguration, + EmbedConfiguration, EndpointConfiguration, ExternalTokensConfiguration, GeneralConfiguration, @@ -61,4 +62,5 @@ export class ConfigValue { user: UserConfiguration = new UserConfiguration(); offload: OffloadConfiguration = new OffloadConfiguration(); components = new ComponentConfiguration(); + embeds = new EmbedConfiguration(); } diff --git a/src/util/config/types/EmbedConfiguration.ts b/src/util/config/types/EmbedConfiguration.ts new file mode 100644
index 00000000..94300831 --- /dev/null +++ b/src/util/config/types/EmbedConfiguration.ts
@@ -0,0 +1,29 @@ +/* + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2025 Spacebar and Spacebar Contributors + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. +*/ + +export class EmbedConfiguration { + defaultUserAgent: string | null = null; + + youtube = new YoutubeEmbedConfiguration(); +} + +export class YoutubeEmbedConfiguration { + useCurlUserAgent: boolean = false; + userAgent: string | null = null; + cookie: string | null = null; +} diff --git a/src/util/config/types/index.ts b/src/util/config/types/index.ts
index 9e689c24..872b590b 100644 --- a/src/util/config/types/index.ts +++ b/src/util/config/types/index.ts
@@ -37,3 +37,4 @@ export * from "./subconfigurations"; export * from "./TemplateConfiguration"; export * from "./UsersConfiguration"; export * from "./ComponentConfiguration"; +export * from "./EmbedConfiguration";