From 1886d5394341e5ab3ceb089015dda12c90954c63 Mon Sep 17 00:00:00 2001 From: Madeline <46743919+MaddyUnderStars@users.noreply.github.com> Date: Thu, 26 Jan 2023 10:18:16 +1100 Subject: Use localhost:3001 as fallback when cdn endpoints are null rather than 3003 --- src/cdn/routes/attachments.ts | 2 +- src/cdn/routes/avatars.ts | 2 +- src/cdn/routes/guild-profiles.ts | 2 +- src/cdn/routes/role-icons.ts | 2 +- src/util/util/cdn.ts | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/cdn/routes/attachments.ts b/src/cdn/routes/attachments.ts index d7764bd7..398a243f 100644 --- a/src/cdn/routes/attachments.ts +++ b/src/cdn/routes/attachments.ts @@ -50,7 +50,7 @@ router.post( const path = `attachments/${channel_id}/${id}/${filename}`; const endpoint = - Config.get()?.cdn.endpointPublic || "http://localhost:3003"; + Config.get()?.cdn.endpointPublic || "http://localhost:3001"; await storage.set(path, buffer); let width; diff --git a/src/cdn/routes/avatars.ts b/src/cdn/routes/avatars.ts index 2c078c29..7dc23d60 100644 --- a/src/cdn/routes/avatars.ts +++ b/src/cdn/routes/avatars.ts @@ -63,7 +63,7 @@ router.post( const path = `avatars/${user_id}/${hash}`; const endpoint = - Config.get().cdn.endpointPublic || "http://localhost:3003"; + Config.get().cdn.endpointPublic || "http://localhost:3001"; await storage.set(path, buffer); diff --git a/src/cdn/routes/guild-profiles.ts b/src/cdn/routes/guild-profiles.ts index a02d152c..ae8786ae 100644 --- a/src/cdn/routes/guild-profiles.ts +++ b/src/cdn/routes/guild-profiles.ts @@ -59,7 +59,7 @@ router.post("/", multer.single("file"), async (req: Request, res: Response) => { if (ANIMATED_MIME_TYPES.includes(type.mime)) hash = `a_${hash}`; // animated icons have a_ infront of the hash const path = `guilds/${guild_id}/users/${user_id}/avatars/${hash}`; - const endpoint = Config.get().cdn.endpointPublic || "http://localhost:3003"; + const endpoint = Config.get().cdn.endpointPublic || "http://localhost:3001"; await storage.set(path, buffer); diff --git a/src/cdn/routes/role-icons.ts b/src/cdn/routes/role-icons.ts index c3ad51c1..8f10ab78 100644 --- a/src/cdn/routes/role-icons.ts +++ b/src/cdn/routes/role-icons.ts @@ -62,7 +62,7 @@ router.post( const path = `role-icons/${role_id}/${hash}.png`; const endpoint = - Config.get().cdn.endpointPublic || "http://localhost:3003"; + Config.get().cdn.endpointPublic || "http://localhost:3001"; await storage.set(path, buffer); diff --git a/src/util/util/cdn.ts b/src/util/util/cdn.ts index 7f447c53..69d50159 100644 --- a/src/util/util/cdn.ts +++ b/src/util/util/cdn.ts @@ -36,7 +36,7 @@ export async function uploadFile( }); const response = await fetch( - `${Config.get().cdn.endpointPrivate || "http://localhost:3003"}${path}`, + `${Config.get().cdn.endpointPrivate || "http://localhost:3001"}${path}`, { headers: { signature: Config.get().security.requestSignature, @@ -75,7 +75,7 @@ export async function handleFile( export async function deleteFile(path: string) { const response = await fetch( - `${Config.get().cdn.endpointPrivate || "http://localhost:3003"}${path}`, + `${Config.get().cdn.endpointPrivate || "http://localhost:3001"}${path}`, { headers: { signature: Config.get().security.requestSignature, -- cgit 1.4.1 From 8384a2c539b7bc1efdee113fa8de769d280f8872 Mon Sep 17 00:00:00 2001 From: Madeline <46743919+MaddyUnderStars@users.noreply.github.com> Date: Thu, 26 Jan 2023 10:21:13 +1100 Subject: also don't use 3002 as default when gateway endpoints are null --- src/api/routes/gateway/bot.ts | 2 +- src/api/routes/gateway/index.ts | 2 +- src/api/routes/policies/instance/domains.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/api/routes/gateway/bot.ts b/src/api/routes/gateway/bot.ts index ffd58e21..070debe3 100644 --- a/src/api/routes/gateway/bot.ts +++ b/src/api/routes/gateway/bot.ts @@ -44,7 +44,7 @@ const options: RouteOptions = { router.get("/", route(options), (req: Request, res: Response) => { const { endpointPublic } = Config.get().gateway; res.json({ - url: endpointPublic || process.env.GATEWAY || "ws://localhost:3002", + url: endpointPublic || process.env.GATEWAY || "ws://localhost:3001", shards: 1, session_start_limit: { total: 1000, diff --git a/src/api/routes/gateway/index.ts b/src/api/routes/gateway/index.ts index a23c93ba..e6fcf5e3 100644 --- a/src/api/routes/gateway/index.ts +++ b/src/api/routes/gateway/index.ts @@ -37,7 +37,7 @@ const options: RouteOptions = { router.get("/", route(options), (req: Request, res: Response) => { const { endpointPublic } = Config.get().gateway; res.json({ - url: endpointPublic || process.env.GATEWAY || "ws://localhost:3002", + url: endpointPublic || process.env.GATEWAY || "ws://localhost:3001", }); }); diff --git a/src/api/routes/policies/instance/domains.ts b/src/api/routes/policies/instance/domains.ts index 33c06765..c95493b0 100644 --- a/src/api/routes/policies/instance/domains.ts +++ b/src/api/routes/policies/instance/domains.ts @@ -29,7 +29,7 @@ router.get("/", route({}), async (req: Request, res: Response) => { gateway: gateway.endpointPublic || process.env.GATEWAY || - "ws://localhost:3002", + "ws://localhost:3001", defaultApiVersion: api.defaultVersion ?? 9, apiEndpoint: api.endpointPublic ?? "/api", }; -- cgit 1.4.1