caddy_wg

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Name      configvalues.Hostname `json:"name"`
	Endpoint  configvalues.UDPAddr  `json:"endpoint"`
	IP        configvalues.IP       `json:"ip"`
	Private   PrivateKey            `json:"private"`
	Public    PublicKey             `json:"public"`
	Preshared PresharedKey          `json:"preshared"`
	// contains filtered or unexported fields
}

Client is a basic wireguard client.

func (*Client) CaddyModule

func (*Client) CaddyModule() caddy.ModuleInfo

func (*Client) Cleanup

func (c *Client) Cleanup() error

func (*Client) Provision

func (c *Client) Provision(ctx caddy.Context) error

func (*Client) Start

func (c *Client) Start(fn pointc.RegisterFunc) error

func (*Client) UnmarshalCaddyfile

func (c *Client) UnmarshalCaddyfile(d *caddyfile.Dispenser) (err error)

UnmarshalCaddyfile unmarshals a config in caddyfile form.

{
  point-c {
    wgclient <name> {
      ip <tunnel ip>
      endpoint <server address/ip>
      private <client private key>
      public <server public key>
      shared <shared key>
  }
}

type PresharedKey

PresharedKey is a wireguard preshared key in base64 format.

type PrivateKey

PrivateKey is a wireguard private key in base64 format.

type PublicKey

type PublicKey = configvalues.CaddyTextUnmarshaler[wgapi.PublicKey, valueKey[wgapi.PublicKey], *valueKey[wgapi.PublicKey]]

PublicKey is a wireguard public key in base64 format.

type Server

type Server struct {
	Name       configvalues.Hostname `json:"hostname"`
	IP         configvalues.IP       `json:"ip"`
	ListenPort configvalues.Port     `json:"listen-port"`
	Private    PrivateKey            `json:"private"`
	Peers      []*ServerPeer         `json:"peers"`
	// contains filtered or unexported fields
}

Server is a basic wireguard server.

func (*Server) CaddyModule

func (*Server) CaddyModule() caddy.ModuleInfo

func (*Server) Cleanup

func (c *Server) Cleanup() error

func (*Server) Provision

func (c *Server) Provision(ctx caddy.Context) error

func (*Server) Start

func (c *Server) Start(fn pointc.RegisterFunc) error

func (*Server) UnmarshalCaddyfile

func (c *Server) UnmarshalCaddyfile(d *caddyfile.Dispenser) (err error)

UnmarshalCaddyfile unmarshals a config in caddyfile form.

	{
	  point-c {
	    wgserver <name> {
	      ip <server ip>
	      port <server port to listen on>
	      private <server private key>
          peer <name> {
              ip <client ip>
	          public <client public key>
	          shared <shared key>
            }
	    }
	}

type ServerPeer

type ServerPeer struct {
	Name         configvalues.Hostname `json:"hostname"`
	Public       PublicKey             `json:"public"`
	PresharedKey PresharedKey          `json:"preshared"`
	IP           configvalues.IP       `json:"ip"`
}

Server is a basic wireguard server.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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