usememos / memos

An open-source, lightweight note-taking solution. The pain-less way to create your meaningful notes. Your Notes, Your Way.
https://usememos.com
MIT License
34k stars 2.46k forks source link

Problems with uploading images to Cloudflare R2 关于图片上传到Cloudflare R2 的问题 #2878

Closed mengxizhuo closed 8 months ago

mengxizhuo commented 9 months ago

Describe the solution you'd like

目前经本人测试,选择存储为 Cloudflare R2 ,上传图片会经过服务器中转
这对于一些小带宽的服务器不太友好,请问有什么方法可以解决 直接直连上传到 对象存储
Tips:不知道是不是不支持,还是个人的配置有问题
At present, after my own testing, I chose Cloudflare R2 for storage. Uploaded images will be transferred through the server. This is not very friendly to some servers with small bandwidth. Is there any way to solve the problem of directly uploading to object storage? I don’t know if it is not supported. Or is there something wrong with my personal configuration?

Type of feature

API

Additional context

No response

wbchn commented 9 months ago

我从我的理解来解释下

  1. 从客户端直接上传的方式,AWS S3 Signed url或是阿里云 OSS 支持, R2 也有类似实现 Presigned URLs
  2. memos已经使用了 AWS S3 SDK,如果需要实现,剩下的是功能的实现。
  3. 看代码中已经有了部分实现,可能没有用在前端页面上传。
    // RunPreSignLinks is a background job that pre-signs external links stored in the database.
    // It uses S3 client to generate presigned URLs and updates the corresponding resources in the store.
    func RunPreSignLinks(ctx context.Context, dataStore *store.Store) 

以上是临时查看代码得到的,如有错误请指正。

wbchn commented 9 months ago

我从我的理解来解释下

  1. 从客户端直接上传的方式,AWS S3 Signed url或是阿里云 OSS 支持, R2 也有类似实现 Presigned URLs
  2. memos已经使用了 AWS S3 SDK,如果需要实现,剩下的是功能的实现。
  3. 看代码中已经有了部分实现,可能没有用在前端页面上传。
// RunPreSignLinks is a background job that pre-signs external links stored in the database.
// It uses S3 client to generate presigned URLs and updates the corresponding resources in the store.
func RunPreSignLinks(ctx context.Context, dataStore *store.Store) 

以上是临时查看代码得到的,如有错误请指正。

sorry, this is a replicated issue already discussed in #2565, and merged at #2855

mengxizhuo commented 9 months ago

我从我的理解来解释下

  1. 从客户端直接上传的方式,AWS S3 Signed url或是阿里云 OSS 支持, R2 也有类似实现 Presigned URLs
  2. memos已经使用了 AWS S3 SDK,如果需要实现,剩下的是功能的实现。
  3. 看代码中已经有了部分实现,可能没有用在前端页面上传。
// RunPreSignLinks is a background job that pre-signs external links stored in the database.
// It uses S3 client to generate presigned URLs and updates the corresponding resources in the store.
func RunPreSignLinks(ctx context.Context, dataStore *store.Store) 

以上是临时查看代码得到的,如有错误请指正。

抱歉,这是 #2565 中已经讨论过的重复问题,并在 #2855 中合并

确实已有讨论,刚刚测试了一下,尽管是添加阿里云OSS和腾讯云COS,都还是会经过服务器中转再上传到OSS / COS

望开发者能够加入直传的API功能
wbchn commented 9 months ago

docker 部署的么?如果是docker,截止现在是 latest 指向 0.19.0 版本,release at 2024-01-28

2855 在2024-01-29 fa17dce04638dc05b2283afe6bd4db2a840f9e16 合并

等待下个版本,或自行编译再试。

Issues-translate-bot commented 9 months ago

Issue is not in English. It has been translated automatically.


Is it deployed by docker? If it is docker, as of now, latest points to version 0.19.0, release at 2024-01-28

2855 Merged in 2024-01-29 fa17dce04638dc05b2283afe6bd4db2a840f9e16

Wait for the next version, or compile it yourself and try again.

github-actions[bot] commented 8 months ago

This issue is stale because it has been open 14 days with no activity.