Enable build support by adding .onedev-buildspec.yml
lib Loading last commit info...
.editorconfig
.gitignore
.npmignore
LICENSE
README.md
package.json
README.md

Strapi Rackspace Provider | Thumbtribe

This library has been forked from the official Strapi Rackspace provider plugin, found at https://github.com/strapi/strapi/tree/master/packages/providers/upload-rackspace.

The features for private containers on Rackspace will only work with Strapi v4.9.0 or higher.


Installation

Add the following dependency to your package.json to pull in the custom Rackspace integration

"dependencies": {
  ...
  "tt-strapi-provider-rackspace": "git+ssh://onedev.ops.thumbtribe.co.za:6611/TGL/tt-strapi-provider-rackspace#v2.0",
},

Configuration

Add the two following configurations to complete the setup of the Rackspace integration

Provider Configuration

./config/plugins.js

module.exports = ({ env }) => ({
  // ...
  upload: {
    config: {
      provider: "tt-strapi-provider-rackspace",
      providerOptions: {
        username: env("RACKSPACE_USERNAME"),
        apiKey: env("RACKSPACE_KEY"),
        region: env("RACKSPACE_REGION"),
        container: env("RACKSPACE_CONTAINER"),
      },
      actionOptions: {
        upload: {},
        uploadStream: {},
        delete: {},
      },
    },
  },
  // ...
});

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 below 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:",
            `${process.env.RACKSPACE_CDN_SSL_URI}`,
          ],
          "media-src": [
            "'self'",
            "data:",
            "blob:",
            `${process.env.RACKSPACE_CDN_SSL_URI}`,
          ],
          upgradeInsecureRequests: null,
        },
      },
    },
  },
  // ...
];

Environment Variables

Environment variables required for the Rackspace integration

VariableTypeDefaultNote
RACKSPACE_USERNAMEString-
RACKSPACE_KEYString-
RACKSPACE_REGIONString-
RACKSPACE_CONTAINERString-
RACKSPACE_CDN_SSL_URIString-If the container is public then the value needs to be the containers public HTTPS URL. If the container is private then the value needs to be https://storage101.lon3.clouddrive.com
RACKSPACE_CDN_ACCESS_CONTROL_HEADERString-Usually assign a value of *
RACKSPACE_IS_PRIVATE_CONTAINERBooleantrue
RACKSPACE_TEMP_URL_KEYString-Required if RACKSPACE_IS_PRIVATE_CONTAINER is true
RACKSPACE_TEMP_URL_TTLInteger300Time to live of the generated temp URL in seconds
Please wait...
Page is in error, reload to recover