From 6ba6431548e34146dbc103443d66f9b550ae40d8 Mon Sep 17 00:00:00 2001 From: Saturnino Abril Date: Fri, 11 Aug 2017 00:41:10 +0800 Subject: Merge 4.0.3 into release-4.1 (#7169) * fix dm custom slash command regression (#7008) * point mattermost-redux to webapp-4.0 latest (#7040) * If login is using mobile respond with JSON object (#7030) * Allow regions to be set and honored for S3 driver. (#7010) (#7073) 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 * [PLT-7231/PLT-7306] Fix GitLab SSO failure with non-English locale and make config locales more forgiving (#7106) * make config locales more forgiving by assigning default values * fix error text * update per comment * Minor updates to team * Another team update --- app/oauth.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app') diff --git a/app/oauth.go b/app/oauth.go index 4174f8146..d3633b7eb 100644 --- a/app/oauth.go +++ b/app/oauth.go @@ -682,16 +682,16 @@ func AuthorizeOAuthUser(w http.ResponseWriter, r *http.Request, service, code, s ar = model.AccessResponseFromJson(resp.Body) defer CloseBody(resp) if ar == nil { - return nil, "", nil, model.NewLocAppError("AuthorizeOAuthUser", "api.user.authorize_oauth_user.bad_response.app_error", nil, "response_body="+string(bodyBytes)) + return nil, "", stateProps, model.NewLocAppError("AuthorizeOAuthUser", "api.user.authorize_oauth_user.bad_response.app_error", nil, "response_body="+string(bodyBytes)) } } if strings.ToLower(ar.TokenType) != model.ACCESS_TOKEN_TYPE { - return nil, "", nil, model.NewLocAppError("AuthorizeOAuthUser", "api.user.authorize_oauth_user.bad_token.app_error", nil, "token_type="+ar.TokenType+", response_body="+string(bodyBytes)) + return nil, "", stateProps, model.NewLocAppError("AuthorizeOAuthUser", "api.user.authorize_oauth_user.bad_token.app_error", nil, "token_type="+ar.TokenType+", response_body="+string(bodyBytes)) } if len(ar.AccessToken) == 0 { - return nil, "", nil, model.NewLocAppError("AuthorizeOAuthUser", "api.user.authorize_oauth_user.missing.app_error", nil, "response_body="+string(bodyBytes)) + return nil, "", stateProps, model.NewLocAppError("AuthorizeOAuthUser", "api.user.authorize_oauth_user.missing.app_error", nil, "response_body="+string(bodyBytes)) } p = url.Values{} -- cgit v1.2.3-1-g7c22 From 48741434aa955d93e15e44f207294f0d90c2e0da Mon Sep 17 00:00:00 2001 From: Corey Hulen Date: Thu, 10 Aug 2017 18:44:28 -0700 Subject: PLT-7360 Adding SSE to compliance (#7165) * Adding SSE to E20 * Fixing UI bug * Fixing loc strings --- app/file.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/file.go b/app/file.go index 03d898acd..2ec6694b4 100644 --- a/app/file.go +++ b/app/file.go @@ -115,8 +115,11 @@ func MoveFile(oldPath, newPath string) *model.AppError { secretKey := utils.Cfg.FileSettings.AmazonS3SecretAccessKey secure := *utils.Cfg.FileSettings.AmazonS3SSL signV2 := *utils.Cfg.FileSettings.AmazonS3SignV2 - encrypt := *utils.Cfg.FileSettings.AmazonS3SSE region := utils.Cfg.FileSettings.AmazonS3Region + encrypt := false + if *utils.Cfg.FileSettings.AmazonS3SSE && utils.IsLicensed && *utils.License.Features.Compliance { + encrypt = true + } s3Clnt, err := s3New(endpoint, accessKey, secretKey, secure, signV2, region) if err != nil { return model.NewLocAppError("moveFile", "api.file.write_file.s3.app_error", nil, err.Error()) @@ -156,8 +159,12 @@ func WriteFile(f []byte, path string) *model.AppError { secretKey := utils.Cfg.FileSettings.AmazonS3SecretAccessKey secure := *utils.Cfg.FileSettings.AmazonS3SSL signV2 := *utils.Cfg.FileSettings.AmazonS3SignV2 - encrypt := *utils.Cfg.FileSettings.AmazonS3SSE region := utils.Cfg.FileSettings.AmazonS3Region + encrypt := false + if *utils.Cfg.FileSettings.AmazonS3SSE && utils.IsLicensed && *utils.License.Features.Compliance { + encrypt = true + } + s3Clnt, err := s3New(endpoint, accessKey, secretKey, secure, signV2, region) if err != nil { return model.NewLocAppError("WriteFile", "api.file.write_file.s3.app_error", nil, err.Error()) -- cgit v1.2.3-1-g7c22 From e1e2566c67625a15dd625c43169fd6dabff4d6a4 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Mon, 14 Aug 2017 21:20:03 -0400 Subject: PLT-7375: Email batching not on by default for accounts that have never touched their email settings (#7206) * PLT-7375: Send batched emails if batching is enabled and user has not explicitly set their email interval preference * PLT-7375: Reverting 4cf316fcd * PLT-7375: Send batched emails if batching is enabled and user has not explicitly set their email interval preference * PLT-7375: EnableEmailBatching was accidentally flipped to true in 10dcdeca4b, causing config_test.go::TestConfigFromEnviroVars to fail * PLT-7375: EnableEmailBatching was accidentally flipped to true in 10dcdeca4b, causing config_test.go::TestConfigFromEnviroVars to fail * PLT-7375: Reverted accidental changes to config * PLT-7375: Manually fixing config. --- app/notification.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/notification.go b/app/notification.go index b9153037e..2b8c0c8c4 100644 --- a/app/notification.go +++ b/app/notification.go @@ -333,8 +333,8 @@ func sendNotificationEmail(post *model.Post, user *model.User, channel *model.Ch if *utils.Cfg.EmailSettings.EnableEmailBatching { var sendBatched bool if result := <-Srv.Store.Preference().Get(user.Id, model.PREFERENCE_CATEGORY_NOTIFICATIONS, model.PREFERENCE_NAME_EMAIL_INTERVAL); result.Err != nil { - // if the call fails, assume it hasn't been set and don't batch notifications for this user - sendBatched = false + // if the call fails, assume that the interval has not been explicitly set and batch the notifications + sendBatched = true } else { // if the user has chosen to receive notifications immediately, don't batch them sendBatched = result.Data.(model.Preference).Value != model.PREFERENCE_EMAIL_INTERVAL_NO_BATCHING_SECONDS -- cgit v1.2.3-1-g7c22