mirror of
https://github.com/grafana/grafana.git
synced 2025-01-09 23:53:25 -06:00
7783b16e47
Plugins: Fix grafana-com API URL usage
57 lines
1.7 KiB
Go
57 lines
1.7 KiB
Go
package config
|
|
|
|
import (
|
|
"github.com/grafana/grafana/pkg/setting"
|
|
)
|
|
|
|
// PluginManagementCfg is the configuration for the plugin management system.
|
|
// It includes settings which are used to configure different components of plugin management.
|
|
type PluginManagementCfg struct {
|
|
DevMode bool
|
|
|
|
PluginsPath string
|
|
|
|
PluginSettings setting.PluginSettings
|
|
PluginsAllowUnsigned []string
|
|
DisablePlugins []string
|
|
ForwardHostEnvVars []string
|
|
|
|
PluginsCDNURLTemplate string
|
|
|
|
GrafanaComAPIURL string
|
|
|
|
GrafanaAppURL string
|
|
|
|
Features Features
|
|
|
|
AngularSupportEnabled bool
|
|
HideAngularDeprecation []string
|
|
}
|
|
|
|
// Features contains the feature toggles used for the plugin management system.
|
|
type Features struct {
|
|
ExternalCorePluginsEnabled bool
|
|
SkipHostEnvVarsEnabled bool
|
|
}
|
|
|
|
// NewPluginManagementCfg returns a new PluginManagementCfg.
|
|
func NewPluginManagementCfg(devMode bool, pluginsPath string, pluginSettings setting.PluginSettings, pluginsAllowUnsigned []string,
|
|
pluginsCDNURLTemplate string, appURL string, features Features, angularSupportEnabled bool,
|
|
grafanaComAPIURL string, disablePlugins []string, hideAngularDeprecation []string, forwardHostEnvVars []string,
|
|
) *PluginManagementCfg {
|
|
return &PluginManagementCfg{
|
|
PluginsPath: pluginsPath,
|
|
DevMode: devMode,
|
|
PluginSettings: pluginSettings,
|
|
PluginsAllowUnsigned: pluginsAllowUnsigned,
|
|
DisablePlugins: disablePlugins,
|
|
PluginsCDNURLTemplate: pluginsCDNURLTemplate,
|
|
GrafanaComAPIURL: grafanaComAPIURL,
|
|
GrafanaAppURL: appURL,
|
|
Features: features,
|
|
AngularSupportEnabled: angularSupportEnabled,
|
|
HideAngularDeprecation: hideAngularDeprecation,
|
|
ForwardHostEnvVars: forwardHostEnvVars,
|
|
}
|
|
}
|