From 3b83cce1a1d0b17cfe42884606e37fd27924a629 Mon Sep 17 00:00:00 2001 From: Hailey Date: Mon, 16 Dec 2024 13:37:31 -0800 Subject: [PATCH] add trending topics to server cfg (#3226) * add trending topics to server cfg * rename stuff * remove langs --- packages/bsky/src/api/app/bsky/unspecced/getConfig.ts | 1 + packages/bsky/src/config.ts | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/packages/bsky/src/api/app/bsky/unspecced/getConfig.ts b/packages/bsky/src/api/app/bsky/unspecced/getConfig.ts index b1939f0349f..f77c4a1993e 100644 --- a/packages/bsky/src/api/app/bsky/unspecced/getConfig.ts +++ b/packages/bsky/src/api/app/bsky/unspecced/getConfig.ts @@ -9,6 +9,7 @@ export default function (server: Server, ctx: AppContext) { encoding: 'application/json', body: { checkEmailConfirmed: ctx.cfg.clientCheckEmailConfirmed, + topicsEnabled: ctx.cfg.topicsEnabled, }, } }, diff --git a/packages/bsky/src/config.ts b/packages/bsky/src/config.ts index 244e35b4c4f..4a7b92b4566 100644 --- a/packages/bsky/src/config.ts +++ b/packages/bsky/src/config.ts @@ -49,6 +49,7 @@ export interface ServerConfigValues { maxThreadDepth?: number // client config clientCheckEmailConfirmed?: boolean + topicsEnabled?: boolean } export class ServerConfig { @@ -134,6 +135,7 @@ export class ServerConfig { : process.env.BSKY_STATSIG_ENV || 'development' const clientCheckEmailConfirmed = process.env.BSKY_CLIENT_CHECK_EMAIL_CONFIRMED === 'true' + const topicsEnabled = process.env.BSKY_TOPICS_ENABLED === 'true' const indexedAtEpoch = process.env.BSKY_INDEXED_AT_EPOCH ? new Date(process.env.BSKY_INDEXED_AT_EPOCH) : undefined @@ -186,6 +188,7 @@ export class ServerConfig { statsigKey, statsigEnv, clientCheckEmailConfirmed, + topicsEnabled, indexedAtEpoch, bigThreadUris, bigThreadDepth, @@ -355,6 +358,10 @@ export class ServerConfig { return this.cfg.clientCheckEmailConfirmed } + get topicsEnabled() { + return this.cfg.topicsEnabled + } + get indexedAtEpoch() { return this.cfg.indexedAtEpoch }