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
34.07k stars 2.47k forks source link

Cannot use minio as database, Failed to upload file #3800

Closed CJ-cooper6 closed 2 months ago

CJ-cooper6 commented 3 months ago

Describe the bug

Using minio as the database,specify the correct URL but "memos." is automatically added before the url.

image

Steps to reproduce

  1. Use s3 storage
  2. upload files

The version of Memos you're using.

v0.22.4

Screenshots or additional context

No response

tcassaert commented 3 months ago

Noticed the same thing today. The S3 client should support path-style URLs if we'd want to use MinIO.

pipuwong commented 2 months ago

我发现,minio的endpoin,只能填写ip+端口,不能填写https的域名,这很不方便。

Issues-translate-bot commented 2 months ago

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


I found that minio's endpoint can only fill in the ip + port, but cannot fill in the https domain name, which is very inconvenient.

duckgun13476 commented 2 months ago

I don't know what to say. Minio must use vhost mode to connect to Memos, and configuring vhost mode is very troublesome. It requires bucket domain name resolution to the device and also needs Nginx to proxy traffic. Minio's own vhost must use a certificate that includes subdomains for access, which is too complicated and lacks the convenience of path style mode. I submitted a suggestion two weeks ago, proposing the addition of absolute path access, but they are not planning to implement such a simple feature; today they closed the issue citing no plans in this regard. If I knew Go, I might have written it myself, but unfortunately, I don’t. If there’s anything that can serve as an alternative, I hope you can recommend it to me.

3740 😭😭😭😭😭😭😭😭

WyInnovate commented 2 months ago

@duckgun13476 其实不会go也能搞,就是在一个文件里加一行内容,然后自己编译镜像就行了,我之前发在issues里,然后有人试过了没问题

修改plugin/storage/s3/s3.go的内容

client := s3.NewFromConfig(cfg, func(o *s3.Options) {
o.BaseEndpoint = aws.String(s3Config. Endpoint)
o.UsePathStyle=true //Setting to true means using Path Style
})
Issues-translate-bot commented 2 months ago

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


@duckgun13476 In fact, you can do it even if you don’t know Go. You just need to add a line of content to a file and compile the image yourself. I posted it in issues before, and someone tried it and it worked fine.

Modify the contents of plugin/storage/s3/s3.go

client := s3.NewFromConfig(cfg, func(o *s3.Options) {
o.BaseEndpoint = aws.String(s3Config.Endpoint)
o.UsePathStyle=true //Setting to true means using Path Style
})
WyInnovate commented 2 months ago

@pipuwong 我们都是用的域名去访问的,就是目前memos不支持path-style的minio,以前是支持的,哎

Issues-translate-bot commented 2 months ago

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


@pipuwong We all use the domain name to access, but currently memos does not support path-style minio. It used to support it, hehe.

buyiyihu commented 2 months ago

FYI: Minio support both vhost and path style, memos is ok, you simply should activate vhost support of minio by setting the MINIO_DOMAIN environment:

export MINIO_DOMAIN=mydomain.com
minio server /data

https://min.io/docs/minio/linux/administration/object-management.html#minio-object-management-path-virtual-access

WyInnovate commented 2 months ago

FYI: Minio support both vhost and path style, memos is ok, you simply should activate vhost support of minio by setting the MINIO_DOMAIN environment:

export MINIO_DOMAIN=mydomain.com
minio server /data

https://min.io/docs/minio/linux/administration/object-management.html#minio-object-management-path-virtual-access

So why not default to path style or choose which mode to use @buyiyihu

buyiyihu commented 2 months ago

No idea, you may ask the maintainer

WyInnovate commented 2 months ago

No idea, you may ask the maintainer

Sorry, I wasn't targeting you earlier. Sorry