- install npm package:
npm i strapi-provider-upload-ts-minio - add upload module in
plugins.jsmodule.exports = ({env}) => ({ upload: { config: { provider: "strapi-provider-upload-ts-minio", providerOptions: { accessKey: env('MINIO_ACCESS_KEY'), secretKey: env('MINIO_SECRET_KEY'), bucket: env('MINIO_BUCKET'), endPoint: env('MINIO_ENDPOINT'), port: 443, useSSL: true }, actionOptions: { upload: { sizeLimit: 200 * 1024 * 1024, // 200MB }, }, }, }, ... });
- add variables to
.envMINIO_ACCESS_KEY=################# MINIO_SECRET_KEY=################# MINIO_BUCKET=################# MINIO_ENDPOINT=https://################# MINIO_USE_SSL=true
- replace
strapi::securityinmiddlewares.js... { name: 'strapi::security', config: { contentSecurityPolicy: { useDefaults: true, directives: { 'connect-src': ["'self'", 'https:'], 'img-src': [ "'self'", 'data:', 'blob:', 'market-assets.strapi.io', '<<<endPoint>>>', ], 'media-src': [ "'self'", 'data:', 'blob:', 'market-assets.strapi.io', '<<<endPoint>>>', ], upgradeInsecureRequests: null, }, }, }, }, ...
- Login to minio ui page
- create new bucket
- set
Access Policyto:{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "AWS": [ "arn:aws:iam::minio:user/<<<accessKey>>>" ] }, "Action": [ "s3:GetBucketLocation", "s3:ListBucket", "s3:ListBucketMultipartUploads" ], "Resource": [ "arn:aws:s3:::<<<bucket-name>>>" ] }, { "Effect": "Allow", "Principal": { "AWS": [ "arn:aws:iam::minio:user/<<<accessKey>>>" ] }, "Action": [ "s3:AbortMultipartUpload", "s3:DeleteObject", "s3:GetObject", "s3:ListMultipartUploadParts", "s3:PutObject" ], "Resource": [ "arn:aws:s3:::<<<bucket-name>>>/*" ] }, { "Effect": "Allow", "Principal": { "AWS": [ "*" ] }, "Action": [ "s3:GetObject" ], "Resource": [ "arn:aws:s3:::<<<bucket-name>>>/*" ] } ] }
Last active
May 1, 2025 08:38
-
-
Save Kassan424kh/39d50ad65a1aa6799b9ece38ef91fcdc to your computer and use it in GitHub Desktop.
Strapi + Minio
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment