strapi-provider-upload-ipfs-client
TypeScript icon, indicating that this package has built-in type declarations

1.3.1 • Public • Published

Strapi Provider Upload IPFS

strapi-provider-upload-ipfs-storage

IPFS provider for Strapi uploads.

Installation

# using yarn
yarn add strapi-provider-upload-ipfs

# using npm
npm install strapi-provider-upload-ipfs --save

Providers Configuration

./config/plugins.js

module.exports = ({ env }) => ({
  // ...
  upload: {
    config: {
      provider: "strapi-provider-upload-ipfs-storage",
      providerOptions: {
        grpc: env("IPFS_GRPC"),
        http: env("IPFS_HTTP"),
      },
    },
  },
  // ...
});

.env

IPFS_GRPC=""
IPFS_HTTP=""

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:",
            "dl.airtable.com",
            "*.ipfs.dweb.link", // ipfs.tech
            "*.ipfs.cf-ipfs.com", // cloudflare.com
            "*.ipfs.w3s.link", // web3.storage
          ],
          "media-src": [
            "'self'",
            "data:",
            "blob:",
            "dl.airtable.com",
            "*.ipfs.dweb.link", // ipfs.tech
            "*.ipfs.cf-ipfs.com", // cloudflare.com
            "*.ipfs.w3s.link", // web3.storage
          ],
          upgradeInsecureRequests: null,
        },
      },
    },
  },
  // ...
];

Links

(c) Alex Baker

Package Sidebar

Install

npm i strapi-provider-upload-ipfs-client

Weekly Downloads

2

Version

1.3.1

License

MIT

Unpacked Size

15.4 kB

Total Files

17

Last publish

Collaborators

  • logasja