Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CmdDump = &cli.Command{ Name: "dump", Usage: "Dump WireGuard configuration as a list of IPs, useful for Ansible inventories. Dumps only the first address in allowedIP, taking into account the mask", Flags: []cli.Flag{ &cli.StringFlag{ Name: "interface", Aliases: []string{"i"}, Value: "wg0", Usage: "Read default configuration path for the interface", }, &cli.StringFlag{ Name: "config", Aliases: []string{"c"}, Value: "", DefaultText: "/etc/wireguard/<interface>.conf", Usage: "Path to the existing WireGuard configuration file", }, }, Action: runDump, }
View Source
var CmdRequest = &cli.Command{ Name: "request", Usage: "Set up local WireGuard", Action: runRequest, Flags: []cli.Flag{ &cli.StringFlag{ Name: "interface", Aliases: []string{"i"}, Value: "wg0", Usage: "Name for new WireGuard interface", }, &cli.StringFlag{ Name: "none", Aliases: []string{"c"}, Value: "", DefaultText: "/etc/wireguard/<interface>.conf", Usage: "Path to save a WireGuard configuration file", }, &cli.StringFlag{ Name: "networkd", Aliases: []string{"n"}, Value: "", DefaultText: "/etc/systemd/network/<interface>", Usage: "Path to save networkd configuration. Appends .netdev and .network extensions", }, &cli.StringFlag{ Name: "type", Aliases: []string{"t"}, Value: "networkd", Usage: "Select network interface backend. Currently only networkd is implemented", }, &cli.StringFlag{ Name: "server", Aliases: []string{"s"}, Usage: "wireguard-negotiator server URL", Required: true, EnvVars: []string{"WGN_SERVER_URL"}, }, &cli.BoolFlag{ Name: "insecure", Usage: "Disable TLS verification", EnvVars: []string{"WGN_SERVER_INSECURE"}, }, }, }
View Source
var CmdServer = &cli.Command{ Name: "server", Usage: "Start the wireguard-negotiator server", Flags: []cli.Flag{ &cli.StringFlag{ Name: "interface", Aliases: []string{"i"}, Value: "wg0", Usage: "An existing WireGuard interface to manage", }, &cli.StringFlag{ Name: "config", Aliases: []string{"c"}, Value: "", DefaultText: "/etc/wireguard/<interface>.conf", Usage: "Path to the existing WireGuard configuration file. WARNING: wireguard-negotiator will remove any comments in the file", }, &cli.StringFlag{ Name: "endpoint", Aliases: []string{"e"}, Value: "", Required: true, Usage: "Set the endpoint address", }, &cli.StringFlag{ Name: "listen", Aliases: []string{"l"}, Value: ":8080", Usage: "Listen on this address", }, &cli.BoolFlag{ Name: "interactive", Aliases: []string{"I"}, Usage: "Enable interactive prompt before accepting new peers", }, &cli.BoolFlag{ Name: "bin", Aliases: []string{"B"}, Usage: "Serve the current wireguard-negotiator binary file upon GET request to /", }, }, Action: runServer, }
View Source
var ErrNoAddressesFound = fmt.Errorf("No address found on the interface")
View Source
var ErrTypeNotValid = fmt.Errorf("network interface backend type not valid")
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.