Skip to content

Commit 1d2e029

Browse files
committed
feat(s3): add S3_SKIP_POLICY env variable to disable setBucketPolicy for incompatible providers
1 parent 427c994 commit 1d2e029

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/api/integrations/storage/s3/libs/minio.server.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ const createBucket = async () => {
6363
if (!exists) {
6464
await minioClient.makeBucket(bucketName);
6565
}
66-
67-
await setBucketPolicy();
68-
66+
if (!BUCKET.SKIP_POLICY) {
67+
await setBucketPolicy();
68+
}
6969
logger.info(`S3 Bucket ${bucketName} - ON`);
7070
return true;
7171
} catch (error) {

src/config/env.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ export type S3 = {
251251
PORT?: number;
252252
USE_SSL?: boolean;
253253
REGION?: string;
254+
SKIP_POLICY?: boolean;
254255
};
255256

256257
export type CacheConf = { REDIS: CacheConfRedis; LOCAL: CacheConfLocal };
@@ -555,6 +556,7 @@ export class ConfigService {
555556
PORT: Number.parseInt(process.env?.S3_PORT || '9000'),
556557
USE_SSL: process.env?.S3_USE_SSL === 'true',
557558
REGION: process.env?.S3_REGION,
559+
SKIP_POLICY: process.env?.S3_SKIP_POLICY === 'true',
558560
},
559561
AUTHENTICATION: {
560562
API_KEY: {

0 commit comments

Comments
 (0)