Giter Club home page Giter Club logo

strapi-provider-upload-oss's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

strapi-provider-upload-oss's Issues

oss文件访问权限控制无法变更,导致上传到私有桶的文件无法访问

oss文件访问权限控制无法变更,导致上传到私有桶的文件无法访问,复杂场景需要在默认是私有桶下操作,自定义设置ACL权限,建议新增配置项是否是私有桶配置。
参考官方文档:
https://help.aliyun.com/zh/oss/developer-reference/manage-the-acl-of-an-object-2?spm=a2c4g.11186623.0.0.336e22dec03nIX
上传文件的时候变更文件权限为公共读
const oss = require('ali-oss');

const client = oss({ 
  // yourregion填写Bucket所在地域。以华东1(杭州)为例,Region填写为oss-cn-hangzhou。
  region: 'yourregion',
  // 从环境变量中获取访问凭证。运行本代码示例之前,请确保已设置环境变量OSS_ACCESS_KEY_ID和OSS_ACCESS_KEY_SECRET。
  accessKeyId: process.env.OSS_ACCESS_KEY_ID,
  accessKeySecret: process.env.OSS_ACCESS_KEY_SECRET,
  // yourbucketname填写存储空间名称。
  bucket: 'yourbucketname'
});
  
async function setACL() {
  try {
    // yourObjectName填写不包含Bucket名称在内的Object的完整路径。
    await client.putACL('yourObjectName', 'public-read');
    console.log('Set ACL successfully');
  } catch (e) {
    console.error(e);
  }
}

setACL();

The request signature we calculated does not match the signature you provided.

debug

[2020-12-18T02:30:55.232Z] debug POST /upload (315 ms) 500
[2020-12-18T02:31:16.181Z] debug >>>>>>> upload oss <<<<<<<
[2020-12-18T02:31:16.194Z] debug undefined
[2020-12-18T02:31:16.280Z] error SignatureDoesNotMatchError: The request signature we calculated does not match the signature you provided. Check your key and signing method.

目录结构

image

When I upload image, it also generates multiple thumbnails.

When I upload an image in Media Library, the plugin generates multiple thumbnails.
I read the code only mp4 can generate thumbnails. That's wired, hope some help.

[2020-07-15T14:00:01.653Z] debug >>>>>>> upload oss <<<<<<<
[2020-07-15T14:00:01.684Z] debug undefined
[2020-07-15T14:00:02.042Z] debug >>>>>>> upload oss <<<<<<<
[2020-07-15T14:00:02.042Z] debug undefined
[2020-07-15T14:00:02.135Z] debug >>>>>>> upload oss <<<<<<<
[2020-07-15T14:00:02.137Z] debug undefined
[2020-07-15T14:00:02.183Z] debug >>>>>>> upload oss <<<<<<<
[2020-07-15T14:00:02.183Z] debug undefined
[2020-07-15T14:00:02.514Z] debug >>>>>>> upload oss <<<<<<<
[2020-07-15T14:00:02.531Z] debug undefined
[2020-07-15T14:00:02.620Z] debug >>>>>>> upload oss <<<<<<<
[2020-07-15T14:00:02.620Z] debug undefined
[2020-07-15T14:00:02.620Z] debug >>>>>>> upload oss <<<<<<<
[2020-07-15T14:00:02.633Z] debug undefined
[2020-07-15T14:00:02.718Z] debug >>>>>>> upload oss <<<<<<<
[2020-07-15T14:00:02.718Z] debug undefined
[2020-07-15T14:00:02.718Z] debug >>>>>>> upload oss <<<<<<<
[2020-07-15T14:00:02.726Z] debug undefined
[2020-07-15T14:00:02.779Z] debug >>>>>>> upload oss <<<<<<<
[2020-07-15T14:00:02.779Z] debug undefined
[2020-07-15T14:00:02.988Z] debug POST /upload (1672 ms) 200
[2020-07-15T14:00:03.352Z] debug GET /upload/files/count? (40 ms) 200

image

Upload failed

Hi hezzze,

I want to know what's the recommended policy configuration for the OSS user/role?

I setup the plugin but it can not upload file somehow. No idea if it was due to policy configuration, but even after I grant the AliyunOSSFullAccess to the user, I still can not upload any files...


stack: Error: read ECONNRESET
    at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20)
    at TLSWrap.callbackTrampoline (node:internal/async_hooks:130:17)
>>>>>>> upload oss <<<<<<<
Error [ResponseError]: read ECONNRESET, PUT https://my-app.cn-chengdu.aliyuncs.com/dev/uploads/small__cb97850d1a.jpeg -1 (connected: true, keepalive socket: false, agent status: {"createSocketCount":10,"createSocketErrorCount":0,"closeSocketCount":9,"errorSocketCount":0,"timeoutSocketCount":0,"requestCount":0,"freeSockets":{},"sockets":{"my-app.cn-chengdu.aliyuncs.com:443:::::::::::::::::::::":1},"requests":{}}, socketHandledRequests: 1, socketHandledResponses: 0)
headers: {}
    at Client.requestError (/Users/my-name/workspace/my-app-api/node_modules/ali-oss/lib/client.js:329:13)
    at Client.request (/Users/my-name/workspace/my-app-api/node_modules/ali-oss/lib/client.js:216:22)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async proto.request (/Users/my-name/workspace/my-app-api/node_modules/ali-oss/lib/client.js:194:12)
    at async Client.putStream (/Users/my-name/workspace/my-app-api/node_modules/ali-oss/lib/object.js:152:18)
    at async Client.put (/Users/my-name/workspace/my-app-api/node_modules/ali-oss/lib/object.js:88:12) {
  status: -1,
  code: 'ResponseError'
}
[2023-10-11 21:37:15.046] error: read ECONNRESET, PUT https://my-app.cn-chengdu.aliyuncs.com/dev/uploads/_cb97850d1a.jpeg -1 (connected: true, keepalive socket: false, agent status: {"createSocketCount":6,"createSocketErrorCount":0,"closeSocketCount":5,"errorSocketCount":0,"timeoutSocketCount":0,"requestCount":0,"freeSockets":{},"sockets":{"my-app.cn-chengdu.aliyuncs.com:443:::::::::::::::::::::":1},"requests":{}}, socketHandledRequests: 1, socketHandledResponses: 0)
headers: {}
ResponseError: read ECONNRESET, PUT https://my-app.cn-chengdu.aliyuncs.com/dev/uploads/_cb97850d1a.jpeg -1 (connected: true, keepalive socket: false, agent status: {"createSocketCount":6,"createSocketErrorCount":0,"closeSocketCount":5,"errorSocketCount":0,"timeoutSocketCount":0,"requestCount":0,"freeSockets":{},"sockets":{"my-app.cn-chengdu.aliyuncs.com:443:::::::::::::::::::::":1},"requests":{}}, socketHandledRequests: 1, socketHandledResponses: 0)
headers: {}
    at Client.requestError (/Users/leidong/workspace/neighborhood-api/node_modules/ali-oss/lib/client.js:329:13)
    at Client.request (/Users/leidong/workspace/neighborhood-api/node_modules/ali-oss/lib/client.js:216:22)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async proto.request (/Users/leidong/workspace/neighborhood-api/node_modules/ali-oss/lib/client.js:194:12)
    at async Client.putStream (/Users/leidong/workspace/neighborhood-api/node_modules/ali-oss/lib/object.js:152:18)
    at async Client.put (/Users/leidong/workspace/neighborhood-api/node_modules/ali-oss/lib/object.js:88:12)
http-errors deprecated non-error status code; use only 4xx or 5xx status codes node_modules/@strapi/strapi/lib/services/errors.js:64:21

failed to run strapi develop after installation

Steps:

  1. npm install strapi-provider-upload-oss --save in the strapi root folder
  2. create plugins.js in the config folder with the content provided in the README page
  3. run strapi develop

[2020-07-12T10:32:57.429Z] error Bootstrap function in plugin "upload" failed
[2020-07-12T10:32:57.429Z] error Error: The provider package isn't installed. Please run npm install strapi-provider-upload-oss``

do I need to input configs directly in the plugins.js or there is an admin panel to config?

Strapi package.json :

"knex": "<0.20.0",
"sqlite3": "latest",
"strapi": "3.0.5",
"strapi-admin": "3.0.5",
"strapi-connector-bookshelf": "3.0.5",
"strapi-plugin-content-manager": "3.0.5",
"strapi-plugin-content-type-builder": "3.0.5",
"strapi-plugin-email": "3.0.5",
"strapi-plugin-graphql": "3.0.5",
"strapi-plugin-upload": "3.0.5",
"strapi-plugin-users-permissions": "3.0.5",
"strapi-provider-upload-oss": "^0.1.5",
"strapi-utils": "3.0.5"

Many thanks

安装配置后没反应?

Strapi v3.6.2
安装成功了,也配置了config/plugins.js

但启动后没有什么变化的?
重新打包了也不行

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.