diff --git a/.env.example b/.env.example index 67b371c..6224307 100644 --- a/.env.example +++ b/.env.example @@ -6,6 +6,9 @@ BSKY_PASSWORD=your-app-password PDS=bsky.social WSS_URL=wss://your-labeler-service.com/xrpc/com.atproto.label.subscribeLabels +# PLC Directory (for DID resolution) +PLC_ENDPOINT=https://plc.wtf + # Blob & Image Handling HYDRATE_BLOBS=false # Set to true to download images/videos BLOB_STORAGE_TYPE=local # 'local' or 's3' diff --git a/src/config/index.ts b/src/config/index.ts index 194c852..b4fdf1d 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -9,6 +9,9 @@ const configSchema = z.object({ password: z.string().min(1, "BSKY_PASSWORD is required"), pds: z.string().default("bsky.social"), }), + plc: z.object({ + endpoint: z.string().url().default("https://plc.wtf"), + }), labeler: z.object({ wssUrl: z.string().url("WSS_URL must be a valid URL"), }), @@ -43,6 +46,9 @@ function loadConfig(): Config { password: process.env.BSKY_PASSWORD, pds: process.env.PDS, }, + plc: { + endpoint: process.env.PLC_ENDPOINT, + }, labeler: { wssUrl: process.env.WSS_URL, }, diff --git a/src/hydration/profiles.service.ts b/src/hydration/profiles.service.ts index 5d23448..cbe5a3a 100644 --- a/src/hydration/profiles.service.ts +++ b/src/hydration/profiles.service.ts @@ -159,7 +159,7 @@ export class ProfileHydrationService { private async resolvePds(did: string): Promise { try { - const didDocResponse = await fetch(`https://plc.wtf/${did}`); + const didDocResponse = await fetch(`${config.plc.endpoint}/${did}`); if (!didDocResponse.ok) { logger.warn({ did, status: didDocResponse.status }, "Failed to fetch DID document"); return null;