Nugine / s3s

S3 Service Adapter
Apache License 2.0
132 stars 33 forks source link

about base domain limit #162

Closed loverustfs closed 2 weeks ago

loverustfs commented 1 month ago

https://github.com/Nugine/s3s/blob/29bf39cb72507505d09d9d7637f57784dbfc0a40/crates/s3s/src/ops/mod.rs#L92

The base_domain restriction can only be the same as the host in order to use virtual_hosted_style. Are all local and external IPs supported by default?

中文: https://github.com/Nugine/s3s/blob/29bf39cb72507505d09d9d7637f57784dbfc0a40/crates/s3s/src/ops/mod.rs#L92

base_domain 限制只能与host相同才能使用virtual_hosted_style, 是否默认支持所有本地ip以及外网ip?

loverustfs commented 1 month ago

我认为--domain参数应该废弃,不论用户绑定到当前服务器上的是什么域名,都应该被解析。

-- address 绑定当前服务器所有的IP v4 和 IP v6。

比如阿里云,当前对象存储会同时绑定多个域名,因此指定--domain需要优化,最优解应该被废除(改为是否启动host style)。

image

I think the --domain parameter should be abandoned. No matter what domain name the user binds to the current server, it should be resolved.

--address binds all IP v4 and IP v6 of the current server.

For example, Alibaba Cloud currently binds multiple domain names to object storage at the same time, so specifying --domain needs to be optimized, and the optimal solution should be abolished (changed to whether to start host style).

Nugine commented 2 weeks ago

目前看下来,必须有外部传入的域名参数才能解析 virtual hosted style 的请求,否则无法判断 bucket name 到哪里终止。minio 可传入多个域名,aws 允许将 host header 直接作为 bucket name 以支持 CNAME 的情况。

我的想法是将这里的解析暴露为自定义点,通过 dyn trait 传入,允许用户自行实现解析逻辑,并提供一个支持单域名、多域名以及 CNAME 的默认实现。能否满足你们的需求?

loverustfs commented 2 weeks ago

目前看下来,必须有外部传入的域名参数才能解析 virtual hosted style 的请求,否则无法判断 bucket name 到哪里终止。minio 可传入多个域名,aws 允许将 host header 直接作为 bucket name 以支持 CNAME 的情况。

我的想法是将这里的解析暴露为自定义点,通过 dyn trait 传入,允许用户自行实现解析逻辑,并提供一个支持单域名、多域名以及 CNAME 的默认实现。能否满足你们的需求?

可以满足需求。

MINIO在实现这一块上面使用了一个参数: https://min.io/docs/minio/linux/reference/minio-server/settings/core.html#id5

说明如下:

Enables Virtual Host-style requests to the MinIO deployment. Set the value to the Fully Qualified Domain Name (FQDN) for MinIO to accept incoming virtual host requests.

Omitting this setting directs MinIO to only accept the default path-style requests.

For example, consider a MinIO deployment with an assigned FQDN of minio.example.net.

With path-style lookups, applications can access the bucket using its full path as minio.example.net/mybucket.

With virtual-host lookups, application can access the bucket as a virtual host as mybucket.minio.example.net/.

loverustfs commented 2 weeks ago

close this issue.