MM-15494 Adding warning log when someone has configured a Mattermost push proxy with HTTP endpoint (#10869)

* MM-15494 Adding warning log when someone has configured a Mattermost push proxy with HTTP endpoint

* MM-15494 go fmt check

* MM-15494 Making function private

* MM-15494 Updating warning message
This commit is contained in:
Stylianos Rigas
2019-05-20 17:39:57 +03:00
committed by GitHub
parent 9652b49569
commit 713cf1ec36

View File

@@ -216,6 +216,8 @@ func NewServer(options ...Option) (*Server, error) {
mlog.Info(fmt.Sprintf("Current working directory is %v", pwd))
mlog.Info("Loaded config", mlog.String("source", s.configStore.String()))
s.checkPushNotificationServerUrl()
license := s.License()
if license == nil && len(s.Config().SqlSettings.DataSourceReplicas) > 1 {
@@ -620,6 +622,13 @@ func (a *App) OriginChecker() func(*http.Request) bool {
return nil
}
func (s *Server) checkPushNotificationServerUrl() {
notificationServer := *s.Config().EmailSettings.PushNotificationServer
if strings.HasPrefix(notificationServer, "http://") == true {
mlog.Warn("Your push notification server is configured with HTTP. For improved security, update to HTTPS in your configuration.")
}
}
func runSecurityJob(s *Server) {
doSecurity(s)
model.CreateRecurringTask("Security", func() {