chore: update minio

This commit is contained in:
max_richter 2025-01-26 19:05:31 +01:00
parent a390e59448
commit e78b66b752
2 changed files with 6 additions and 4 deletions

View File

@ -3,6 +3,7 @@ import type { RequestHandler } from "./$types";
import { putObject } from "$lib/helpers/minio";
import { generateImage } from "$lib/helpers/stability";
import sharp from "sharp";
import { S3_BUCKET_NAME, S3_ENDPOINT_URL } from "$env/static/private";
async function compressImage(imageName: string, imageBuffer: Buffer) {
@ -49,7 +50,7 @@ export const POST: RequestHandler = async ({ params, request }) => {
throw new Error("Name too long");
}
const { hairType, hairColor, hairLength, skinColor, name } = await request.json();
const { hairType, hairColor, hairLength, skinColor } = await request.json();
console.log(`[AI] Generating image for ${inputName} ${JSON.stringify({ hairType, hairColor, hairLength, skinColor, inputName })}`)
if (!hairType || !hairColor || !hairLength) {
@ -82,6 +83,6 @@ export const POST: RequestHandler = async ({ params, request }) => {
await compressImage(imageName, imageBuffer)
return json({
url: `https://s3-s24.max-richter.dev/silvester24/${imageName}`
url: `https://${S3_ENDPOINT_URL}/${S3_BUCKET_NAME}/${imageName}`
})
}

View File

@ -4,6 +4,7 @@ import { putObject } from "$lib/helpers/minio";
import { generateImage } from "$lib/helpers/stability";
import sharp from "sharp";
import * as pb from "$lib/helpers/pb"
import { S3_BUCKET_NAME, S3_ENDPOINT_URL } from "$env/static/private";
async function compressImage(imageName: string, imageBuffer: Buffer) {
@ -82,10 +83,10 @@ export const GET: RequestHandler = async ({ params }) => {
await compressImage(imageName, imageBuffer)
await pb.setInvitePortrait(inputId, `https://s3-s24.max-richter.dev/silvester24/${imageName}`);
await pb.setInvitePortrait(inputId, `https://${S3_ENDPOINT_URL}/${S3_BUCKET_NAME}/${imageName}`);
return json({
url: `https://s3-s24.max-richter.dev/silvester24/${imageName}`
url: `https://${S3_ENDPOINT_URL}/${S3_BUCKET_NAME}/${imageName}`
})
}