[PR #2934] Add S3_ADDRESS_STYLE configuration option #23921

Closed
opened 2026-02-21 20:22:01 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/2934

State: closed
Merged: Yes


Description

Tencent COS does not support virtual-hosted-style bucket after 2024.1.1, see the notice

In order to use Tencent COS as external storage, addressing style must set to virtual instead of auto(default value)

https://boto3.amazonaws.com/v1/documentation/api/1.9.42/guide/s3.html#changing-the-addressing-style

This pull request add a new configuration key to support this.

Type of Change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • import config and execute get_env
>>> from config import get_env
>>> get_env('S3_ADDRESS_STYLE')
'auto'

This return the default value of s3 client, which will not change the default behavior, anyone in need can change the settings to archive their goal.

IMHO, The code change is trivial and need no further test

Suggested Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods
  • optional I have made corresponding changes to the documentation
  • optional I have added tests that prove my fix is effective or that my feature works
  • optional New and existing unit tests pass locally with my changes
**Original Pull Request:** https://github.com/langgenius/dify/pull/2934 **State:** closed **Merged:** Yes --- # Description Tencent COS does not support virtual-hosted-style bucket after 2024.1.1, see the [notice](https://cloud.tencent.com/document/product/436/96243) In order to use Tencent COS as external storage, addressing style must set to `virtual` instead of `auto`(default value) https://boto3.amazonaws.com/v1/documentation/api/1.9.42/guide/s3.html#changing-the-addressing-style This pull request add a new configuration key to support this. ## Type of Change - [x] New feature (non-breaking change which adds functionality) # How Has This Been Tested? - [x] import config and execute get_env ``` >>> from config import get_env >>> get_env('S3_ADDRESS_STYLE') 'auto' ``` This return the default value of s3 client, which will not change the default behavior, anyone in need can change the settings to archive their goal. IMHO, The code change is trivial and need no further test # Suggested Checklist: - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [x] My changes generate no new warnings - [x] I ran `dev/reformat`(backend) and `cd web && npx lint-staged`(frontend) to appease the lint gods - [ ] `optional` I have made corresponding changes to the documentation - [ ] `optional` I have added tests that prove my fix is effective or that my feature works - [x] `optional` New and existing unit tests pass locally with my changes
yindo added the pull-request label 2026-02-21 20:22:01 -05:00
yindo closed this issue 2026-02-21 20:22:01 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#23921