fix: downgrade MinIO SDK para 7.1.3 com pathStyle
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import * as Minio from 'minio';
|
||||
import { Client } from 'minio';
|
||||
|
||||
const endpoint = process.env.MINIO_ENDPOINT || 'localhost';
|
||||
const port = parseInt(process.env.MINIO_PORT || '9000');
|
||||
@@ -6,13 +6,14 @@ const useSSL = process.env.MINIO_USE_SSL === 'true';
|
||||
|
||||
console.log(`[MinIO] Configurando cliente: ${endpoint}:${port} (SSL: ${useSSL})`);
|
||||
|
||||
export const minioClient = new Minio.Client({
|
||||
export const minioClient = new Client({
|
||||
endPoint: endpoint,
|
||||
port: port,
|
||||
useSSL: useSSL,
|
||||
accessKey: process.env.MINIO_ACCESS_KEY || 'admin',
|
||||
secretKey: process.env.MINIO_SECRET_KEY || 'adminpassword',
|
||||
region: 'us-east-1', // Força região para evitar lookup
|
||||
region: 'us-east-1',
|
||||
pathStyle: true, // IMPORTANTE: força path-style (endpoint/bucket) ao invés de virtual-hosted (bucket.endpoint)
|
||||
});
|
||||
|
||||
export const bucketName = process.env.MINIO_BUCKET_NAME || 'occto-images';
|
||||
|
||||
Reference in New Issue
Block a user