summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2017-09-11 10:02:02 -0500
committerGitHub <noreply@github.com>2017-09-11 10:02:02 -0500
commit402491b7e52c4d836c1274976cdb387852cfd17b (patch)
treee8adcbdf0af5370f8af11e3fc1021a328c971a5d /cmd
parenta69bed712d53e9a7984915fffffc8a2fd1647a7a (diff)
downloadchat-402491b7e52c4d836c1274976cdb387852cfd17b.tar.gz
chat-402491b7e52c4d836c1274976cdb387852cfd17b.tar.bz2
chat-402491b7e52c4d836c1274976cdb387852cfd17b.zip
PLT-7407: Back-end plugins (#7409)
* tie back-end plugins together * fix comment typo * add tests and a bit of polish * tests and polish * add test, don't let backend executable paths escape the plugin directory
Diffstat (limited to 'cmd')
-rw-r--r--cmd/platform/server.go24
1 files changed, 13 insertions, 11 deletions
diff --git a/cmd/platform/server.go b/cmd/platform/server.go
index a11bc58b8..fe5f5272b 100644
--- a/cmd/platform/server.go
+++ b/cmd/platform/server.go
@@ -71,20 +71,22 @@ func runServer(configFileLocation string) {
l4g.Error("Problem with file storage settings: " + err.Error())
}
- app.Global().NewServer()
- app.Global().InitStores()
+ a := app.Global()
+ a.NewServer()
+ a.InitStores()
api.InitRouter()
+
+ if model.BuildEnterpriseReady == "true" {
+ a.LoadLicense()
+ }
+ a.InitPlugins("plugins", "webapp/dist")
+
wsapi.InitRouter()
api4.InitApi(false)
api.InitApi()
- app.Global().InitPlugins()
wsapi.InitApi()
web.InitWeb()
- if model.BuildEnterpriseReady == "true" {
- app.Global().LoadLicense()
- }
-
if !utils.IsLicensed() && len(utils.Cfg.SqlSettings.DataSourceReplicas) > 1 {
l4g.Warn(utils.T("store.sql.read_replicas_not_licensed.critical"))
utils.Cfg.SqlSettings.DataSourceReplicas = utils.Cfg.SqlSettings.DataSourceReplicas[:1]
@@ -98,7 +100,7 @@ func runServer(configFileLocation string) {
resetStatuses()
- app.Global().StartServer()
+ a.StartServer()
// If we allow testing then listen for manual testing URL hits
if utils.Cfg.ServiceSettings.EnableTesting {
@@ -118,7 +120,7 @@ func runServer(configFileLocation string) {
}
if einterfaces.GetClusterInterface() != nil {
- app.Global().RegisterAllClusterMessageHandlers()
+ a.RegisterAllClusterMessageHandlers()
einterfaces.GetClusterInterface().StartInterNodeCommunication()
}
@@ -132,7 +134,7 @@ func runServer(configFileLocation string) {
}
}
- jobs.Srv.Store = app.Global().Srv.Store
+ jobs.Srv.Store = a.Srv.Store
if *utils.Cfg.JobSettings.RunJobs {
jobs.Srv.StartWorkers()
}
@@ -157,7 +159,7 @@ func runServer(configFileLocation string) {
jobs.Srv.StopSchedulers()
jobs.Srv.StopWorkers()
- app.Global().StopServer()
+ a.StopServer()
}
func runSecurityJob() {