fix(media): replace hardcoded MinIO creds and raw fetch with S3 SDK

- Remove `minioadmin` fallback credentials — app now throws on missing
  MINIO_ACCESS_KEY / MINIO_SECRET_KEY env vars
- Replace raw fetch() PUT/DELETE with @aws-sdk/client-s3 (PutObject,
  DeleteObject) using AWS Signature V4 auth
- Add OnModuleInit bucket existence check + auto-creation
- Use forcePathStyle for MinIO S3 compatibility

Closes TEC-1452

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Ho Ngoc Hai
2026-04-08 04:02:45 +07:00
parent f55c8a8788
commit fcdb3cac9c
3 changed files with 1236 additions and 32 deletions

View File

@@ -13,6 +13,7 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.1026.0",
"@goodgo/mcp-servers": "workspace:*",
"@nestjs/common": "^11.0.0",
"@nestjs/core": "^11.0.0",