diff --git a/deploy/handy.yaml b/deploy/handy.yaml index cb1f36d..e355e50 100644 --- a/deploy/handy.yaml +++ b/deploy/handy.yaml @@ -33,6 +33,8 @@ spec: value: "3005" - name: REDIS_URL value: redis://happy-redis:6379 + - name: S3_PUBLIC_URL + value: https://files.happy-servers.com/happy envFrom: - secretRef: name: handy-secrets diff --git a/sources/app/api.ts b/sources/app/api.ts index 6dff0e5..0f6930b 100644 --- a/sources/app/api.ts +++ b/sources/app/api.ts @@ -37,6 +37,7 @@ import { encryptBytes, encryptString } from "@/modules/encrypt"; import { GitHubProfile } from "./types"; import { uploadImage } from "@/storage/uploadImage"; import { separateName } from "@/utils/separateName"; +import { getPublicUrl } from "@/storage/files"; declare module 'fastify' { @@ -1000,7 +1001,7 @@ export async function startApi(): Promise<{ app: FastifyInstance; io: Server }> timestamp: Date.now(), firstName: user.firstName, lastName: user.lastName, - avatar: user.avatar, + avatar: user.avatar ? { ...user.avatar, url: getPublicUrl(user.avatar.path) } : null, github: user.githubUser ? user.githubUser.profile : null }); }); diff --git a/sources/modules/eventRouter.ts b/sources/modules/eventRouter.ts index 691a8b4..0f8bbb9 100644 --- a/sources/modules/eventRouter.ts +++ b/sources/modules/eventRouter.ts @@ -2,6 +2,7 @@ import { Socket } from "socket.io"; import { log } from "@/utils/log"; import { GitHubProfile } from "@/app/types"; import { AccountProfile } from "@/types"; +import { getPublicUrl } from "@/storage/files"; // === CONNECTION TYPES === @@ -338,7 +339,8 @@ export function buildUpdateAccountUpdate(userId: string, profile: Partial