0.1.0 • Published 5 months ago
@charlesshook/strapi-upload-provider-minio v0.1.0
strapi-upload-provider-minio
Resources
Installation
npm install @charlesshook/strapi-upload-provider-minio --saveConfiguration
providerdefines the name of the provider.providerOptionsis passed down to the constructor of the provider.providerOptions.paramsis passed directly to the parameters of each method.bucketis the name of the bucket to upload to.
Provider Configuration
./config/plugins.js
module.exports = ({ env }) => ({
upload: {
config: {
provider: "@charlesshook/strapi-provider-upload-minio",
providerOptions: {
endPoint: env("MINIO_ENDPOINT"),
port: env("MINIO_PORT"),
useSSL: false,
accessKey: env("MINIO_ACCESS_KEY"),
secretKey: env("MINIO_SECRET_KEY"),
params: {
bucket: env("MINIO_BUCKET"),
},
},
actionOptions: {
upload: {},
uploadStream: {},
delete: {},
},
},
},
});Security Middleware Configuration
./config/middlewares.js
module.exports = [
// ...
{
name: "strapi::security",
config: {
contentSecurityPolicy: {
useDefaults: true,
directives: {
"connect-src": ["'self'", "https:"],
"img-src": [
"'self'",
"data:",
"blob:",
"market-assets.strapi.io",
`${env("MINIO_ENDPOINT")}:${env("MINIO_PORT")}/`,
],
"media-src": [
"'self'",
"data:",
"blob:",
"market-assets.strapi.io",
`${env("MINIO_ENDPOINT")}:${env("MINIO_PORT")}/`,
],
upgradeInsecureRequests: null,
},
},
},
},
// ...
];Development of this provider
Test locally
At the root of the project directory run:
npm linkInside the project that you want to add this package to:
npm link @charlesshook/strapi-upload-provider-minio0.1.0
5 months ago