strapi-provider-upload-ipfs-client
v1.3.1
Published
IPFS provider for strapi upload
Downloads
13
Readme
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