1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2024-11-18 16:31:44 +02:00

Add IMGPROXY_S3_ENDPOINT_USE_PATH_STYLE control UsePathStyle (#1314)

This commit is contained in:
Xie Wu 2024-08-29 21:24:54 +08:00 committed by GitHub
parent dc6acc78c3
commit 43af46b48b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View File

@ -107,6 +107,7 @@ var (
S3Enabled bool
S3Region string
S3Endpoint string
S3EndpointUsePathStyle bool
S3AssumeRoleArn string
S3AssumeRoleExternalID string
S3MultiRegion bool
@ -308,6 +309,7 @@ func Reset() {
S3Enabled = false
S3Region = ""
S3Endpoint = ""
S3EndpointUsePathStyle = true
S3AssumeRoleArn = ""
S3AssumeRoleExternalID = ""
S3MultiRegion = false
@ -539,6 +541,7 @@ func Configure() error {
configurators.Bool(&S3Enabled, "IMGPROXY_USE_S3")
configurators.String(&S3Region, "IMGPROXY_S3_REGION")
configurators.String(&S3Endpoint, "IMGPROXY_S3_ENDPOINT")
configurators.Bool(&S3EndpointUsePathStyle, "IMGPROXY_S3_ENDPOINT_USE_PATH_STYLE")
configurators.String(&S3AssumeRoleArn, "IMGPROXY_S3_ASSUME_ROLE_ARN")
configurators.String(&S3AssumeRoleExternalID, "IMGPROXY_S3_ASSUME_ROLE_EXTERNAL_ID")
configurators.Bool(&S3MultiRegion, "IMGPROXY_S3_MULTI_REGION")

View File

@ -84,7 +84,7 @@ func New() (http.RoundTripper, error) {
}
clientOptions = append(clientOptions, func(o *s3.Options) {
o.BaseEndpoint = aws.String(endpoint)
o.UsePathStyle = true
o.UsePathStyle = config.S3EndpointUsePathStyle
})
}