1.3.1 • Published 1 month ago

strapi-provider-upload-ipfs-client v1.3.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

Strapi Provider Upload IPFS

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

1.3.1

1 month ago

1.2.0

2 months ago

1.3.0

6 months ago

1.1.2

1 year ago

1.0.2

1 year ago