From 7f8cb30bd36a88307148612f4b27d6a28f954b6b Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Tue, 5 Jan 2016 20:33:31 -0600 Subject: [PATCH 1/4] PLT-1607 adding more debugging info for email and push notifications --- api/post.go | 1 + utils/mail.go | 1 + 2 files changed, 2 insertions(+) diff --git a/api/post.go b/api/post.go index 6c1d4bbd15..958479427e 100644 --- a/api/post.go +++ b/api/post.go @@ -650,6 +650,7 @@ func sendNotificationsAndForget(c *Context, post *model.Post, team *model.Team, httpClient := http.Client{} request, _ := http.NewRequest("POST", *utils.Cfg.EmailSettings.PushNotificationServer+"/api/v1/send_push", strings.NewReader(msg.ToJson())) + l4g.Debug("Sending push notification to " + msg.DeviceId + " with msg of '" + msg.Message + "'") if _, err := httpClient.Do(request); err != nil { l4g.Error("Failed to send push notificationid=%v, err=%v", id, err) } diff --git a/utils/mail.go b/utils/mail.go index 07a79eeb29..ece4105a67 100644 --- a/utils/mail.go +++ b/utils/mail.go @@ -98,6 +98,7 @@ func SendMail(to, subject, body string) *model.AppError { } func SendMailUsingConfig(to, subject, body string, config *model.Config) *model.AppError { + l4g.Debug("sending mail to " + to + " with subject of '" + subject + "'") if !config.EmailSettings.SendEmailNotifications || len(config.EmailSettings.SMTPServer) == 0 { return nil From 01a5f67398e0fa32f739534feba75d4c3a904c3e Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Tue, 5 Jan 2016 20:35:36 -0600 Subject: [PATCH 2/4] PLT-1607 adding more debugging info for email and push notifications --- config/config.json | 31 +++++++++++++++++++++++++++++-- utils/mail.go | 4 ++-- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/config/config.json b/config/config.json index 5469608f8e..fff45b9e6f 100644 --- a/config/config.json +++ b/config/config.json @@ -54,7 +54,11 @@ "AmazonS3AccessKeyId": "", "AmazonS3SecretAccessKey": "", "AmazonS3Bucket": "", - "AmazonS3Region": "" + "AmazonS3Region": "", + "AmazonS3Endpoint": "", + "AmazonS3BucketEndpoint": "", + "AmazonS3LocationConstraint": false, + "AmazonS3LowercaseBucket": false }, "EmailSettings": { "EnableSignUpWithEmail": true, @@ -99,5 +103,28 @@ "AuthEndpoint": "", "TokenEndpoint": "", "UserApiEndpoint": "" + }, + "GoogleSettings": { + "Enable": false, + "Secret": "", + "Id": "", + "Scope": "", + "AuthEndpoint": "", + "TokenEndpoint": "", + "UserApiEndpoint": "" + }, + "LdapSettings": { + "Enable": false, + "LdapServer": null, + "LdapPort": 389, + "BaseDN": null, + "BindUsername": null, + "BindPassword": null, + "FirstNameAttribute": null, + "LastNameAttribute": null, + "EmailAttribute": null, + "UsernameAttribute": null, + "IdAttribute": null, + "QueryTimeout": 60 } -} +} \ No newline at end of file diff --git a/utils/mail.go b/utils/mail.go index ece4105a67..6625060de8 100644 --- a/utils/mail.go +++ b/utils/mail.go @@ -98,12 +98,12 @@ func SendMail(to, subject, body string) *model.AppError { } func SendMailUsingConfig(to, subject, body string, config *model.Config) *model.AppError { - l4g.Debug("sending mail to " + to + " with subject of '" + subject + "'") - if !config.EmailSettings.SendEmailNotifications || len(config.EmailSettings.SMTPServer) == 0 { return nil } + l4g.Debug("sending mail to " + to + " with subject of '" + subject + "'") + fromMail := mail.Address{config.EmailSettings.FeedbackName, config.EmailSettings.FeedbackEmail} toMail := mail.Address{"", to} From 6f50da3eaf65bf12b5d7d71e64228482a9988067 Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Tue, 5 Jan 2016 20:38:34 -0600 Subject: [PATCH 3/4] Cleaning up config --- config/config.json | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/config/config.json b/config/config.json index fff45b9e6f..7c2ec94267 100644 --- a/config/config.json +++ b/config/config.json @@ -103,28 +103,5 @@ "AuthEndpoint": "", "TokenEndpoint": "", "UserApiEndpoint": "" - }, - "GoogleSettings": { - "Enable": false, - "Secret": "", - "Id": "", - "Scope": "", - "AuthEndpoint": "", - "TokenEndpoint": "", - "UserApiEndpoint": "" - }, - "LdapSettings": { - "Enable": false, - "LdapServer": null, - "LdapPort": 389, - "BaseDN": null, - "BindUsername": null, - "BindPassword": null, - "FirstNameAttribute": null, - "LastNameAttribute": null, - "EmailAttribute": null, - "UsernameAttribute": null, - "IdAttribute": null, - "QueryTimeout": 60 } } \ No newline at end of file From a0e3823e9cbe295591aa0a0946eafa42a94a6050 Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Tue, 5 Jan 2016 20:52:39 -0600 Subject: [PATCH 4/4] Adding missing config properties --- docker/dev/config_docker.json | 6 +++++- docker/local/config_docker.json | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/docker/dev/config_docker.json b/docker/dev/config_docker.json index 2c109c105b..3a5195de34 100644 --- a/docker/dev/config_docker.json +++ b/docker/dev/config_docker.json @@ -54,7 +54,11 @@ "AmazonS3AccessKeyId": "", "AmazonS3SecretAccessKey": "", "AmazonS3Bucket": "", - "AmazonS3Region": "" + "AmazonS3Region": "", + "AmazonS3Endpoint": "", + "AmazonS3BucketEndpoint": "", + "AmazonS3LocationConstraint": false, + "AmazonS3LowercaseBucket": false }, "EmailSettings": { "EnableSignUpWithEmail": true, diff --git a/docker/local/config_docker.json b/docker/local/config_docker.json index 2c109c105b..3a5195de34 100644 --- a/docker/local/config_docker.json +++ b/docker/local/config_docker.json @@ -54,7 +54,11 @@ "AmazonS3AccessKeyId": "", "AmazonS3SecretAccessKey": "", "AmazonS3Bucket": "", - "AmazonS3Region": "" + "AmazonS3Region": "", + "AmazonS3Endpoint": "", + "AmazonS3BucketEndpoint": "", + "AmazonS3LocationConstraint": false, + "AmazonS3LowercaseBucket": false }, "EmailSettings": { "EnableSignUpWithEmail": true,