Skip to content

Commit

Permalink
📝 docs: add S3 environment variables to documentation (lobehub#3562)
Browse files Browse the repository at this point in the history
* Add S3 environment variables to documentation
  • Loading branch information
arvinxx authored Aug 22, 2024
1 parent 5c2ba8a commit 7a83cf9
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
20 changes: 20 additions & 0 deletions docs/self-hosting/advanced/s3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,26 @@ In this documentation, S3 refers to a compatible S3 storage solution, which supp
Additionally, since this access domain is often a separate URL, it needs to be configured to allow cross-origin access to the site. Otherwise, cross-origin issues will occur in the browser.
</Callout>
### `S3_ENABLE_PATH_STYLE`
Whether to enable the `path-style` access mode of S3. This option is disabled by default. If your S3 service provider uses `path-style`, set `S3_ENABLE_PATH_STYLE` to `1` to enable it.
<Callout type={'info'}>
`path-style` and `virtual-host` are different ways to access buckets and objects in S3, with different URL structures and domain name resolutions.
Assuming the domain name of the S3 service provider is s3.example.net, the bucket is mybucket, and the object is config.env, the specific differences are as follows:
- path-style: `s3.example.net/mybucket/config.env`
- virtual-host: `mybucket.s3.example.net/config.env`
</Callout>
<Callout type={'tip'}>
Common S3 cloud service providers often default to the `virtual-host` mode, while self-deployed services like Minio default to using `path-style`. Therefore, if you use Minio as the S3 service, you need to set `S3_ENABLE_PATH_STYLE=1`.
</Callout>
</Steps>
## S3 Configuration Guide
Expand Down
22 changes: 22 additions & 0 deletions docs/self-hosting/advanced/s3.zh-CN.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,28 @@ S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com

</Callout>

### `S3_ENABLE_PATH_STYLE`

是否启用 S3 的 `path-style` 访问模式。此选项默认禁用。如果您的 S3 服务提供商使用 `path-style`,请将 `S3_ENABLE_PATH_STYLE` 设置为 `1` 以启用它。

<Callout type={'info'}>

`path-style``virtual-host` 在 S3 中是访问 bucket 和 object 的不同方式,URL 的结构和域名解析不太一样

假设 S3 服务商的域名是 s3.example.net ,bucket为mybucket,object为config.env,具体区别如下:
- path-style : `s3.example.net/mybucket/config.env`
- virtual-host : `mybucket.s3.example.net/config.env`

</Callout>

<Callout type={'tip'}>

常见的 S3 Cloud 服务商往往默认采用 `virtual-host` 模式,而自部署服务 minio 则默认使用的是 `path-style`。 因此如果你使用了 minio 作为 S3 服务,你需要设置 `S3_ENABLE_PATH_STYLE=1`


</Callout>


</Steps>

## S3 配置指南
Expand Down

0 comments on commit 7a83cf9

Please sign in to comment.