.onedev-buildspec.yml | Loading last commit info... | |
lib | ||
.editorconfig | ||
.gitignore | ||
.npmignore | ||
LICENSE | ||
README.md | ||
package.json |
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.
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#master",
},
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
- RACKSPACE_USERNAME
- RACKSPACE_KEY
- RACKSPACE_REGION
- RACKSPACE_CONTAINER
- RACKSPACE_CDN_SSL_URI