config

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckIPOverlap added in v1.7.0

func CheckIPOverlap(a, b string) (bool, error)

func FindMinimalNetwork added in v1.10.0

func FindMinimalNetwork(ipRanges []string) (string, error)

func GenerateRandomIP added in v1.10.0

func GenerateRandomIP(ipRanges []string) (string, string, error)

func Must

func Must(err error)

func MustGet

func MustGet[T any](val T, err error) T

func NormalizeAllowedIP added in v1.4.0

func NormalizeAllowedIP(ip string) (string, error)

func OnInitialize

func OnInitialize(log *logrus.Logger, cmd *cobra.Command)

func SetFlags

func SetFlags(cmd *cobra.Command)

Types

type Config

type Config struct {
	PrivateKeyHex          string      `yaml:"-"`
	PrivateKey             wgtypes.Key `yaml:"-"`
	Port                   uint16      `yaml:"port"`
	BindAddress            string      `yaml:"bindAddress,omitempty"`
	LogLevel               string      `yaml:"logLevel"`
	HubAddress             string      `yaml:"hubAddress,omitempty"`
	ExternalAddress        string      `yaml:"externalAddress,omitempty"`
	DebugServer            bool        `yaml:"debugServer,omitempty"`
	Webui                  bool        `yaml:"webui,omitempty"`
	WebuiJWTSecret         string      `yaml:"webuiJWTSecret,omitempty"`
	WebuiAdminPasswordHash string      `yaml:"webuiAdminPasswordHash,omitempty"`
	Peers                  []*Peer     `yaml:"peers"`
	// contains filtered or unexported fields
}

func ParseConfig

func ParseConfig(log *logrus.Logger, cmd *cobra.Command) (*Config, error)

func (*Config) GetExternalAddress added in v1.13.0

func (c *Config) GetExternalAddress() string

func (*Config) GetHubAddress added in v1.4.0

func (c *Config) GetHubAddress() string

func (*Config) GetPort

func (c *Config) GetPort() string

func (*Config) ResolvedBindAddr

func (c *Config) ResolvedBindAddr() string

type Peer

type Peer struct {
	PublicKey    string `yaml:"publicKey"`
	PublicKeyHex string `yaml:"-"`
	AllowedIP    string `yaml:"allowedIP"`
}

func NewPeer

func NewPeer(peerConfig string) (*Peer, error)

func (*Peer) String

func (p *Peer) String() string

Jump to

Keyboard shortcuts

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