From 0c74ea107ad09baf286d19a9eb6a812b0e971625 Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 27 Nov 2025 13:51:24 -0300 Subject: [PATCH] fix: adicionar region e logs no MinIO client --- frontend/src/lib/minio.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/frontend/src/lib/minio.ts b/frontend/src/lib/minio.ts index 60e6709..f887e7c 100644 --- a/frontend/src/lib/minio.ts +++ b/frontend/src/lib/minio.ts @@ -1,12 +1,18 @@ import * as Minio from 'minio'; +const endpoint = process.env.MINIO_ENDPOINT || 'localhost'; +const port = parseInt(process.env.MINIO_PORT || '9000'); +const useSSL = process.env.MINIO_USE_SSL === 'true'; + +console.log(`[MinIO] Configurando cliente: ${endpoint}:${port} (SSL: ${useSSL})`); + export const minioClient = new Minio.Client({ - endPoint: process.env.MINIO_ENDPOINT || 'localhost', - port: parseInt(process.env.MINIO_PORT || '9000'), - useSSL: process.env.MINIO_USE_SSL === 'true', + endPoint: endpoint, + port: port, + useSSL: useSSL, accessKey: process.env.MINIO_ACCESS_KEY || 'admin', secretKey: process.env.MINIO_SECRET_KEY || 'adminpassword', - pathStyle: true, // Força path-style URLs (endpoint/bucket ao invés de bucket.endpoint) + region: 'us-east-1', // Força região para evitar lookup }); export const bucketName = process.env.MINIO_BUCKET_NAME || 'occto-images';