summaryrefslogtreecommitdiffstats
path: root/app/server.go
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 /app/server.go
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 'app/server.go')
-rw-r--r--app/server.go34
1 files changed, 2 insertions, 32 deletions
diff --git a/app/server.go b/app/server.go
index 21d727724..c44408d12 100644
--- a/app/server.go
+++ b/app/server.go
@@ -7,7 +7,6 @@ import (
"crypto/tls"
"net"
"net/http"
- "os"
"strings"
"time"
@@ -20,7 +19,6 @@ import (
"gopkg.in/throttled/throttled.v2/store/memstore"
"github.com/mattermost/mattermost-server/model"
- "github.com/mattermost/mattermost-server/plugin/pluginenv"
"github.com/mattermost/mattermost-server/store"
"github.com/mattermost/mattermost-server/utils"
)
@@ -30,7 +28,6 @@ type Server struct {
WebSocketRouter *WebSocketRouter
Router *mux.Router
GracefulServer *graceful.Server
- PluginEnv *pluginenv.Environment
}
var allowedMethods []string = []string{
@@ -187,10 +184,6 @@ func (a *App) StartServer() {
}()
}
- if utils.IsLicensed() && *utils.License().Features.FutureFeatures && *utils.Cfg.PluginSettings.Enable {
- a.StartupPlugins("plugins", "webapp/dist")
- }
-
go func() {
var err error
if *utils.Cfg.ServiceSettings.ConnectionSecurity == model.CONN_SECURITY_TLS {
@@ -226,30 +219,7 @@ func (a *App) StopServer() {
a.Srv.Store.Close()
HubStop()
- l4g.Info(utils.T("api.server.stop_server.stopped.info"))
-}
-
-func (a *App) StartupPlugins(pluginPath, webappPath string) {
- l4g.Info("Starting up plugins")
-
- err := os.Mkdir(pluginPath, 0744)
- if err != nil {
- if os.IsExist(err) {
- err = nil
- } else {
- l4g.Error("failed to start up plugins: " + err.Error())
- return
- }
- }
-
- a.Srv.PluginEnv, err = pluginenv.New(
- pluginenv.SearchPath(pluginPath),
- pluginenv.WebappPath(webappPath),
- )
+ a.ShutDownPlugins()
- if err != nil {
- l4g.Error("failed to start up plugins: " + err.Error())
- }
-
- a.ActivatePlugins()
+ l4g.Info(utils.T("api.server.stop_server.stopped.info"))
}