config

package
v1.64.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogConfig added in v1.36.0

func LogConfig(config *Config)

func Validate added in v1.42.0

func Validate(config *Config) error

Validate values populated in Config

Types

type ArtifactsServer added in v1.36.0

type ArtifactsServer struct {
	URL            string
	TimeoutSeconds int
}

ArtifactsServer groups settings related to configuring Artifacts server

type Auth added in v1.36.0

type Auth struct {
	Secret               string
	ClientID             string
	ClientSecret         string
	RedirectURI          string
	Scope                string
	Timeout              time.Duration
	CookieSessionTimeout time.Duration
}

Auth groups settings related to configuring Authentication with GitLab

type Cache added in v1.36.0

type Cache struct {
	CacheExpiry          time.Duration
	CacheCleanupInterval time.Duration
	EntryRefreshTimeout  time.Duration
	RetrievalTimeout     time.Duration
	MaxRetrievalInterval time.Duration
	MaxRetrievalRetries  int
}

Cache configuration for GitLab API

type Config added in v1.31.0

type Config struct {
	General         General
	RateLimit       RateLimit
	ArtifactsServer ArtifactsServer
	Authentication  Auth
	GitLab          GitLab
	Log             Log
	Redirects       Redirects
	Sentry          Sentry
	Server          Server
	TLS             TLS
	Zip             ZipServing
	Metrics         Metrics

	// These fields contain the raw strings passed for listen-http,
	// listen-https, listen-proxy and listen-https-proxyv2 settings. It is used
	// by appmain() to create listeners.
	ListenHTTPStrings         MultiStringFlag
	ListenHTTPSStrings        MultiStringFlag
	ListenProxyStrings        MultiStringFlag
	ListenHTTPSProxyv2Strings MultiStringFlag
}

Config stores all the config options relevant to GitLab Pages.

func LoadConfig added in v1.36.0

func LoadConfig() (*Config, error)

LoadConfig parses configuration settings passed as command line arguments or via config file, and populates a Config object with those values

type General added in v1.36.0

type General struct {
	Domain                string
	MaxConns              int
	MaxURILength          int
	RedirectHTTP          bool
	RootCertificate       []byte
	RootDir               string
	RootKey               []byte
	ServerShutdownTimeout time.Duration
	StatusPath            string

	DisableCrossOriginRequests bool
	InsecureCiphers            bool
	PropagateCorrelationID     bool

	ShowVersion bool

	CustomHeaders http.Header
}

General groups settings that are general to GitLab Pages and can not be categorized under other head.

type GitLab added in v1.36.0

type GitLab struct {
	PublicServer       string
	InternalServer     string
	APISecretKey       []byte
	ClientHTTPTimeout  time.Duration
	JWTTokenExpiration time.Duration
	Cache              Cache
	EnableDisk         bool
}

GitLab groups settings related to configuring GitLab client used to interact with GitLab API

type Log added in v1.36.0

type Log struct {
	Format  string
	Verbose bool
}

Log groups settings related to configuring logging

type Metrics added in v1.59.0

type Metrics struct {
	Address   string
	TLSConfig *tls.Config
}

type MultiStringFlag added in v1.36.0

type MultiStringFlag struct {
	// contains filtered or unexported fields
}

MultiStringFlag implements the flag.Value interface and allows a string flag to be specified multiple times on the command line.

e.g.: -listen-http 127.0.0.1:80 -listen-http [::1]:80

func (*MultiStringFlag) Len added in v1.42.0

func (s *MultiStringFlag) Len() int

func (*MultiStringFlag) Set added in v1.36.0

func (s *MultiStringFlag) Set(value string) error

Set appends the value to the list of parameters

func (*MultiStringFlag) Split added in v1.36.0

func (s *MultiStringFlag) Split() (result []string)

Split each flag

func (*MultiStringFlag) String added in v1.36.0

func (s *MultiStringFlag) String() string

String returns the list of parameters joined with a commas (",")

type RateLimit added in v1.46.0

type RateLimit struct {
	// HTTP limits
	SourceIPLimitPerSecond float64
	SourceIPBurst          int
	DomainLimitPerSecond   float64
	DomainBurst            int

	// TLS connections limits
	TLSSourceIPLimitPerSecond float64
	TLSSourceIPBurst          int
	TLSDomainLimitPerSecond   float64
	TLSDomainBurst            int
}

RateLimit config struct

type Redirects added in v1.60.0

type Redirects struct {
	MaxConfigSize   int
	MaxPathSegments int
	MaxRuleCount    int
}

Redirects groups settings related to configuring _redirects limits

type Sentry added in v1.36.0

type Sentry struct {
	DSN         string
	Environment string
}

Sentry groups settings related to configuring Sentry

type Server added in v1.51.1

type Server struct {
	ReadTimeout       time.Duration
	ReadHeaderTimeout time.Duration
	WriteTimeout      time.Duration
	ListenKeepAlive   time.Duration
}

type TLS added in v1.36.0

type TLS struct {
	MinVersion uint16
	MaxVersion uint16
}

TLS groups settings related to configuring TLS

type ZipServing added in v1.31.0

type ZipServing struct {
	ExpirationInterval time.Duration
	CleanupInterval    time.Duration
	RefreshInterval    time.Duration
	OpenTimeout        time.Duration
	AllowedPaths       []string
	HTTPClientTimeout  time.Duration
}

ZipServing groups settings to be used by the zip VFS opening and caching

Jump to

Keyboard shortcuts

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