A provider for using ovh object storage to store statics assets
released December 5, 2023
npm install strapi-provider-upload-ovh# using yarn
yarn add strapi-provider-upload-ovh
# using npm
npm install strapi-provider-upload-ovh --save./config/plugins.js
module.exports = ({ env }) => ({
// ...
upload: {
config: {
provider: 'ovh',
providerOptions: {
keystoneAuthVersion: 'v3',
provider: 'openstack',
username: env('STORAGE_USERNAME'),
password: env('STORAGE_PASSWORD'),
region: env('STORAGE_REGION', 'GRA'),
domainId: env('STORAGE_DOMAIN_ID', 'default'),
domainName: env('STORAGE_TENANT_NAME', 'tenant_name'),
authUrl: env('STORAGE_AUTH_URL', 'https://auth.cloud.ovh.net/'),
defaultContainerName: env('STORAGE_CONTAINER_NAME'),
publicUrlPrefix: env('STORAGE_PUBLIC_URL_PREFIX')
}
},
},
// ...
});Due to the default settings in the Strapi Security Middleware you will need to modify the contentSecurityPolicy settings to properly see thumbnail previews in the Media Library. You should replace strapi::security string with the object bellow instead as explained in the middleware configuration documentation.
./config/middlewares.js
module.exports = [
// ...
{
name: 'strapi::security',
config: {
contentSecurityPolicy: {
useDefaults: true,
directives: {
'connect-src': ["'self'", 'https:'],
'img-src': ["'self'", 'data:', 'blob:', 'https://auth.cloud.ovh.net'],
'media-src': ["'self'", 'data:', 'blob:', 'https://auth.cloud.ovh.net'],
upgradeInsecureRequests: null,
},
},
},
},
// ...
];Share your work with the community and get it listed in the Strapi ecosystem for everyone to discover and use.
Submit
