Strapi-provider-upload-do for strapi v4

Does anyone know if this plugin is maintained, or if its possible to get it working in the current version?

1 Like

The docs for strapi-provide-upload-do says to add configuration to ./extensions/upload/config/settings.js but since in v4 folder structure has changed I added ./src/extensions/upload/config/settings.js. But no luck.

Maybe you have already solved it but I will give you a possible solution:

3 Likes

I was able to successfully deploy a v4 app connected to DO Spaces using the plugin recommended for v3 (GitHub - shorwood/strapi-provider-upload-do: Strapi Upload Provider for Digital Ocean Spaces. This provider will upload to the space using the AWS S3 API.), and the following settings:

./config/plugins.js

module.exports = ({ env }) => ({
  upload: {
    config: {
      provider: "strapi-provider-upload-do",
      providerOptions: {
        key: env("DO_SPACE_ACCESS_KEY"),
        secret: env("DO_SPACE_SECRET_KEY"),
        endpoint: env("DO_SPACE_ENDPOINT"),
        space: env("DO_SPACE_BUCKET"),
      },
    },
  },
});
./config/database.js

module.exports = ({ env }) => ({
  connection: {
    client: "yourdbclient",
    connection: {
      host: env("DATABASE_HOST"),
      port: env.int("DATABASE_PORT"),
      database: env("DATABASE_NAME"),
      user: env("DATABASE_USERNAME"),
      password: env("DATABASE_PASSWORD"),
      ssl: {
        rejectUnauthorized: false,
        ca: env("CA_CERT"), // if needed
      },
    },
    debug: false,
  },
});
./config/middlewares.js

module.exports = ({ env }) => [
  "strapi::errors",
  "strapi::cors",
  "strapi::poweredBy",
  "strapi::logger",
  "strapi::query",
  "strapi::body",
  "strapi::favicon",
  "strapi::public",
  {
    name: "strapi::security",
    config: {
      contentSecurityPolicy: {
        useDefaults: true,
        directives: {
          "connect-src": ["'self'", "https:"],
          "img-src": [
            "'self'",
            "data:",
            "blob:",
            `${env("DO_SPACE_BUCKET")}.${env("DO_SPACE_ENDPOINT")}`,
          ],
          "media-src": [
            "'self'",
            "data:",
            "blob:",
            `${env("DO_SPACE_BUCKET")}.${env("DO_SPACE_ENDPOINT")}`,
          ],
          upgradeInsecureRequests: null,
        },
      },
    },
  },
];
2 Likes

Hi!
It seems that strapi has abandoned these providers and the situation has become of the type, save yourself.
Your solution works very well, but in my case, I have the problem that I cannot preview the videos.
Can anyone give me an idea?

This is the message that returns me: No video found that has a supported MIME format and type.

what version of strapi are you using ? tried everything I found online and still cant deploy to DO… I always get error: Invalid endpoint: undefined

Can you share the complete error log