* i18n: consolidate i18n types & runtime services * Chore: updates after PR feedback * Chore: updates after feedback * Chore: updates after feedback * Chore: adds feature toggle * Chore: adds locale to backend * Chore: adds locales to i18n instance * Chore: fix missing path in CODEOWNERS * Chore: fix go lint issues * Chore: fix missing path in CODEOWNERS * Chore: updates after PR feedback * Trigger build * Chore: updates after PR feedback * Chore: use resolved language for lookup * Chore: updates after PR feedback * Update pkg/plugins/plugins.go Co-authored-by: Will Browne <wbrowne@users.noreply.github.com> * Chore: updates after PR feedback * Chore: updates after PR feedback --------- Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
62 lines
1.9 KiB
Go
62 lines
1.9 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
|
|
GrafanaComAPIToken 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
|
|
SriChecksEnabled bool
|
|
PluginsCDNSyncLoaderEnabled bool
|
|
LocalizationForPlugins 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, grafanaComAPIToken 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,
|
|
GrafanaComAPIToken: grafanaComAPIToken,
|
|
}
|
|
}
|