PLT-7622 Improvements to server handling of webapp plugins (#7445)

* Improvements to server handling of webapp plugins

* Fix newline

* Update manifest function names
This commit is contained in:
Joram Wilander
2017-09-15 08:51:46 -04:00
committed by GitHub
parent 2a6cd44f23
commit 2628022275
12 changed files with 184 additions and 63 deletions

View File

@@ -62,11 +62,6 @@ func runServer(configFileLocation string) {
l4g.Info(utils.T("mattermost.working_dir"), pwd)
l4g.Info(utils.T("mattermost.config_file"), utils.FindConfigFile(configFileLocation))
// Enable developer settings if this is a "dev" build
if model.BuildNumber == "dev" {
*utils.Cfg.ServiceSettings.EnableDeveloper = true
}
if err := utils.TestFileConnection(); err != nil {
l4g.Error("Problem with file storage settings: " + err.Error())
}
@@ -79,7 +74,12 @@ func runServer(configFileLocation string) {
if model.BuildEnterpriseReady == "true" {
a.LoadLicense()
}
a.InitPlugins("plugins", "webapp/dist")
if webappDir, ok := utils.FindDir(model.CLIENT_DIR); ok {
a.InitPlugins("plugins", webappDir+"/plugins")
} else {
l4g.Error("Unable to find webapp directory, could not initialize plugins")
}
wsapi.InitRouter()
api4.InitApi(a.Srv.Router, false)
@@ -98,6 +98,11 @@ func runServer(configFileLocation string) {
app.ReloadConfig()
// Enable developer settings if this is a "dev" build
if model.BuildNumber == "dev" {
*utils.Cfg.ServiceSettings.EnableDeveloper = true
}
resetStatuses(a)
a.StartServer()