setting

package
v0.0.0-...-a0b9124 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 10, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HTTP              Scheme = "http"
	HTTPS             Scheme = "https"
	SOCKET            Scheme = "socket"
	DEFAULT_HTTP_ADDR string = "0.0.0.0"
)
View Source
const (
	DEV                                           string = "development"
	PROD                                          string = "production"
	TEST                                          string = "test"
	DEFAULT_ALERT_EVALTIME_LIMIT                  int64  = 21600 //time in seconds = 6 hrs
	DEFAULT_MISSING_ALERT_COUNT                   int    = 500
	DEFAULT_MISSING_ALERTS_DELAY                  int64  = 600     // 10 mins delay
	DEFAULT_MISSING_ALERTS_SCHEDULAR_TIME_MINUTES int    = 10      //Range from [1-60] to represent 60 minutes
	DEFAULT_CLUSTERING_CLEANUP_PERIOD             int    = 24      // Range from [1-24] to represent 24 hrs.
	DEFAULT_CLUSTERING_HB_RETENSION_PERIOD        int    = 86400   // 1 day
	DEFAULT_ANNOTATION_RETENSION_PERIOD           int    = 1209600 // 14 days
)

Variables

View Source
var (
	// App settings.
	Env          string = DEV
	AppUrl       string
	AppSubUrl    string
	InstanceName string

	// build
	BuildVersion string
	BuildCommit  string
	BuildStamp   int64

	// Paths
	LogsPath       string
	HomePath       string
	DataPath       string
	PluginsPath    string
	CustomInitPath = "conf/custom.ini"

	// Log settings.
	LogModes   []string
	LogConfigs []util.DynMap

	// Http server options
	Protocol           Scheme
	Domain             string
	HttpAddr, HttpPort string
	SshPort            int
	CertFile, KeyFile  string
	SocketPath         string
	RouterLogging      bool
	DataProxyLogging   bool
	StaticRootPath     string
	EnableGzip         bool
	EnforceDomain      bool

	// Security settings.
	SecretKey             string
	LogInRememberDays     int
	CookieUserName        string
	CookieRememberName    string
	DisableGravatar       bool
	EmailCodeValidMinutes int
	DataProxyWhiteList    map[string]bool

	// Snapshots
	ExternalSnapshotUrl   string
	ExternalSnapshotName  string
	ExternalEnabled       bool
	SnapShotTTLDays       int
	SnapShotRemoveExpired bool

	// User settings
	AllowUserSignUp         bool
	AllowUserOrgCreate      bool
	AutoAssignOrg           bool
	AutoAssignOrgRole       string
	VerifyEmailEnabled      bool
	LoginHint               string
	DefaultTheme            string
	DisableLoginForm        bool
	DisableSignoutMenu      bool
	ExternalUserMngLinkUrl  string
	ExternalUserMngLinkName string
	ExternalUserMngInfo     string

	// Http auth
	AdminUser     string
	AdminPassword string

	AnonymousEnabled bool
	AnonymousOrgName string
	AnonymousOrgRole string

	// Auth proxy settings
	AuthProxyEnabled        bool
	AuthProxyHeaderName     string
	AuthProxyHeaderProperty string
	AuthProxyAutoSignUp     bool
	AuthProxyLdapSyncTtl    int
	AuthProxyWhitelist      string

	// Basic Auth
	BasicAuthEnabled bool

	// Session settings.
	SessionOptions session.Options

	// Global setting objects.
	Cfg          *ini.File
	ConfRootPath string
	IsWindows    bool

	// PhantomJs Rendering
	ImagesDir  string
	PhantomDir string

	ReportingEnabled   bool
	CheckForUpdates    bool
	GoogleAnalyticsId  string
	GoogleTagManagerId string

	// LDAP
	LdapEnabled     bool
	LdapConfigFile  string
	LdapAllowSignup bool = true

	// SMTP email settings
	Smtp SmtpSettings

	// QUOTA
	Quota QuotaSettings

	// Alerting
	AlertingEnabled bool
	ExecuteAlerts   bool

	// Grafana.NET URL
	GrafanaComUrl string

	// S3 temp image store
	S3TempImageStoreBucketUrl string
	S3TempImageStoreAccessKey string
	S3TempImageStoreSecretKey string

	ImageUploadProvider string

	// Clustering
	ClusteringEnabled                        bool
	MaxAlertEvalTimeLimitInSeconds           int64 = DEFAULT_ALERT_EVALTIME_LIMIT
	MaxMissingAlertCount                     int   = DEFAULT_MISSING_ALERT_COUNT
	DefaultMissingAlertsDelay                int64 = DEFAULT_MISSING_ALERTS_DELAY
	DefaultMissingAlertsSchedularTimeMinutes int   = DEFAULT_MISSING_ALERTS_SCHEDULAR_TIME_MINUTES
	ClusteringCleanupPeriod                  int
	ClusteringHBRetention                    int
	AnnotationRetention                      int
)

Functions

func LogConfigurationInfo

func LogConfigurationInfo()

func NewConfigContext

func NewConfigContext(args *CommandLineArgs) error

func ToAbsUrl

func ToAbsUrl(relativeUrl string) string

Types

type CommandLineArgs

type CommandLineArgs struct {
	Config   string
	HomePath string
	Args     []string
}

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
	AllowedDomains         []string
	HostedDomain           string
	ApiUrl                 string
	AllowSignup            bool
	Name                   string
	TlsClientCert          string
	TlsClientKey           string
	TlsClientCa            string
}

type OAuther

type OAuther struct {
	OAuthInfos map[string]*OAuthInfo
}
var OAuthService *OAuther

type OrgQuota

type OrgQuota struct {
	User       int64 `target:"org_user"`
	DataSource int64 `target:"data_source"`
	Dashboard  int64 `target:"dashboard"`
	ApiKey     int64 `target:"api_key"`
}

func (*OrgQuota) ToMap

func (q *OrgQuota) ToMap() map[string]int64

type QuotaSettings

type QuotaSettings struct {
	Enabled bool
	Org     *OrgQuota
	User    *UserQuota
	Global  *GlobalQuota
}

type Scheme

type Scheme string

type SmtpSettings

type SmtpSettings struct {
	Enabled     bool
	Host        string
	User        string
	Password    string
	CertFile    string
	KeyFile     string
	FromAddress string
	FromName    string
	SkipVerify  bool

	SendWelcomeEmailOnSignUp bool
	TemplatesPattern         string
}

type UserQuota

type UserQuota struct {
	Org int64 `target:"org_user"`
}

func (*UserQuota) ToMap

func (q *UserQuota) ToMap() map[string]int64

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL