system

package
v0.0.0-...-9c9e09e Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2022 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllLocalIPAddresses

func AllLocalIPAddresses() []net.IP

AllLocalIPAddresses returns all available interfaces' IP.

func FirstLocalIP

func FirstLocalIP(ips []net.IP) net.IP

FirstLocalIP Returns first none loopback IP available. Returns net.IPv6loopback if nothing is found.

func SaveSecretsToFile

func SaveSecretsToFile(secrets Secrets, file string)

func TLSConfigWithSelfSignedCert

func TLSConfigWithSelfSignedCert(ips []net.IP) (serverTLSConf *tls.Config)

Types

type Config

type Config struct {
	OAuth    OAuthConfig    `mapstructure:"oauth"` //nolint:tagliatelle
	Security SecurityConfig `mapstructure:"security"`
	Services ServicesConfig `mapstructure:"services"`
	Storage  StorageConfig  `mapstructure:"storage"`
	Web      WebConfig      `mapstructure:"web"`
}

func LoadConfig

func LoadConfig(viperConf *viper.Viper) Config

type GoogleConfig

type GoogleConfig struct {
	ClientID     string `mapstructure:"client-id"`
	ClientSecret string `mapstructure:"client-secret"`
}

type OAuthConfig

type OAuthConfig struct {
	Google GoogleConfig `mapstructure:"google"`
}

type Secrets

type Secrets struct {
	Radius string `json:"radius"`
	JWT    string `json:"jwt"`
}

func LoadSecretsFromFile

func LoadSecretsFromFile(file string) Secrets

type SecurityConfig

type SecurityConfig struct {
	AllowedDomain         string   `mapstructure:"allowed-domain"`
	AuthorizedAdminEmails []string `mapstructure:"admin-emails"` //nolint:tagliatelle
}

type ServicesConfig

type ServicesConfig struct {
	HTTPBindAddress   string `mapstructure:"http-bind-address"`
	HTTPSBindAddress  string `mapstructure:"https-bind-address"`
	RadiusBindAddress string `mapstructure:"radius-bind-address"`
}

type StorageConfig

type StorageConfig struct {
	UserDatabaseFile string `mapstructure:"user-database"` //nolint:tagliatelle
	SecretsFile      string `mapstructure:"secrets-file"`
}

type WebConfig

type WebConfig struct {
	Domain         string   `mapstructure:"domain"`
	UseLetsEncrypt bool     `mapstructure:"lets-encrypt"` //nolint:tagliatelle
	AllowOrigins   []string `mapstructure:"allow-origins"`
	ReverseProxy   string   `mapstructure:"reverse-proxy"`
}

Jump to

Keyboard shortcuts

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