From 961c04cae992eadb42d286d2f85f8a675bdc68c8 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Mon, 29 Jan 2018 14:17:40 -0800 Subject: Upgrading server dependancies (#8154) --- cmd/platform/mattermost.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'cmd') diff --git a/cmd/platform/mattermost.go b/cmd/platform/mattermost.go index 0a6e3f3a6..b0190011b 100644 --- a/cmd/platform/mattermost.go +++ b/cmd/platform/mattermost.go @@ -21,6 +21,9 @@ import ( _ "github.com/go-ldap/ldap" _ "github.com/hashicorp/memberlist" _ "github.com/mattermost/rsc/qr" + _ "github.com/prometheus/client_golang/prometheus" + _ "github.com/prometheus/client_golang/prometheus/promhttp" + _ "github.com/tylerb/graceful" _ "gopkg.in/olivere/elastic.v5" ) -- cgit v1.2.3-1-g7c22 From f988e5bc305cee1d1ae23717caec7ff20bb79811 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Thu, 1 Feb 2018 01:31:49 +0100 Subject: Use default configurations for user-0 in sampledata (#8174) --- cmd/platform/sampledata.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cmd') diff --git a/cmd/platform/sampledata.go b/cmd/platform/sampledata.go index 3e8bf1093..98a041d8f 100644 --- a/cmd/platform/sampledata.go +++ b/cmd/platform/sampledata.go @@ -346,22 +346,22 @@ func createUser(idx int, teamMemberships int, channelMemberships int, teamsAndCh } useMilitaryTime := "false" - if rand.Intn(2) == 0 { + if idx != 0 && rand.Intn(2) == 0 { useMilitaryTime = "true" } collapsePreviews := "false" - if rand.Intn(2) == 0 { + if idx != 0 && rand.Intn(2) == 0 { collapsePreviews = "true" } messageDisplay := "clean" - if rand.Intn(2) == 0 { + if idx != 0 && rand.Intn(2) == 0 { messageDisplay = "compact" } channelDisplayMode := "full" - if rand.Intn(2) == 0 { + if idx != 0 && rand.Intn(2) == 0 { channelDisplayMode = "centered" } -- cgit v1.2.3-1-g7c22 From 07902b4c91ac80042df5585e25ce60a5078016bd Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Fri, 2 Feb 2018 23:24:14 +0530 Subject: report server launch errors (#8189) When starting the server using `platform server`, errors occuring during startup are not reported in the console. The command exit with a 0 exit code (i.e. "success"), although the server failed to launch. With this change, when an error occurs while initializing the app (like a missing or invalid configuration file): - the error is printed to the console; - the command exit with a "-1" exit code. This allow shell scripts to properly detect the startup failure, and to react to it. Example of error displayed: ``` $ platform server Error: LoadConfig: Error decoding config file=config.json, err=While parsing config: invalid character ':' after top-level value, `` --- cmd/platform/server.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'cmd') diff --git a/cmd/platform/server.go b/cmd/platform/server.go index d289898da..7ac075502 100644 --- a/cmd/platform/server.go +++ b/cmd/platform/server.go @@ -28,9 +28,10 @@ const ( var MaxNotificationsPerChannelDefault int64 = 1000000 var serverCmd = &cobra.Command{ - Use: "server", - Short: "Run the Mattermost server", - RunE: runServerCmd, + Use: "server", + Short: "Run the Mattermost server", + RunE: runServerCmd, + SilenceUsage: true, } func runServerCmd(cmd *cobra.Command, args []string) error { @@ -41,11 +42,10 @@ func runServerCmd(cmd *cobra.Command, args []string) error { disableConfigWatch, _ := cmd.Flags().GetBool("disableconfigwatch") - runServer(config, disableConfigWatch) - return nil + return runServer(config, disableConfigWatch) } -func runServer(configFileLocation string, disableConfigWatch bool) { +func runServer(configFileLocation string, disableConfigWatch bool) error { options := []app.Option{app.ConfigFile(configFileLocation)} if disableConfigWatch { options = append(options, app.DisableConfigWatch) @@ -54,7 +54,7 @@ func runServer(configFileLocation string, disableConfigWatch bool) { a, err := app.New(options...) if err != nil { l4g.Error(err.Error()) - return + return err } defer a.Shutdown() @@ -172,6 +172,8 @@ func runServer(configFileLocation string, disableConfigWatch bool) { a.Jobs.StopSchedulers() a.Jobs.StopWorkers() + + return nil } func runSecurityJob(a *app.App) { -- cgit v1.2.3-1-g7c22