creates a new WgConfig
The file path where this config should be written to by default
An array of VPN settings for remote peers
A place to keep the pre-shared key for this node (it's not saved in the WireGuard config)
A place to keep the public key for this node (it's not saved in the WireGuard config)
Defines the VPN settings for the local node.
Add a peer to the peers for this WgConfig.
If the peer already exists (found by public key) then it will be updated by merging the existing with the new. The allowedIps will be replaced by the new peer's allowedIps unless { mergeAllowedIps: true } is passed in as settings
Creates a WfgConfigPeer object from this WgCongig object
brings down the wireguard interface
Generate a public/private key pair for this WgConfig object
Get a peer from the peer array by it's public key
Parse a WireGuard config file in the form of a string into this WgConfig object
Parse a WireGuard config file from it's path in the file system
Remove a peer if it exists in the peer array by its public key
restarts the wireguard interface
Saves the config to file and restarts it unless { noUp: true }
is passed
JSON.stringify this WgConfig object
Return a string akin to a WireGuard config file from this WgConfig object
brings up the wireguard interface
Write this WgConfig object as a WireGuard config file to a file in the system
Generated using TypeDoc
A Javascript object representation of a WireGuard config file with some extras