Allow regions to be set and honored for S3 driver. (#7010)

This is necessary for certain users where
GetBucketLocation API is disabled using IAM
policies. There is a field AmazonS3Region
which we need to re-purpose and use to support
this properly.

Fixes https://github.com/mattermost/platform/issues/6999
Этот коммит содержится в:
Harshavardhana
2017-07-31 09:22:52 -07:00
коммит произвёл Harrison Healey
родитель c506c5cac6
Коммит 489602efe5
5 изменённых файлов: 49 добавлений и 22 удалений

Просмотреть файл

@@ -526,11 +526,6 @@ func (o *Config) SetDefaults() {
o.FileSettings.AmazonS3Endpoint = "s3.amazonaws.com"
}
if o.FileSettings.AmazonS3Region == "" {
// Defaults to "us-east-1" region.
o.FileSettings.AmazonS3Region = "us-east-1"
}
if o.FileSettings.AmazonS3SSL == nil {
o.FileSettings.AmazonS3SSL = new(bool)
*o.FileSettings.AmazonS3SSL = true // Secure by default.