config

package
v0.0.0-...-b517edd Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAuthEnabled

func IsAuthEnabled(config *AppConfig) bool

Types

type AppConfig

type AppConfig struct {
	LogLevel string `yaml:"loglevel"`
	Web      struct {
		// ExternalAddress is that users access the web ui
		// using. This value is required for using auth backends
		// This value should include the scheme.
		// The port should be included if non-standard.
		// e.g. http://192.168.0.2:8000
		// or https://myvpn.example.com
		ExternalAddress string `yaml:"externalAddress"`
		// Port that the web server should listen on
		Port int `yaml:"port"`
	} `yaml:"web"`
	Storage struct {
		// Directory that VPN devices (WireGuard peers)
		// should be saved under.
		// If this value is empty then an InMemory storage
		// backend will be used (not recommended).
		Directory string `yaml:"directory"`
	} `yaml:"storage"`
	WireGuard struct {
		// UserspaceImplementation is a command (program on $PATH)
		// that implements the WireGuard protocol in userspace.
		// In our Docker image we make use of `boringtun` so that
		// users aren't required to setup kernel modules
		UserspaceImplementation string `yaml:"userspaceImplementation"`
		// The network interface name of the WireGuard
		// network device
		InterfaceName string `yaml:"interfaceName"`
		// The WireGuard PrivateKey
		// If this value is lost then any existing
		// clients (WireGuard peers) will no longer
		// be able to connect.
		// Clients will either have to manually update
		// their connection configuration or setup
		// their VPN again using the web ui (easier for most people)
		PrivateKey string `yaml:"privateKey"`
		// ExternalAddress is the address that users
		// use to connect to the wireguard interface
		// By default, this will use the Web.ExternalAddress
		// domain with the WireGuard.Port
		ExternalAddress string `yaml:"externalAddress`
		// The WireGuard ListenPort
		Port int `yaml:"port"`
	} `yaml:"wireguard"`
	VPN struct {
		// CIDR configures a network address space
		// that client (WireGuard peers) will be allocated
		// an IP address from
		CIDR string `yaml:"cidr"`
		// GatewayInterface will be used in iptable forwarding
		// rules that send VPN traffic from clients to this interface
		// Most use-cases will want this interface to have access
		// to the outside internet
		GatewayInterface string `yaml:"gatewayInterface`
	}
	DNS struct {
		// TODO: docs
		Upstream []string `yaml:"upstream"`
	} `yaml:"dns"`
	Auth struct {
		OIDC   *auth.OIDCConfig   `yaml:"oidc"`
		Gitlab *auth.GitlabConfig `yaml:"gitlab"`
	} `yaml:"auth"`
}

func Read

func Read() *AppConfig

Jump to

Keyboard shortcuts

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