diff options
| author | schererleander <leander@schererleander.de> | 2025-12-26 14:57:13 +0100 |
|---|---|---|
| committer | schererleander <leander@schererleander.de> | 2025-12-26 14:57:13 +0100 |
| commit | c5c4e677ff2ba8d646dc90729e98273ece5258c3 (patch) | |
| tree | 0be0931c059886dd99a26c506f20dacc274e414f | |
| parent | 773a4baae1945b9ecc2f9fa71f6b22be70ea8f9c (diff) | |
refactor(lib): simplify minio client setup and remove policy logic
| -rw-r--r-- | src/lib/minio.ts | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/src/lib/minio.ts b/src/lib/minio.ts index 4ba6c31..31e15d5 100644 --- a/src/lib/minio.ts +++ b/src/lib/minio.ts @@ -17,22 +17,6 @@ export async function ensureBucketExists() { if (!exists) { await minioClient.makeBucket(BUCKET_NAME, 'us-east-1') console.log(`Created bucket: ${BUCKET_NAME}`) - - // Set bucket policy for public read access to profile images - const policy = { - Version: '2012-10-17', - Statement: [ - { - Effect: 'Allow', - Principal: { AWS: ['*'] }, - Action: ['s3:GetObject'], - Resource: [`arn:aws:s3:::${BUCKET_NAME}/users/*/profile/*`] - } - ] - } - - await minioClient.setBucketPolicy(BUCKET_NAME, JSON.stringify(policy)) - console.log(`Set bucket policy for ${BUCKET_NAME}`) } } catch (error) { console.error('Error ensuring bucket exists:', error) @@ -96,4 +80,4 @@ export async function getFileInfo(key: string) { } } -export default minioClient
\ No newline at end of file +export default minioClient |
