Documentation
¶
Index ¶
- Constants
- Variables
- func AddChangePasswordLink() bool
- func AddExpander(name string, priority int64, e Expander)
- func EnvKey(sectionName string, keyName string) string
- func ExpandVar(s string) (string, error)
- func RedactedURL(value string) (string, error)
- func RedactedValue(key, value string) string
- func ToAbsUrl(relativeUrl string) string
- type AnnotationCleanupSettings
- type Cfg
- func (cfg *Cfg) GetContentDeliveryURL(prefix string) string
- func (cfg Cfg) IsDatabaseMetricsEnabled() bool
- func (cfg Cfg) IsHTTPRequestHistogramEnabled() bool
- func (cfg Cfg) IsLiveEnabled() bool
- func (cfg Cfg) IsNgAlertEnabled() bool
- func (cfg Cfg) IsPanelLibraryEnabled() bool
- func (cfg *Cfg) Load(args *CommandLineArgs) error
- func (cfg *Cfg) LogConfigSources()
- func (cfg *Cfg) SectionWithEnvOverrides(s string) *DynamicSection
- type CommandLineArgs
- type DateFormatIntervals
- type DateFormats
- type DynamicSection
- type Expander
- type GlobalQuota
- type OAuthInfo
- type OAuther
- type OrgQuota
- type PluginSettings
- type QuotaSettings
- type RemoteCacheOptions
- type Scheme
- type Sentry
- type SmtpSettings
- type UserQuota
Constants ¶
const ( DefaultHTTPAddr = "0.0.0.0" Dev = "development" Prod = "production" Test = "test" )
Variables ¶
var ( // App settings. Env = Dev AppUrl string AppSubUrl string ServeFromSubPath bool InstanceName string // build BuildVersion string BuildCommit string BuildBranch string BuildStamp int64 IsEnterprise bool ApplicationName string // packaging Packaging = "unknown" // Paths HomePath string CustomInitPath = "conf/custom.ini" // HTTP server options HttpAddr, HttpPort string CertFile, KeyFile string DataProxyLogging bool DataProxyTimeout int DataProxyTLSHandshakeTimeout int DataProxyExpectContinueTimeout int DataProxyMaxConnsPerHost int DataProxyMaxIdleConns int DataProxyMaxIdleConnsPerHost int DataProxyKeepAlive int DataProxyIdleConnTimeout int StaticRootPath string EnableGzip bool EnforceDomain bool // Security settings. SecretKey string DisableGravatar bool EmailCodeValidMinutes int DataProxyWhiteList map[string]bool CookieSecure bool CookieSameSiteDisabled bool CookieSameSiteMode http.SameSite // Snapshots ExternalSnapshotUrl string ExternalSnapshotName string ExternalEnabled bool SnapShotRemoveExpired bool // Dashboard history DashboardVersionsToKeep int MinRefreshInterval string // User settings AllowUserSignUp bool AllowUserOrgCreate bool AutoAssignOrg bool AutoAssignOrgId int AutoAssignOrgRole string VerifyEmailEnabled bool LoginHint string PasswordHint string DisableLoginForm bool DisableSignoutMenu bool SignoutRedirectUrl string ExternalUserMngLinkUrl string ExternalUserMngLinkName string ExternalUserMngInfo string OAuthAutoLogin bool ViewersCanEdit bool // HTTP auth SigV4AuthEnabled bool AnonymousEnabled bool // Auth proxy settings AuthProxyEnabled bool AuthProxyHeaderProperty string // Basic Auth BasicAuthEnabled bool // Global setting objects. Raw *ini.File // analytics GoogleAnalyticsId string GoogleTagManagerId string // LDAP LDAPEnabled bool LDAPConfigFile string LDAPSyncCron string LDAPAllowSignup bool LDAPActiveSyncEnabled bool // Quota Quota QuotaSettings // Alerting AlertingEnabled bool ExecuteAlerts bool AlertingRenderLimit int AlertingErrorOrTimeout string AlertingNoDataOrNullValues string AlertingEvaluationTimeout time.Duration AlertingNotificationTimeout time.Duration AlertingMaxAttempts int AlertingMinInterval int64 // Explore UI ExploreEnabled bool // Plutono.NET URL PlutonoComUrl string ImageUploadProvider string )
Functions ¶
func AddChangePasswordLink ¶
func AddChangePasswordLink() bool
AddChangePasswordLink returns if login form is disabled or not since the same intention can be used to hide both features.
func AddExpander ¶
func RedactedURL ¶
func RedactedValue ¶
Types ¶
type Cfg ¶
type Cfg struct {
Raw *ini.File
Logger log.Logger
// HTTP Server Settings
AppURL string
AppSubURL string
ServeFromSubPath bool
StaticRootPath string
Protocol Scheme
SocketPath string
RouterLogging bool
Domain string
CDNRootURL *url.URL
ReadTimeout time.Duration
EnableGzip bool
EnforceDomain bool
// build
BuildVersion string
BuildCommit string
BuildBranch string
BuildStamp int64
IsEnterprise bool
// packaging
Packaging string
// Paths
ProvisioningPath string
DataPath string
LogsPath string
PluginsPath string
BundledPluginsPath string
// SMTP email settings
Smtp SmtpSettings
// Rendering
ImagesDir string
RendererUrl string
RendererCallbackUrl string
RendererConcurrentRequestLimit int
// Security
DisableInitAdminCreation bool
DisableBruteForceLoginProtection bool
CookieSecure bool
CookieSameSiteDisabled bool
CookieSameSiteMode http.SameSite
AllowEmbedding bool
XSSProtectionHeader bool
ContentTypeProtectionHeader bool
StrictTransportSecurity bool
StrictTransportSecurityMaxAge int
StrictTransportSecurityPreload bool
StrictTransportSecuritySubDomains bool
// CSPEnabled toggles Content Security Policy support.
CSPEnabled bool
// CSPTemplate contains the Content Security Policy template.
CSPTemplate string
TempDataLifetime time.Duration
PluginsEnableAlpha bool
PluginsAppsSkipVerifyTLS bool
PluginSettings PluginSettings
PluginsAllowUnsigned []string
MarketplaceURL string
DisableSanitizeHtml bool
// Metrics
MetricsEndpointEnabled bool
MetricsEndpointBasicAuthUsername string
MetricsEndpointBasicAuthPassword string
MetricsEndpointDisableTotalStats bool
MetricsPlutonoEnvironmentInfo map[string]string
// Dashboards
DefaultHomeDashboardPath string
// Auth
LoginCookieName string
LoginMaxInactiveLifetime time.Duration
LoginMaxLifetime time.Duration
TokenRotationIntervalMinutes int
SigV4AuthEnabled bool
BasicAuthEnabled bool
AdminUser string
AdminPassword string
// AWS Plugin Auth
AWSAllowedAuthProviders []string
AWSAssumeRoleEnabled bool
AWSListMetricsPageLimit int
// Auth proxy settings
AuthProxyEnabled bool
AuthProxyHeaderName string
AuthProxyHeaderProperty string
AuthProxyAutoSignUp bool
AuthProxyEnableLoginToken bool
AuthProxyWhitelist string
AuthProxyHeaders map[string]string
AuthProxySyncTTL int
// OAuth
OAuthCookieMaxAge int
// SAML Auth
SAMLEnabled bool
SAMLSingleLogoutEnabled bool
// Dataproxy
SendUserHeader bool
// DistributedCache
RemoteCacheOptions *RemoteCacheOptions
EditorsCanAdmin bool
ApiKeyMaxSecondsToLive int64
// Use to enable new features which may still be in alpha/beta stage.
FeatureToggles map[string]bool
AnonymousEnabled bool
AnonymousOrgName string
AnonymousOrgRole string
AnonymousHideVersion bool
DateFormats DateFormats
// User
UserInviteMaxLifetime time.Duration
HiddenUsers map[string]struct{}
// Annotations
AnnotationCleanupJobBatchSize int64
AlertingAnnotationCleanupSetting AnnotationCleanupSettings
DashboardAnnotationCleanupSettings AnnotationCleanupSettings
APIAnnotationCleanupSettings AnnotationCleanupSettings
// Sentry config
Sentry Sentry
// Data sources
DataSourceLimit int
// Snapshots
SnapshotPublicMode bool
ErrTemplateName string
Env string
// LDAP
LDAPEnabled bool
LDAPAllowSignup bool
Quota QuotaSettings
DefaultTheme string
HomePage string
AutoAssignOrg bool
AutoAssignOrgId int
AutoAssignOrgRole string
// ExpressionsEnabled specifies whether expressions are enabled.
ExpressionsEnabled bool
}
TODO move all global vars to this struct
func GetCfg ¶
func GetCfg() *Cfg
GetCfg gets the Cfg singleton. XXX: This is only required for integration tests so that the configuration can be reset for each test, as due to how the current DI framework functions, we can't create a new Cfg object every time (the services constituting the DI graph, and referring to a Cfg instance, get created only once).
func (*Cfg) GetContentDeliveryURL ¶
GetContentDeliveryURL returns full content delivery URL with /<edition>/<version> added to URL
func (Cfg) IsDatabaseMetricsEnabled ¶
IsDatabaseMetricsEnabled returns whether the database instrumentation feature is enabled.
func (Cfg) IsHTTPRequestHistogramEnabled ¶
IsHTTPRequestHistogramEnabled returns whether the http_request_histogram feature is enabled.
func (Cfg) IsLiveEnabled ¶
IsLiveEnabled returns if plutono live should be enabled
func (Cfg) IsNgAlertEnabled ¶
IsNgAlertEnabled returns whether the standalone alerts feature is enabled.
func (Cfg) IsPanelLibraryEnabled ¶
IsPanelLibraryEnabled returns whether the panel library feature is enabled.
func (*Cfg) Load ¶
func (cfg *Cfg) Load(args *CommandLineArgs) error
func (*Cfg) LogConfigSources ¶
func (cfg *Cfg) LogConfigSources()
func (*Cfg) SectionWithEnvOverrides ¶
func (cfg *Cfg) SectionWithEnvOverrides(s string) *DynamicSection
SectionWithEnvOverrides dynamically overrides keys with environment variables. As a side effect, the value of the setting key will be updated if an environment variable is present.
type CommandLineArgs ¶
type DateFormatIntervals ¶
type DateFormats ¶
type DateFormats struct {
FullDate string `json:"fullDate"`
UseBrowserLocale bool `json:"useBrowserLocale"`
Interval DateFormatIntervals `json:"interval"`
DefaultTimezone string `json:"defaultTimezone"`
}
type DynamicSection ¶
type GlobalQuota ¶
type OAuthInfo ¶
type OAuthInfo struct {
ClientId, ClientSecret string
Scopes []string
AuthUrl, TokenUrl string
Enabled bool
EmailAttributeName string
EmailAttributePath string
RoleAttributePath string
AllowedDomains []string
HostedDomain string
ApiUrl string
AllowSignup bool
Name string
TlsClientCert string
TlsClientKey string
TlsClientCa string
TlsSkipVerify bool
}
type OrgQuota ¶
type PluginSettings ¶
PluginSettings maps plugin id to map of key/value settings.
type QuotaSettings ¶
type QuotaSettings struct {
Enabled bool
Org *OrgQuota
User *UserQuota
Global *GlobalQuota
}