mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-10-04 18:33:36 +02:00
Try to use Application Default Credentials when GCS is enabled but GCS key is not provided
This commit is contained in:
@@ -176,6 +176,7 @@ type config struct {
|
||||
S3Enabled bool
|
||||
S3Region string
|
||||
S3Endpoint string
|
||||
GCSEnabled bool
|
||||
GCSKey string
|
||||
|
||||
ETagEnabled bool
|
||||
@@ -307,6 +308,7 @@ func configure() {
|
||||
strEnvConfig(&conf.S3Region, "IMGPROXY_S3_REGION")
|
||||
strEnvConfig(&conf.S3Endpoint, "IMGPROXY_S3_ENDPOINT")
|
||||
|
||||
boolEnvConfig(&conf.GCSEnabled, "IMGPROXY_USE_GCS")
|
||||
strEnvConfig(&conf.GCSKey, "IMGPROXY_GCS_KEY")
|
||||
|
||||
boolEnvConfig(&conf.ETagEnabled, "IMGPROXY_USE_ETAG")
|
||||
@@ -447,6 +449,11 @@ func configure() {
|
||||
}
|
||||
}
|
||||
|
||||
if _, ok := os.LookupEnv("IMGPROXY_USE_GCS"); !ok && len(conf.GCSKey) > 0 {
|
||||
logWarning("Set IMGPROXY_USE_GCS to true since it may be required by future versions to enable GCS support")
|
||||
conf.GCSEnabled = true
|
||||
}
|
||||
|
||||
if err := checkPresets(conf.Presets); err != nil {
|
||||
logFatal(err.Error())
|
||||
}
|
||||
|
Reference in New Issue
Block a user