Documentation
¶
Index ¶
- Constants
- Variables
- func AddExpander(name string, priority int64, e Expander)
- func ExpandVar(s string) (string, error)
- func ToAbsUrl(relativeUrl string) string
- type AnnotationCleanupSettings
- type Cfg
- 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 SmtpSettings
- type UserQuota
Constants ¶
View Source
const ( DefaultHTTPAddr = "0.0.0.0" Dev = "development" Prod = "production" Test = "test" )
View Source
const (
AuthProxySyncTTL = 60
)
This constant corresponds to the default value for ldap_sync_ttl in .ini files it is used for comparison and has to be kept in sync
View Source
const LocalBrowserTimezone = "browser"
Variables ¶
View Source
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 PluginsPath string CustomInitPath = "conf/custom.ini" // Log settings. LogConfigs []util.DynMap // Http server options Protocol Scheme Domain string HttpAddr, HttpPort string SshPort int CertFile, KeyFile string SocketPath string RouterLogging bool DataProxyLogging bool DataProxyTimeout int StaticRootPath string EnableGzip bool EnforceDomain bool // Security settings. SecretKey string DisableGravatar bool EmailCodeValidMinutes int DataProxyWhiteList map[string]bool DisableBruteForceLoginProtection bool CookieSecure bool CookieSameSiteDisabled bool CookieSameSiteMode http.SameSite AllowEmbedding bool XSSProtectionHeader bool ContentTypeProtectionHeader bool StrictTransportSecurity bool StrictTransportSecurityMaxAge int StrictTransportSecurityPreload bool StrictTransportSecuritySubDomains bool // Snapshots ExternalSnapshotUrl string ExternalSnapshotName string ExternalEnabled bool SnapShotRemoveExpired bool SnapshotPublicMode 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 DefaultTheme string DisableLoginForm bool DisableSignoutMenu bool SignoutRedirectUrl string ExternalUserMngLinkUrl string ExternalUserMngLinkName string ExternalUserMngInfo string OAuthAutoLogin bool ViewersCanEdit bool // Http auth AdminUser string AdminPassword string LoginCookieName string LoginMaxLifetime time.Duration AnonymousEnabled bool AnonymousOrgName string AnonymousOrgRole string // Auth proxy settings AuthProxyEnabled bool AuthProxyHeaderName string AuthProxyHeaderProperty string AuthProxyAutoSignUp bool AuthProxyEnableLoginToken bool AuthProxySyncTtl int AuthProxyWhitelist string AuthProxyHeaders map[string]string // Basic Auth BasicAuthEnabled bool // Session settings. SessionOptions session.Options SessionConnMaxLifetime int64 // Global setting objects. Raw *ini.File ConfRootPath string IsWindows bool ReportingEnabled bool CheckForUpdates bool 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 // Grafana.NET URL GrafanaComUrl string // S3 temp image store S3TempImageStoreBucketUrl string S3TempImageStoreAccessKey string S3TempImageStoreSecretKey string ImageUploadProvider string )
View Source
var (
ErrTemplateName = "error"
)
Functions ¶
func AddExpander ¶
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 // build BuildVersion string BuildCommit string BuildBranch string BuildStamp int64 IsEnterprise bool // packaging Packaging string // Paths ProvisioningPath string DataPath string LogsPath 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 TempDataLifetime time.Duration MetricsEndpointEnabled bool MetricsEndpointBasicAuthUsername string MetricsEndpointBasicAuthPassword string MetricsEndpointDisableTotalStats bool PluginsEnableAlpha bool PluginsAppsSkipVerifyTLS bool PluginSettings PluginSettings PluginsAllowUnsigned []string DisableSanitizeHtml bool EnterpriseLicensePath string // Dashboards DefaultHomeDashboardPath string // Auth LoginCookieName string LoginMaxInactiveLifetime time.Duration LoginMaxLifetime time.Duration TokenRotationIntervalMinutes int // OAuth OAuthCookieMaxAge int // SAML Auth SAMLEnabled 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 AnonymousHideVersion bool DateFormats DateFormats // Annotations AlertingAnnotationCleanupSetting AnnotationCleanupSettings DashboardAnnotationCleanupSettings AnnotationCleanupSettings APIAnnotationCleanupSettings AnnotationCleanupSettings }
TODO move all global vars to this struct
func (Cfg) IsExpressionsEnabled ¶
IsExpressionsEnabled returns whether the expressions feature is enabled.
func (Cfg) IsLiveEnabled ¶
IsLiveEnabled returns if grafana live should be 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 GlobalQuota struct { Org int64 `target:"org"` User int64 `target:"user"` DataSource int64 `target:"data_source"` Dashboard int64 `target:"dashboard"` ApiKey int64 `target:"api_key"` Session int64 `target:"-"` }
func (*GlobalQuota) ToMap ¶
func (q *GlobalQuota) ToMap() map[string]int64
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 }
type RemoteCacheOptions ¶
type SmtpSettings ¶
Click to show internal directories.
Click to hide internal directories.