config

package
v5.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DatabaseURL            string      `toml:"database_url"`
	DataPath               string      `toml:"data_path"`
	Environment            string      `toml:"environment"`
	SharedSecret           string      `toml:"shared_secret"`
	TrustedUserEmailDomain string      `toml:"trusted_user_email_domain"`
	PublicHostname         string      `toml:"public_hostname"`
	SentryDsn              string      `toml:"sentry_dsn" required:"false"`
	MinInstancePort        uint16      `toml:"min_instance_port"`
	MaxInstancePort        uint16      `toml:"max_instance_port"`
	HTTPConfig             HTTPConfig  `toml:"http"`
	OAuthConfig            OAuthConfig `toml:"oauth"`
	CleanInterval          string      `toml:"clean_interval"`
	EnableWhitelisting     bool        `toml:"enable_ip_whitelisting" required:"false"`
	WhitelisterInterval    string      `toml:"whitelist_reconcile_interval"`
	TrustedProxyCIDRs      []string    `toml:"trusted_proxy_cidrs" required:"false"`
	UseXForwardedFor       bool        `toml:"use_x_forwarded_for" required:"false"`
}

Config holds all Draupnir configuration

func Load

func Load(path string) (Config, error)

Load parses and validates the server config file located at `path`

type HTTPConfig

type HTTPConfig struct {
	SecureListenAddress   string `toml:"listen_address" required:"false"`
	InsecureListenAddress string `toml:"insecure_listen_address" required:"false"`
	TLSCertificatePath    string `toml:"tls_certificate" required:"false"`
	TLSPrivateKeyPath     string `toml:"tls_private_key" required:"false"`
}

HTTPConfig holds Draupnir's HTTP configuration

type OAuthConfig

type OAuthConfig struct {
	RedirectURL  string `toml:"redirect_url"`
	ClientID     string `toml:"client_id"`
	ClientSecret string `toml:"client_secret"`
}

OAuthConfig holds Draupnir's OAuth configuration

Jump to

Keyboard shortcuts

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