Support AWS Signature V2 for Mattermost for S3 storage. (#6462)

Certain S3 compatible servers only use Legacy Signature (AWS
Signature V2), current code only supports signature v4.

This PR adds facility to click a button on the UI to enable
legacy signature with S3 compatible servers.
Этот коммит содержится в:
Harshavardhana
2017-05-30 16:12:24 -07:00
коммит произвёл Corey Hulen
родитель d409c7c1c6
Коммит f520aa1f4d
8 изменённых файлов: 69 добавлений и 11 удалений

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

@@ -238,6 +238,7 @@ type FileSettings struct {
AmazonS3Region string
AmazonS3Endpoint string
AmazonS3SSL *bool
AmazonS3SignV2 *bool
}
type EmailSettings struct {
@@ -502,6 +503,11 @@ func (o *Config) SetDefaults() {
*o.FileSettings.AmazonS3SSL = true // Secure by default.
}
if o.FileSettings.AmazonS3SignV2 == nil {
o.FileSettings.AmazonS3SignV2 = new(bool)
// Signature v2 is not enabled by default.
}
if o.FileSettings.EnableFileAttachments == nil {
o.FileSettings.EnableFileAttachments = new(bool)
*o.FileSettings.EnableFileAttachments = true