Package Exports
- minio-for-strapi-v4
- minio-for-strapi-v4/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (minio-for-strapi-v4) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
minio-for-strapi-v4
This MinIo provider for Strapi V4 use JavaScript Client API Reference to upload files added in Media Library to a your self hosted MinIo server.
minio-for-strapi-v4 also auto generate and upload a webp format of each image (only for jpeg and png formats) using sharp and stream-to-array packages to allow you to use it in frontend.
Installation
npm i --save minio-for-strapi-v4
Configuration
FIRST STEP : You need to activate minio-for-strapi-v4
// file: ./config/plugins.js
module.exports = () => ({
upload: {
config: {
provider: 'minio-for-strapi-v4',
providerOptions: {
endPoint: 'YOUR_MINIO_SERVER_DOMAIN', //s3.example.com
port: YOUR_MINIO_SERVER_PORT, //9000
useSSL: true, //true or false
accessKey: 'YOUR_MINIO_ACCESS_KEY',
secretKey: 'YOUR_MINIO_SECRET_KEY',
bucket: 'NAME_OF_YOUR_MINIO_BUCKET',
},
},
},
})
SECOND STEP : To be able to see images in Strapi dashboard, modify the strapi::security module configuration
// file: ./config/plugins.js
module.exports = [
...,
{
name: 'strapi::security',
config: {
contentSecurityPolicy: {
useDefaults: true,
directives: {
'connect-src': ["'self'", 'https:'],
'img-src': ["'self'", 'data:', 'blob:', 'https://your_minio_server_domain:9000'],
'media-src': ["'self'", 'data:', 'blob:', 'https://your_minio_server_domain:9000'],
upgradeInsecureRequests: null,
},
},
},
},
...,
]