From acbeb81d3a8ea93473a5ed587c37848ea5e52299 Mon Sep 17 00:00:00 2001 From: Hailey Date: Tue, 10 Dec 2024 17:29:32 -0800 Subject: [PATCH 1/3] add trending topics to server cfg --- .../src/api/app/bsky/unspecced/getConfig.ts | 2 ++ packages/bsky/src/config.ts | 17 +++++++++++++++++ 2 files changed, 19 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..988209bfd65 100644 --- a/packages/bsky/src/api/app/bsky/unspecced/getConfig.ts +++ b/packages/bsky/src/api/app/bsky/unspecced/getConfig.ts @@ -9,6 +9,8 @@ export default function (server: Server, ctx: AppContext) { encoding: 'application/json', body: { checkEmailConfirmed: ctx.cfg.clientCheckEmailConfirmed, + trendingTopicsEnabled: ctx.cfg.trendingTopicsEnabled, + trendingTopicsLangs: ctx.cfg.trendingTopicsLangs, }, } }, diff --git a/packages/bsky/src/config.ts b/packages/bsky/src/config.ts index 2634ba8308f..e9fb6daab74 100644 --- a/packages/bsky/src/config.ts +++ b/packages/bsky/src/config.ts @@ -47,6 +47,8 @@ export interface ServerConfigValues { maxThreadDepth?: number // client config clientCheckEmailConfirmed?: boolean + trendingTopicsEnabled?: boolean + trendingTopicsLangs?: string[] } export class ServerConfig { @@ -130,6 +132,11 @@ export class ServerConfig { : process.env.BSKY_STATSIG_ENV || 'development' const clientCheckEmailConfirmed = process.env.BSKY_CLIENT_CHECK_EMAIL_CONFIRMED === 'true' + const trendingTopicsEnabled = + process.env.BSKY_TRENDING_TOPICS_ENABLED === 'true' + const trendingTopicsLangs = process.env.BSKY_TRENDING_TOPICS_LANGS + ? process.env.BSKY_TRENDING_TOPICS_LANGS.split(',') + : undefined const indexedAtEpoch = process.env.BSKY_INDEXED_AT_EPOCH ? new Date(process.env.BSKY_INDEXED_AT_EPOCH) : undefined @@ -180,6 +187,8 @@ export class ServerConfig { statsigKey, statsigEnv, clientCheckEmailConfirmed, + trendingTopicsEnabled, + trendingTopicsLangs, indexedAtEpoch, bigThreadUris, bigThreadDepth, @@ -341,6 +350,14 @@ export class ServerConfig { return this.cfg.clientCheckEmailConfirmed } + get trendingTopicsEnabled() { + return this.cfg.trendingTopicsEnabled + } + + get trendingTopicsLangs() { + return this.cfg.trendingTopicsLangs + } + get indexedAtEpoch() { return this.cfg.indexedAtEpoch } From 49752c9a45dc4f35b5126ad529e5e4b220a930c0 Mon Sep 17 00:00:00 2001 From: Hailey Date: Mon, 16 Dec 2024 13:35:24 -0800 Subject: [PATCH 2/3] rename stuff --- .../src/api/app/bsky/unspecced/getConfig.ts | 4 ++-- packages/bsky/src/config.ts | 23 +++++++++---------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/packages/bsky/src/api/app/bsky/unspecced/getConfig.ts b/packages/bsky/src/api/app/bsky/unspecced/getConfig.ts index 988209bfd65..eafaac3a8e9 100644 --- a/packages/bsky/src/api/app/bsky/unspecced/getConfig.ts +++ b/packages/bsky/src/api/app/bsky/unspecced/getConfig.ts @@ -9,8 +9,8 @@ export default function (server: Server, ctx: AppContext) { encoding: 'application/json', body: { checkEmailConfirmed: ctx.cfg.clientCheckEmailConfirmed, - trendingTopicsEnabled: ctx.cfg.trendingTopicsEnabled, - trendingTopicsLangs: ctx.cfg.trendingTopicsLangs, + topicsEnabled: ctx.cfg.topicsEnabled, + topicsLangs: ctx.cfg.topicsLangs, }, } }, diff --git a/packages/bsky/src/config.ts b/packages/bsky/src/config.ts index 90c7a5f1d18..ceb6e8ee7b4 100644 --- a/packages/bsky/src/config.ts +++ b/packages/bsky/src/config.ts @@ -49,8 +49,8 @@ export interface ServerConfigValues { maxThreadDepth?: number // client config clientCheckEmailConfirmed?: boolean - trendingTopicsEnabled?: boolean - trendingTopicsLangs?: string[] + topicsEnabled?: boolean + topicsLangs?: string[] } export class ServerConfig { @@ -136,10 +136,9 @@ export class ServerConfig { : process.env.BSKY_STATSIG_ENV || 'development' const clientCheckEmailConfirmed = process.env.BSKY_CLIENT_CHECK_EMAIL_CONFIRMED === 'true' - const trendingTopicsEnabled = - process.env.BSKY_TRENDING_TOPICS_ENABLED === 'true' - const trendingTopicsLangs = process.env.BSKY_TRENDING_TOPICS_LANGS - ? process.env.BSKY_TRENDING_TOPICS_LANGS.split(',') + const topicsEnabled = process.env.BSKY_TOPICS_ENABLED === 'true' + const topicsLangs = process.env.BSKY_TOPICS_LANGS + ? process.env.BSKY_TOPICS_LANGS.split(',') : undefined const indexedAtEpoch = process.env.BSKY_INDEXED_AT_EPOCH ? new Date(process.env.BSKY_INDEXED_AT_EPOCH) @@ -193,8 +192,8 @@ export class ServerConfig { statsigKey, statsigEnv, clientCheckEmailConfirmed, - trendingTopicsEnabled, - trendingTopicsLangs, + topicsEnabled, + topicsLangs, indexedAtEpoch, bigThreadUris, bigThreadDepth, @@ -364,12 +363,12 @@ export class ServerConfig { return this.cfg.clientCheckEmailConfirmed } - get trendingTopicsEnabled() { - return this.cfg.trendingTopicsEnabled + get topicsEnabled() { + return this.cfg.topicsEnabled } - get trendingTopicsLangs() { - return this.cfg.trendingTopicsLangs + get topicsLangs() { + return this.cfg.topicsLangs ?? [] } get indexedAtEpoch() { From 5c02988cb06887b2e1c1b96bf621ef44afd061ff Mon Sep 17 00:00:00 2001 From: Hailey Date: Mon, 16 Dec 2024 13:36:48 -0800 Subject: [PATCH 3/3] remove langs --- packages/bsky/src/api/app/bsky/unspecced/getConfig.ts | 1 - packages/bsky/src/config.ts | 9 --------- 2 files changed, 10 deletions(-) diff --git a/packages/bsky/src/api/app/bsky/unspecced/getConfig.ts b/packages/bsky/src/api/app/bsky/unspecced/getConfig.ts index eafaac3a8e9..f77c4a1993e 100644 --- a/packages/bsky/src/api/app/bsky/unspecced/getConfig.ts +++ b/packages/bsky/src/api/app/bsky/unspecced/getConfig.ts @@ -10,7 +10,6 @@ export default function (server: Server, ctx: AppContext) { body: { checkEmailConfirmed: ctx.cfg.clientCheckEmailConfirmed, topicsEnabled: ctx.cfg.topicsEnabled, - topicsLangs: ctx.cfg.topicsLangs, }, } }, diff --git a/packages/bsky/src/config.ts b/packages/bsky/src/config.ts index ceb6e8ee7b4..4a7b92b4566 100644 --- a/packages/bsky/src/config.ts +++ b/packages/bsky/src/config.ts @@ -50,7 +50,6 @@ export interface ServerConfigValues { // client config clientCheckEmailConfirmed?: boolean topicsEnabled?: boolean - topicsLangs?: string[] } export class ServerConfig { @@ -137,9 +136,6 @@ export class ServerConfig { const clientCheckEmailConfirmed = process.env.BSKY_CLIENT_CHECK_EMAIL_CONFIRMED === 'true' const topicsEnabled = process.env.BSKY_TOPICS_ENABLED === 'true' - const topicsLangs = process.env.BSKY_TOPICS_LANGS - ? process.env.BSKY_TOPICS_LANGS.split(',') - : undefined const indexedAtEpoch = process.env.BSKY_INDEXED_AT_EPOCH ? new Date(process.env.BSKY_INDEXED_AT_EPOCH) : undefined @@ -193,7 +189,6 @@ export class ServerConfig { statsigEnv, clientCheckEmailConfirmed, topicsEnabled, - topicsLangs, indexedAtEpoch, bigThreadUris, bigThreadDepth, @@ -367,10 +362,6 @@ export class ServerConfig { return this.cfg.topicsEnabled } - get topicsLangs() { - return this.cfg.topicsLangs ?? [] - } - get indexedAtEpoch() { return this.cfg.indexedAtEpoch }