Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMissingPublicKey = errors.New("missing public key") ErrMissingSecretKey = errors.New("missing private key") )
Functions ¶
This section is empty.
Types ¶
type File ¶
type File struct { // A filename containing this nodes raw public key PublicKey string `toml:"public_key" comment:"A filename containing this nodes raw public key"` // A filename containing this nodes raw secret key SecretKey string `toml:"secret_key" comment:"A filename containing this nodes raw secret key"` // A host:port pair to identify the interface and port to listen for handshake messages ListenAddrs []string `toml:"listen,omitempty" comment:"A host:port pair to identify the interface and port to listen for handshake messages"` // Use eBPF to listen and share the same port with an existing WireGuard interface ListenSinglePort bool `toml:"single_port,omitempty"` // Set to 'Verbose' or 'Quiet' Verbosity string `toml:"verbosity,omitempty" comment:"Set to 'Verbose' or 'Quiet'"` // A table of peers Peers []PeerSection `toml:"peers,omitempty" comment:"A table of peers"` }
func FromArgs ¶
FromArgs parses exchange config from CLI args Format: private-key <file-path> public-key <file-path> [ OPTIONS ] PEERS.
func FromWireGuardInterface ¶ added in v0.4.0
type PeerSection ¶
type PeerSection struct { // The peer’s public key PublicKey string `toml:"public_key" comment:"The peer’s public key"` // The peers's endpoint Endpoint *string `toml:"endpoint" comment:"The peers's endpoint"` PresharedKey *string `toml:"pre_shared_key" comment:"The peer's pre-shared key"` // A path to a file to which we will write the base64-encoded PSK after each handshake KeyOut *string `toml:"key_out" comment:"A path to a file to which we will write the base64-encoded PSK after each handshake"` // A command which is executed after each completed handshake ExchangeCommand []string `toml:"exchange_command,multiline,omitempty" comment:"A command which is executed after each completed handshake"` // Settings for directly configuring a WireGuard peer with the negotiated PSK WireGuard *WireGuardSection `toml:"wireguard,inline" comment:"Settings for directly configuring a WireGuard peer with the negotiated PSK"` }
func PeerConfigFromArgs ¶
func PeerConfigFromArgs(args []string) (_ []string, cfg PeerSection, err error)
Parse peer config from CLI arguments Format: peer public-key <file-path> [endpoint <ip>[:<port>]] [preshared-key <file-path>] [outfile <file-path>] [wireguard <dev> <peer> <extra_params>].
func (*PeerSection) FromConfig ¶
func (ps *PeerSection) FromConfig(pc rp.PeerConfig, dir string) (err error)
func (*PeerSection) ToConfig ¶
func (ps *PeerSection) ToConfig() (pc rp.PeerConfig, err error)
type WireGuardSection ¶
Click to show internal directories.
Click to hide internal directories.