mirror of
https://github.com/strapi/strapi.git
synced 2025-08-04 23:03:00 +00:00
@strapi/provider-upload-rackspace
Resources
Links
Installation
# using yarn
yarn add @strapi/provider-upload-rackspace
# using npm
npm install @strapi/provider-upload-rackspace --save
Configurations
Your configuration is passed down to the client initialization. (e.g: createClient(config)
). The implementation is based on the package pkgcloud
. You can read the docs here.
See the using a provider documentation for information on installing and using a provider. And see the environment variables for setting and using environment variables in your configs.
Provider Configuration
./config/plugins.js
module.exports = ({ env }) => ({
// ...
upload: {
config: {
provider: 'rackspace',
providerOptions: {
username: env('RACKSPACE_USERNAME'),
apiKey: env('RACKSPACE_KEY'),
region: env('RACKSPACE_REGION'),
container: env('RACKSPACE_CONTAINER'),
},
},
},
// ...
});
Security Middleware Configuration
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:', 'storage.clouddrive.com'],
'media-src': ["'self'", 'data:', 'blob:', 'storage.clouddrive.com'],
upgradeInsecureRequests: null,
},
},
},
},
// ...
];