Add force path style config for s3 - fixes #62 (#65)

This commit is contained in:
Hakan Shehu
2025-06-15 11:39:35 +02:00
committed by GitHub
parent f454856ea4
commit b711af0431
3 changed files with 4 additions and 0 deletions

View File

@@ -9,4 +9,5 @@ export const s3Client = new S3Client({
accessKeyId: config.storage.accessKey,
secretAccessKey: config.storage.secretKey,
},
forcePathStyle: config.storage.forcePathStyle,
});

View File

@@ -7,6 +7,7 @@ export const storageConfigSchema = z.object({
secretKey: z.string({ error: 'STORAGE_S3_SECRET_KEY is required' }),
bucket: z.string({ error: 'STORAGE_S3_BUCKET is required' }),
region: z.string({ error: 'STORAGE_S3_REGION is required' }),
forcePathStyle: z.boolean().optional(),
});
export type StorageConfig = z.infer<typeof storageConfigSchema>;
@@ -19,5 +20,6 @@ export const readStorageConfigVariables = () => {
secretKey: process.env.STORAGE_S3_SECRET_KEY,
bucket: process.env.STORAGE_S3_BUCKET,
region: process.env.STORAGE_S3_REGION,
forcePathStyle: process.env.STORAGE_S3_FORCE_PATH_STYLE === 'true',
};
};