2017-08-02 01:36:54 -07:00
|
|
|
// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
|
|
|
|
|
// See License.txt for license information.
|
|
|
|
|
|
|
|
|
|
package app
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"net/http"
|
2017-09-01 09:00:27 -04:00
|
|
|
"os"
|
2018-07-26 08:45:26 -04:00
|
|
|
"path/filepath"
|
2018-07-16 16:56:55 -04:00
|
|
|
"strings"
|
2017-08-02 01:36:54 -07:00
|
|
|
|
2018-04-27 12:49:45 -07:00
|
|
|
"github.com/mattermost/mattermost-server/mlog"
|
2017-09-06 23:05:10 -07:00
|
|
|
"github.com/mattermost/mattermost-server/model"
|
2017-09-11 10:02:02 -05:00
|
|
|
"github.com/mattermost/mattermost-server/plugin"
|
2018-12-17 08:51:46 -08:00
|
|
|
"github.com/mattermost/mattermost-server/utils/fileutils"
|
2017-08-02 01:36:54 -07:00
|
|
|
)
|
|
|
|
|
|
2018-11-20 08:52:51 -05:00
|
|
|
// GetPluginsEnvironment returns the plugin environment for use if plugins are enabled and
|
|
|
|
|
// initialized.
|
|
|
|
|
//
|
|
|
|
|
// To get the plugins environment when the plugins are disabled, manually acquire the plugins
|
|
|
|
|
// lock instead.
|
|
|
|
|
func (a *App) GetPluginsEnvironment() *plugin.Environment {
|
|
|
|
|
if !*a.Config().PluginSettings.Enable {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
a.Srv.PluginsLock.RLock()
|
|
|
|
|
defer a.Srv.PluginsLock.RUnlock()
|
|
|
|
|
|
|
|
|
|
return a.Srv.PluginsEnvironment
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (a *App) SetPluginsEnvironment(pluginsEnvironment *plugin.Environment) {
|
|
|
|
|
a.Srv.PluginsLock.Lock()
|
|
|
|
|
defer a.Srv.PluginsLock.Unlock()
|
|
|
|
|
|
|
|
|
|
a.Srv.PluginsEnvironment = pluginsEnvironment
|
|
|
|
|
}
|
|
|
|
|
|
2018-06-25 12:33:13 -07:00
|
|
|
func (a *App) SyncPluginsActiveState() {
|
2018-11-20 08:52:51 -05:00
|
|
|
a.Srv.PluginsLock.RLock()
|
|
|
|
|
pluginsEnvironment := a.Srv.PluginsEnvironment
|
|
|
|
|
a.Srv.PluginsLock.RUnlock()
|
|
|
|
|
|
|
|
|
|
if pluginsEnvironment == nil {
|
2017-09-01 09:00:27 -04:00
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
2018-06-25 12:33:13 -07:00
|
|
|
config := a.Config().PluginSettings
|
2018-05-23 14:26:35 -04:00
|
|
|
|
2018-06-25 12:33:13 -07:00
|
|
|
if *config.Enable {
|
2018-11-20 08:52:51 -05:00
|
|
|
availablePlugins, err := pluginsEnvironment.Available()
|
2018-06-25 12:33:13 -07:00
|
|
|
if err != nil {
|
|
|
|
|
a.Log.Error("Unable to get available plugins", mlog.Err(err))
|
|
|
|
|
return
|
2017-10-25 08:17:17 -04:00
|
|
|
}
|
|
|
|
|
|
2018-06-25 12:33:13 -07:00
|
|
|
// Deactivate any plugins that have been disabled.
|
2018-11-20 08:52:51 -05:00
|
|
|
for _, plugin := range pluginsEnvironment.Active() {
|
2018-06-25 12:33:13 -07:00
|
|
|
// Determine if plugin is enabled
|
|
|
|
|
pluginId := plugin.Manifest.Id
|
|
|
|
|
pluginEnabled := false
|
|
|
|
|
if state, ok := config.PluginStates[pluginId]; ok {
|
|
|
|
|
pluginEnabled = state.Enable
|
2017-10-25 08:17:17 -04:00
|
|
|
}
|
|
|
|
|
|
2018-06-25 12:33:13 -07:00
|
|
|
// If it's not enabled we need to deactivate it
|
|
|
|
|
if !pluginEnabled {
|
2018-11-20 08:52:51 -05:00
|
|
|
deactivated := pluginsEnvironment.Deactivate(pluginId)
|
2018-07-31 16:29:52 -04:00
|
|
|
if deactivated && plugin.Manifest.HasClient() {
|
|
|
|
|
message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_PLUGIN_DISABLED, "", "", "", nil)
|
|
|
|
|
message.Add("manifest", plugin.Manifest.ClientManifest())
|
|
|
|
|
a.Publish(message)
|
|
|
|
|
}
|
2018-05-23 14:26:35 -04:00
|
|
|
}
|
2017-12-08 13:55:41 -06:00
|
|
|
}
|
2018-05-23 14:26:35 -04:00
|
|
|
|
2018-06-25 12:33:13 -07:00
|
|
|
// Activate any plugins that have been enabled
|
|
|
|
|
for _, plugin := range availablePlugins {
|
|
|
|
|
if plugin.Manifest == nil {
|
|
|
|
|
plugin.WrapLogger(a.Log).Error("Plugin manifest could not be loaded", mlog.Err(plugin.ManifestError))
|
|
|
|
|
continue
|
|
|
|
|
}
|
2018-05-23 14:26:35 -04:00
|
|
|
|
2018-06-25 12:33:13 -07:00
|
|
|
// Determine if plugin is enabled
|
|
|
|
|
pluginId := plugin.Manifest.Id
|
|
|
|
|
pluginEnabled := false
|
|
|
|
|
if state, ok := config.PluginStates[pluginId]; ok {
|
|
|
|
|
pluginEnabled = state.Enable
|
|
|
|
|
}
|
2018-05-23 14:26:35 -04:00
|
|
|
|
2018-06-25 12:33:13 -07:00
|
|
|
// Activate plugin if enabled
|
|
|
|
|
if pluginEnabled {
|
2018-11-20 08:52:51 -05:00
|
|
|
updatedManifest, activated, err := pluginsEnvironment.Activate(pluginId)
|
2018-07-31 16:29:52 -04:00
|
|
|
if err != nil {
|
2018-06-25 12:33:13 -07:00
|
|
|
plugin.WrapLogger(a.Log).Error("Unable to activate plugin", mlog.Err(err))
|
2018-07-31 16:29:52 -04:00
|
|
|
continue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if activated && updatedManifest.HasClient() {
|
|
|
|
|
message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_PLUGIN_ENABLED, "", "", "", nil)
|
|
|
|
|
message.Add("manifest", updatedManifest.ClientManifest())
|
|
|
|
|
a.Publish(message)
|
2018-06-25 12:33:13 -07:00
|
|
|
}
|
|
|
|
|
}
|
2018-05-23 14:26:35 -04:00
|
|
|
}
|
2018-06-25 12:33:13 -07:00
|
|
|
} else { // If plugins are disabled, shutdown plugins.
|
2018-11-20 08:52:51 -05:00
|
|
|
pluginsEnvironment.Shutdown()
|
2017-09-01 09:00:27 -04:00
|
|
|
}
|
2017-12-08 13:55:41 -06:00
|
|
|
|
2018-06-25 12:33:13 -07:00
|
|
|
if err := a.notifyPluginStatusesChanged(); err != nil {
|
|
|
|
|
mlog.Error("failed to notify plugin status changed", mlog.Err(err))
|
2018-05-23 14:26:35 -04:00
|
|
|
}
|
2017-09-01 09:00:27 -04:00
|
|
|
}
|
|
|
|
|
|
2018-06-25 12:33:13 -07:00
|
|
|
func (a *App) NewPluginAPI(manifest *model.Manifest) plugin.API {
|
|
|
|
|
return NewPluginAPI(a, manifest)
|
2017-11-30 14:55:44 -06:00
|
|
|
}
|
|
|
|
|
|
2018-06-25 12:33:13 -07:00
|
|
|
func (a *App) InitPlugins(pluginDir, webappPluginDir string) {
|
2018-11-20 08:52:51 -05:00
|
|
|
a.Srv.PluginsLock.RLock()
|
|
|
|
|
pluginsEnvironment := a.Srv.PluginsEnvironment
|
|
|
|
|
a.Srv.PluginsLock.RUnlock()
|
|
|
|
|
if pluginsEnvironment != nil || !*a.Config().PluginSettings.Enable {
|
2018-06-25 12:33:13 -07:00
|
|
|
a.SyncPluginsActiveState()
|
|
|
|
|
return
|
2017-11-30 14:55:44 -06:00
|
|
|
}
|
|
|
|
|
|
2018-06-25 12:33:13 -07:00
|
|
|
a.Log.Info("Starting up plugins")
|
2017-11-21 14:15:10 -05:00
|
|
|
|
2018-06-25 12:33:13 -07:00
|
|
|
if err := os.Mkdir(pluginDir, 0744); err != nil && !os.IsExist(err) {
|
|
|
|
|
mlog.Error("Failed to start up plugins", mlog.Err(err))
|
|
|
|
|
return
|
2017-09-01 09:00:27 -04:00
|
|
|
}
|
|
|
|
|
|
2018-06-25 12:33:13 -07:00
|
|
|
if err := os.Mkdir(webappPluginDir, 0744); err != nil && !os.IsExist(err) {
|
|
|
|
|
mlog.Error("Failed to start up plugins", mlog.Err(err))
|
|
|
|
|
return
|
2017-09-01 09:00:27 -04:00
|
|
|
}
|
|
|
|
|
|
2018-11-20 08:52:51 -05:00
|
|
|
env, err := plugin.NewEnvironment(a.NewPluginAPI, pluginDir, webappPluginDir, a.Log)
|
|
|
|
|
if err != nil {
|
2018-06-25 12:33:13 -07:00
|
|
|
mlog.Error("Failed to start up plugins", mlog.Err(err))
|
|
|
|
|
return
|
2018-05-23 14:26:35 -04:00
|
|
|
}
|
2018-11-20 08:52:51 -05:00
|
|
|
a.SetPluginsEnvironment(env)
|
2018-05-23 14:26:35 -04:00
|
|
|
|
2018-12-17 08:51:46 -08:00
|
|
|
prepackagedPluginsDir, found := fileutils.FindDir("prepackaged_plugins")
|
2018-07-26 08:45:26 -04:00
|
|
|
if found {
|
|
|
|
|
if err := filepath.Walk(prepackagedPluginsDir, func(walkPath string, info os.FileInfo, err error) error {
|
|
|
|
|
if !strings.HasSuffix(walkPath, ".tar.gz") {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if fileReader, err := os.Open(walkPath); err != nil {
|
|
|
|
|
mlog.Error("Failed to open prepackaged plugin", mlog.Err(err), mlog.String("path", walkPath))
|
|
|
|
|
} else if _, err := a.InstallPlugin(fileReader, true); err != nil {
|
|
|
|
|
mlog.Error("Failed to unpack prepackaged plugin", mlog.Err(err), mlog.String("path", walkPath))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
}); err != nil {
|
|
|
|
|
mlog.Error("Failed to complete unpacking prepackaged plugins", mlog.Err(err))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-06-25 12:33:13 -07:00
|
|
|
// Sync plugin active state when config changes. Also notify plugins.
|
2018-11-20 08:52:51 -05:00
|
|
|
a.Srv.PluginsLock.Lock()
|
2018-11-07 10:20:07 -08:00
|
|
|
a.RemoveConfigListener(a.Srv.PluginConfigListenerId)
|
|
|
|
|
a.Srv.PluginConfigListenerId = a.AddConfigListener(func(*model.Config, *model.Config) {
|
2018-06-25 12:33:13 -07:00
|
|
|
a.SyncPluginsActiveState()
|
2018-11-20 08:52:51 -05:00
|
|
|
if pluginsEnvironment := a.GetPluginsEnvironment(); pluginsEnvironment != nil {
|
|
|
|
|
pluginsEnvironment.RunMultiPluginHook(func(hooks plugin.Hooks) bool {
|
|
|
|
|
hooks.OnConfigurationChange()
|
|
|
|
|
return true
|
|
|
|
|
}, plugin.OnConfigurationChangeId)
|
|
|
|
|
}
|
2018-06-25 12:33:13 -07:00
|
|
|
})
|
2018-11-20 08:52:51 -05:00
|
|
|
a.Srv.PluginsLock.Unlock()
|
2017-09-01 09:00:27 -04:00
|
|
|
|
2018-06-25 12:33:13 -07:00
|
|
|
a.SyncPluginsActiveState()
|
2017-10-25 08:17:17 -04:00
|
|
|
}
|
|
|
|
|
|
2018-06-25 12:33:13 -07:00
|
|
|
func (a *App) ShutDownPlugins() {
|
2018-11-20 08:52:51 -05:00
|
|
|
a.Srv.PluginsLock.Lock()
|
|
|
|
|
pluginsEnvironment := a.Srv.PluginsEnvironment
|
|
|
|
|
defer a.Srv.PluginsLock.Unlock()
|
|
|
|
|
if pluginsEnvironment == nil {
|
2018-06-25 12:33:13 -07:00
|
|
|
return
|
2017-09-01 09:00:27 -04:00
|
|
|
}
|
|
|
|
|
|
2018-06-25 12:33:13 -07:00
|
|
|
mlog.Info("Shutting down plugins")
|
MM-8622: improved plugin error handling (#8692)
* don't report an error on plugin activation if already active
* improved plugin logging events
Log an error when a plugin's ServeHTTP fails, or when it unexpectedly
terminates.
Restart a plugin at most three times, allowing its failure to later
bubble up under the "failed to stay running" status.
* clarified plugin activation/deactivation
Avoid repeatedly activating when any configuration bit changes. Improved
logging.
* constrain plugin ids to ^[a-zA-Z0-9-_\.]+$ and enforce minimum length
Previously, the plugin id was used unsanitized to relocate the plugin
bundle, which allowed writing outside the `plugins/` directory by using
an `id` containing `../`.
Similarly, an empty string was accepted as an id and led to unexpected
error messages.
* remove plugins by manifest path, not id
If the id within the manifest ever diverges from the actual plugin
location, it becomes impossible to remove via the API. Instead, if the
plugin is found by id, remove the path containing the manifest.
* ignore plugins with nil manifests
If a plugin was detected, but had a manifest that couldn't be parsed, it
will be left nil but still be listed among the packages. Skip over these
in most cases to avoid segfaults.
* leverage mlog more effectively for plugins
* build issues
2018-05-01 10:34:12 -04:00
|
|
|
|
2018-11-20 08:52:51 -05:00
|
|
|
pluginsEnvironment.Shutdown()
|
2017-09-15 08:51:46 -04:00
|
|
|
|
2018-11-07 10:20:07 -08:00
|
|
|
a.RemoveConfigListener(a.Srv.PluginConfigListenerId)
|
|
|
|
|
a.Srv.PluginConfigListenerId = ""
|
2018-11-20 08:52:51 -05:00
|
|
|
a.Srv.PluginsEnvironment = nil
|
2017-09-01 09:00:27 -04:00
|
|
|
}
|
|
|
|
|
|
2017-09-06 17:12:54 -05:00
|
|
|
func (a *App) GetActivePluginManifests() ([]*model.Manifest, *model.AppError) {
|
2018-11-20 08:52:51 -05:00
|
|
|
pluginsEnvironment := a.GetPluginsEnvironment()
|
|
|
|
|
if pluginsEnvironment == nil {
|
2017-09-01 09:00:27 -04:00
|
|
|
return nil, model.NewAppError("GetActivePluginManifests", "app.plugin.disabled.app_error", nil, "", http.StatusNotImplemented)
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-20 08:52:51 -05:00
|
|
|
plugins := pluginsEnvironment.Active()
|
2017-09-01 09:00:27 -04:00
|
|
|
|
|
|
|
|
manifests := make([]*model.Manifest, len(plugins))
|
|
|
|
|
for i, plugin := range plugins {
|
|
|
|
|
manifests[i] = plugin.Manifest
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return manifests, nil
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-23 14:26:35 -04:00
|
|
|
// EnablePlugin will set the config for an installed plugin to enabled, triggering asynchronous
|
|
|
|
|
// activation if inactive anywhere in the cluster.
|
2017-10-25 08:17:17 -04:00
|
|
|
func (a *App) EnablePlugin(id string) *model.AppError {
|
2018-11-20 08:52:51 -05:00
|
|
|
pluginsEnvironment := a.GetPluginsEnvironment()
|
|
|
|
|
if pluginsEnvironment == nil {
|
2017-11-30 14:55:44 -06:00
|
|
|
return model.NewAppError("EnablePlugin", "app.plugin.disabled.app_error", nil, "", http.StatusNotImplemented)
|
2017-10-25 08:17:17 -04:00
|
|
|
}
|
|
|
|
|
|
2018-11-20 08:52:51 -05:00
|
|
|
plugins, err := pluginsEnvironment.Available()
|
2017-10-25 08:17:17 -04:00
|
|
|
if err != nil {
|
|
|
|
|
return model.NewAppError("EnablePlugin", "app.plugin.config.app_error", nil, err.Error(), http.StatusInternalServerError)
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-16 16:56:55 -04:00
|
|
|
id = strings.ToLower(id)
|
|
|
|
|
|
2017-10-25 08:17:17 -04:00
|
|
|
var manifest *model.Manifest
|
|
|
|
|
for _, p := range plugins {
|
|
|
|
|
if p.Manifest.Id == id {
|
|
|
|
|
manifest = p.Manifest
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if manifest == nil {
|
|
|
|
|
return model.NewAppError("EnablePlugin", "app.plugin.not_installed.app_error", nil, "", http.StatusBadRequest)
|
|
|
|
|
}
|
|
|
|
|
|
2017-10-31 09:39:31 -05:00
|
|
|
a.UpdateConfig(func(cfg *model.Config) {
|
|
|
|
|
cfg.PluginSettings.PluginStates[id] = &model.PluginState{Enable: true}
|
|
|
|
|
})
|
2017-10-25 08:17:17 -04:00
|
|
|
|
2018-06-25 12:33:13 -07:00
|
|
|
// This call will cause SyncPluginsActiveState to be called and the plugin to be activated
|
2017-10-31 09:39:31 -05:00
|
|
|
if err := a.SaveConfig(a.Config(), true); err != nil {
|
2018-03-13 11:03:12 -05:00
|
|
|
if err.Id == "ent.cluster.save_config.error" {
|
|
|
|
|
return model.NewAppError("EnablePlugin", "app.plugin.cluster.save_config.app_error", nil, "", http.StatusInternalServerError)
|
|
|
|
|
}
|
2017-10-25 08:17:17 -04:00
|
|
|
return model.NewAppError("EnablePlugin", "app.plugin.config.app_error", nil, err.Error(), http.StatusInternalServerError)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// DisablePlugin will set the config for an installed plugin to disabled, triggering deactivation if active.
|
|
|
|
|
func (a *App) DisablePlugin(id string) *model.AppError {
|
2018-11-20 08:52:51 -05:00
|
|
|
pluginsEnvironment := a.GetPluginsEnvironment()
|
|
|
|
|
if pluginsEnvironment == nil {
|
2017-11-30 14:55:44 -06:00
|
|
|
return model.NewAppError("DisablePlugin", "app.plugin.disabled.app_error", nil, "", http.StatusNotImplemented)
|
2017-10-25 08:17:17 -04:00
|
|
|
}
|
|
|
|
|
|
2018-11-20 08:52:51 -05:00
|
|
|
plugins, err := pluginsEnvironment.Available()
|
2017-10-25 08:17:17 -04:00
|
|
|
if err != nil {
|
|
|
|
|
return model.NewAppError("DisablePlugin", "app.plugin.config.app_error", nil, err.Error(), http.StatusInternalServerError)
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-16 16:56:55 -04:00
|
|
|
id = strings.ToLower(id)
|
|
|
|
|
|
2017-10-25 08:17:17 -04:00
|
|
|
var manifest *model.Manifest
|
|
|
|
|
for _, p := range plugins {
|
|
|
|
|
if p.Manifest.Id == id {
|
|
|
|
|
manifest = p.Manifest
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if manifest == nil {
|
|
|
|
|
return model.NewAppError("DisablePlugin", "app.plugin.not_installed.app_error", nil, "", http.StatusBadRequest)
|
|
|
|
|
}
|
|
|
|
|
|
2017-10-31 09:39:31 -05:00
|
|
|
a.UpdateConfig(func(cfg *model.Config) {
|
|
|
|
|
cfg.PluginSettings.PluginStates[id] = &model.PluginState{Enable: false}
|
|
|
|
|
})
|
2019-01-10 12:52:10 -08:00
|
|
|
a.UnregisterPluginCommands(id)
|
2017-10-25 08:17:17 -04:00
|
|
|
|
2017-10-31 09:39:31 -05:00
|
|
|
if err := a.SaveConfig(a.Config(), true); err != nil {
|
2017-10-25 08:17:17 -04:00
|
|
|
return model.NewAppError("DisablePlugin", "app.plugin.config.app_error", nil, err.Error(), http.StatusInternalServerError)
|
2017-09-01 09:00:27 -04:00
|
|
|
}
|
|
|
|
|
|
2017-09-15 08:51:46 -04:00
|
|
|
return nil
|
2017-09-01 09:00:27 -04:00
|
|
|
}
|
2017-09-11 10:02:02 -05:00
|
|
|
|
2018-06-25 12:33:13 -07:00
|
|
|
func (a *App) GetPlugins() (*model.PluginsResponse, *model.AppError) {
|
2018-11-20 08:52:51 -05:00
|
|
|
pluginsEnvironment := a.GetPluginsEnvironment()
|
|
|
|
|
if pluginsEnvironment == nil {
|
2018-06-25 12:33:13 -07:00
|
|
|
return nil, model.NewAppError("GetPlugins", "app.plugin.disabled.app_error", nil, "", http.StatusNotImplemented)
|
2017-12-08 13:55:41 -06:00
|
|
|
}
|
|
|
|
|
|
2018-11-20 08:52:51 -05:00
|
|
|
availablePlugins, err := pluginsEnvironment.Available()
|
2018-06-25 12:33:13 -07:00
|
|
|
if err != nil {
|
|
|
|
|
return nil, model.NewAppError("GetPlugins", "app.plugin.get_plugins.app_error", nil, err.Error(), http.StatusInternalServerError)
|
2017-12-08 13:55:41 -06:00
|
|
|
}
|
2018-06-25 12:33:13 -07:00
|
|
|
resp := &model.PluginsResponse{Active: []*model.PluginInfo{}, Inactive: []*model.PluginInfo{}}
|
|
|
|
|
for _, plugin := range availablePlugins {
|
|
|
|
|
if plugin.Manifest == nil {
|
|
|
|
|
continue
|
2017-12-08 13:55:41 -06:00
|
|
|
}
|
|
|
|
|
|
2018-06-25 12:33:13 -07:00
|
|
|
info := &model.PluginInfo{
|
|
|
|
|
Manifest: *plugin.Manifest,
|
2017-12-08 13:55:41 -06:00
|
|
|
}
|
|
|
|
|
|
2018-11-20 08:52:51 -05:00
|
|
|
if pluginsEnvironment.IsActive(plugin.Manifest.Id) {
|
2018-06-25 12:33:13 -07:00
|
|
|
resp.Active = append(resp.Active, info)
|
|
|
|
|
} else {
|
|
|
|
|
resp.Inactive = append(resp.Inactive, info)
|
2017-12-08 13:55:41 -06:00
|
|
|
}
|
|
|
|
|
}
|
2018-05-15 13:33:47 -07:00
|
|
|
|
2018-06-25 12:33:13 -07:00
|
|
|
return resp, nil
|
2018-05-15 13:33:47 -07:00
|
|
|
}
|