Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

provider-upload-filerobot

Package Overview
Dependencies
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

provider-upload-filerobot

Strapi v4 upload provider for Filerobot by Scaleflex

  • 1.0.4
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

Strapi v4 upload provider for Filerobot by Scaleflex

Pre-requisite

The Filerobot Upload Provider MUST be installed AFTER the Filerobot Plugin for the Strapi CMS.

Install

npm install provider-upload-filerobot

or

yarn add provider-upload-filerobot

After you install the upload provider

Config

In config/plugins.js

module.exports = {
    // ...
    'upload': {
        config: {
            provider: 'provider-upload-filerobot',
            providerOptions: {},
        },
    },
};

Middleware

In config/middlewares.js

Edit the 'strapi::security', section again:

Append '{YOUR FILEROBOT TOKEN}.filerobot.com' or your entire domain name (cname)

module.exports = [
    'strapi::errors',
    { // ---- FROM HERE
        name: 'strapi::security',
        config: {
            contentSecurityPolicy: {
                useDefaults: true,
                directives: {
                    'connect-src': ["'self'", 'https:'],
                    'img-src': ["'self'", 'data:', 'blob:', 'assets.scaleflex.com', 'scaleflex.cloudimg.io', '{YOUR FILEROBOT TOKEN}.filerobot.com'],
                    'media-src': ["'self'", 'data:', 'blob:', 'assets.scaleflex.com', 'scaleflex.cloudimg.io', '{YOUR FILEROBOT TOKEN}.filerobot.com'],
                    upgradeInsecureRequests: null,
                },
            },
        },
    }, // ---- TO HERE
    'strapi::cors',
    'strapi::poweredBy',
    'strapi::logger',
    'strapi::query',
    'strapi::body',
    'strapi::session',
    'strapi::favicon',
    'strapi::public',
];

For proper re-display after upload to Filerobot.

Run

yarn build

yarn start

Usage

Now when you upload stuff to Strapi's Media Library, the images will end up with a Filerobot URL:

On top of that, if you have a content type which contains a Media field, like for example below:

The media that you'll add/upload into the content-post will also end up with a Filerobot URL:

Keywords

FAQs

Package last updated on 24 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc