From 1e5c432e1029601a664454388ae366ef69618d62 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Mon, 25 Jun 2018 12:33:13 -0700 Subject: MM-10702 Moving plugins to use hashicorp go-plugin. (#8978) * Moving plugins to use hashicorp go-plugin. * Tweaks from feedback. --- plugin/rpcplugin/sandbox/supervisor.go | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 plugin/rpcplugin/sandbox/supervisor.go (limited to 'plugin/rpcplugin/sandbox/supervisor.go') diff --git a/plugin/rpcplugin/sandbox/supervisor.go b/plugin/rpcplugin/sandbox/supervisor.go deleted file mode 100644 index 0e63954fd..000000000 --- a/plugin/rpcplugin/sandbox/supervisor.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package sandbox - -import ( - "context" - "fmt" - "io" - "path/filepath" - "strings" - - "github.com/mattermost/mattermost-server/model" - "github.com/mattermost/mattermost-server/plugin" - "github.com/mattermost/mattermost-server/plugin/rpcplugin" -) - -func SupervisorProvider(bundle *model.BundleInfo) (plugin.Supervisor, error) { - return rpcplugin.SupervisorWithNewProcessFunc(bundle, func(ctx context.Context) (rpcplugin.Process, io.ReadWriteCloser, error) { - executable := filepath.Clean(filepath.Join(".", bundle.Manifest.Backend.Executable)) - if strings.HasPrefix(executable, "..") { - return nil, nil, fmt.Errorf("invalid backend executable") - } - return NewProcess(ctx, &Configuration{ - MountPoints: []*MountPoint{{ - Source: bundle.Path, - Destination: "/plugin", - ReadOnly: true, - }}, - WorkingDirectory: "/plugin", - }, filepath.Join("/plugin", executable)) - }) -} -- cgit v1.2.3-1-g7c22