configuration

package
v1.4.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2017 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultHealthCheckInterval is the default health check interval.
	DefaultHealthCheckInterval = 30 * time.Second

	// DefaultDialTimeout when connecting to a backend server.
	DefaultDialTimeout = 30 * time.Second

	// DefaultIdleTimeout before closing an idle connection.
	DefaultIdleTimeout = 180 * time.Second
)

Variables

View Source
var CipherSuites = map[string]uint16{
	`TLS_RSA_WITH_RC4_128_SHA`:                tls.TLS_RSA_WITH_RC4_128_SHA,
	`TLS_RSA_WITH_3DES_EDE_CBC_SHA`:           tls.TLS_RSA_WITH_3DES_EDE_CBC_SHA,
	`TLS_RSA_WITH_AES_128_CBC_SHA`:            tls.TLS_RSA_WITH_AES_128_CBC_SHA,
	`TLS_RSA_WITH_AES_256_CBC_SHA`:            tls.TLS_RSA_WITH_AES_256_CBC_SHA,
	`TLS_RSA_WITH_AES_128_CBC_SHA256`:         tls.TLS_RSA_WITH_AES_128_CBC_SHA256,
	`TLS_RSA_WITH_AES_128_GCM_SHA256`:         tls.TLS_RSA_WITH_AES_128_GCM_SHA256,
	`TLS_RSA_WITH_AES_256_GCM_SHA384`:         tls.TLS_RSA_WITH_AES_256_GCM_SHA384,
	`TLS_ECDHE_ECDSA_WITH_RC4_128_SHA`:        tls.TLS_ECDHE_ECDSA_WITH_RC4_128_SHA,
	`TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA`:    tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
	`TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA`:    tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
	`TLS_ECDHE_RSA_WITH_RC4_128_SHA`:          tls.TLS_ECDHE_RSA_WITH_RC4_128_SHA,
	`TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA`:     tls.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA,
	`TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA`:      tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,
	`TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA`:      tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,
	`TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256`: tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,
	`TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256`:   tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,
	`TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256`:   tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
	`TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256`: tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
	`TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384`:   tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
	`TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384`: tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
	`TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305`:    tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,
	`TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305`:  tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,
}

CipherSuites Map of TLS CipherSuites from crypto/tls Available CipherSuites defined at https://golang.org/pkg/crypto/tls/#pkg-constants

View Source
var MinVersion = map[string]uint16{
	`VersionTLS10`: tls.VersionTLS10,
	`VersionTLS11`: tls.VersionTLS11,
	`VersionTLS12`: tls.VersionTLS12,
}

MinVersion Map of allowed TLS minimum versions

Functions

This section is empty.

Types

type Certificate

type Certificate struct {
	CertFile FileOrContent
	KeyFile  FileOrContent
}

Certificate holds a SSL cert/key pair Certs and Key could be either a file path, or the file content itself

type Certificates

type Certificates []Certificate

Certificates defines traefik certificates type Certs and Keys could be either a file path, or the file content itself

func (*Certificates) CreateTLSConfig

func (certs *Certificates) CreateTLSConfig() (*tls.Config, error)

CreateTLSConfig creates a TLS config from Certificate structures

func (*Certificates) Set

func (certs *Certificates) Set(value string) error

Set is the method to set the flag value, part of the flag.Value interface. Set's argument is a string to be parsed to set the flag. It's a comma-separated list, so we split it.

func (*Certificates) String

func (certs *Certificates) String() string

String is the method to format the flag's value, part of the flag.Value interface. The String method's output will be used in diagnostics.

func (*Certificates) Type

func (certs *Certificates) Type() string

Type is type of the struct

type DefaultEntryPoints

type DefaultEntryPoints []string

DefaultEntryPoints holds default entry points

func (*DefaultEntryPoints) Get

func (dep *DefaultEntryPoints) Get() interface{}

Get return the EntryPoints map

func (*DefaultEntryPoints) Set

func (dep *DefaultEntryPoints) Set(value string) error

Set is the method to set the flag value, part of the flag.Value interface. Set's argument is a string to be parsed to set the flag. It's a comma-separated list, so we split it.

func (*DefaultEntryPoints) SetValue

func (dep *DefaultEntryPoints) SetValue(val interface{})

SetValue sets the EntryPoints map with val

func (*DefaultEntryPoints) String

func (dep *DefaultEntryPoints) String() string

String is the method to format the flag's value, part of the flag.Value interface. The String method's output will be used in diagnostics.

func (*DefaultEntryPoints) Type

func (dep *DefaultEntryPoints) Type() string

Type is type of the struct

type EntryPoint

type EntryPoint struct {
	Network              string
	Address              string
	TLS                  *TLS
	Redirect             *Redirect
	Auth                 *types.Auth
	WhitelistSourceRange []string
	Compress             bool
	ProxyProtocol        bool
}

EntryPoint holds an entry point configuration of the reverse proxy (ip, port, TLS...)

type EntryPoints

type EntryPoints map[string]*EntryPoint

EntryPoints holds entry points configuration of the reverse proxy (ip, port, TLS...)

func (*EntryPoints) Get

func (ep *EntryPoints) Get() interface{}

Get return the EntryPoints map

func (*EntryPoints) Set

func (ep *EntryPoints) Set(value string) error

Set is the method to set the flag value, part of the flag.Value interface. Set's argument is a string to be parsed to set the flag. It's a comma-separated list, so we split it.

func (*EntryPoints) SetValue

func (ep *EntryPoints) SetValue(val interface{})

SetValue sets the EntryPoints map with val

func (*EntryPoints) String

func (ep *EntryPoints) String() string

String is the method to format the flag's value, part of the flag.Value interface. The String method's output will be used in diagnostics.

func (*EntryPoints) Type

func (ep *EntryPoints) Type() string

Type is type of the struct

type FileOrContent

type FileOrContent string

FileOrContent hold a file path or content

func (FileOrContent) Read

func (f FileOrContent) Read() ([]byte, error)

func (FileOrContent) String

func (f FileOrContent) String() string

type ForwardingTimeouts

type ForwardingTimeouts struct {
	DialTimeout           flaeg.Duration `` /* 150-byte string literal not displayed */
	ResponseHeaderTimeout flaeg.Duration `` /* 161-byte string literal not displayed */
}

ForwardingTimeouts contains timeout configurations for forwarding requests to the backend servers.

type GlobalConfiguration

type GlobalConfiguration struct {
	GraceTimeOut              flaeg.Duration          `short:"g" description:"Duration to give active requests a chance to finish before Traefik stops"`
	Debug                     bool                    `short:"d" description:"Enable debug mode"`
	CheckNewVersion           bool                    `description:"Periodically check if a new version has been released"`
	AccessLogsFile            string                  `description:"(Deprecated) Access logs file"` // Deprecated
	AccessLog                 *types.AccessLog        `description:"Access log settings"`
	TraefikLogsFile           string                  `description:"Traefik logs file. Stdout is used when omitted or empty"`
	LogLevel                  string                  `short:"l" description:"Log level"`
	EntryPoints               EntryPoints             `` /* 231-byte string literal not displayed */
	Cluster                   *types.Cluster          `description:"Enable clustering"`
	Constraints               types.Constraints       `description:"Filter services by constraint, matching with service tags"`
	ACME                      *acme.ACME              `description:"Enable ACME (Let's Encrypt): automatic SSL"`
	DefaultEntryPoints        DefaultEntryPoints      `description:"Entrypoints to be used by frontends that do not specify any entrypoint"`
	ProvidersThrottleDuration flaeg.Duration          ``                                                                                                                          /* 213-byte string literal not displayed */
	MaxIdleConnsPerHost       int                     ``                                                                                                                          /* 128-byte string literal not displayed */
	IdleTimeout               flaeg.Duration          `description:"(Deprecated) maximum amount of time an idle (keep-alive) connection will remain idle before closing itself."` // Deprecated
	InsecureSkipVerify        bool                    `description:"Disable SSL certificate verification"`
	RootCAs                   RootCAs                 `description:"Add cert file for self-signed certicate"`
	Retry                     *Retry                  `description:"Enable retry sending request if network error"`
	HealthCheck               *HealthCheckConfig      `description:"Health check parameters"`
	RespondingTimeouts        *RespondingTimeouts     `description:"Timeouts for incoming requests to the Traefik instance"`
	ForwardingTimeouts        *ForwardingTimeouts     `description:"Timeouts for requests forwarded to the backend servers"`
	Docker                    *docker.Provider        `description:"Enable Docker backend with default settings"`
	File                      *file.Provider          `description:"Enable File backend with default settings"`
	Web                       *web.Provider           `description:"Enable Web backend with default settings"`
	Marathon                  *marathon.Provider      `description:"Enable Marathon backend with default settings"`
	Consul                    *consul.Provider        `description:"Enable Consul backend with default settings"`
	ConsulCatalog             *consul.CatalogProvider `description:"Enable Consul catalog backend with default settings"`
	Etcd                      *etcd.Provider          `description:"Enable Etcd backend with default settings"`
	Zookeeper                 *zk.Provider            `description:"Enable Zookeeper backend with default settings"`
	Boltdb                    *boltdb.Provider        `description:"Enable Boltdb backend with default settings"`
	Kubernetes                *kubernetes.Provider    `description:"Enable Kubernetes backend with default settings"`
	Mesos                     *mesos.Provider         `description:"Enable Mesos backend with default settings"`
	Eureka                    *eureka.Provider        `description:"Enable Eureka backend with default settings"`
	ECS                       *ecs.Provider           `description:"Enable ECS backend with default settings"`
	Rancher                   *rancher.Provider       `description:"Enable Rancher backend with default settings"`
	DynamoDB                  *dynamodb.Provider      `description:"Enable DynamoDB backend with default settings"`
}

GlobalConfiguration holds global configuration (with providers, etc.). It's populated from the traefik configuration file passed as an argument to the binary.

type HealthCheckConfig

type HealthCheckConfig struct {
	Interval flaeg.Duration `description:"Default periodicity of enabled health checks"`
}

HealthCheckConfig contains health check configuration parameters.

type Redirect

type Redirect struct {
	EntryPoint  string
	Regex       string
	Replacement string
}

Redirect configures a redirection of an entry point to another, or to an URL

type RespondingTimeouts

type RespondingTimeouts struct {
	ReadTimeout  flaeg.Duration `` /* 128-byte string literal not displayed */
	WriteTimeout flaeg.Duration `description:"WriteTimeout is the maximum duration before timing out writes of the response. If zero, no timeout is set"`
	IdleTimeout  flaeg.Duration `` /* 180-byte string literal not displayed */
}

RespondingTimeouts contains timeout configurations for incoming requests to the Traefik instance.

type Retry

type Retry struct {
	Attempts int `description:"Number of attempts"`
}

Retry contains request retry config

type RootCAs

type RootCAs []FileOrContent

RootCAs hold the CA we want to have in root

func (*RootCAs) Get

func (r *RootCAs) Get() interface{}

Get return the EntryPoints map

func (*RootCAs) Set

func (r *RootCAs) Set(value string) error

Set is the method to set the flag value, part of the flag.Value interface. Set's argument is a string to be parsed to set the flag. It's a comma-separated list, so we split it.

func (*RootCAs) SetValue

func (r *RootCAs) SetValue(val interface{})

SetValue sets the EntryPoints map with val

func (*RootCAs) String

func (r *RootCAs) String() string

String is the method to format the flag's value, part of the flag.Value interface. The String method's output will be used in diagnostics.

func (*RootCAs) Type

func (r *RootCAs) Type() string

Type is type of the struct

type TLS

type TLS struct {
	MinVersion    string
	CipherSuites  []string
	Certificates  Certificates
	ClientCAFiles []string
}

TLS configures TLS for an entry point

Jump to

Keyboard shortcuts

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