Alexandre Bodin 3f204a0a48 v4.1.8
2022-04-13 16:45:31 +02:00
..
2022-04-13 16:45:31 +02:00
2021-12-03 11:50:01 +01:00

@strapi/provider-upload-rackspace

Resources

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,
        },
      },
    },
  },
  // ...
];