config: vpn

This commit is contained in:
Mikaël Cluseau 2022-03-31 15:52:52 +02:00
parent 8c51e2a555
commit b11c53b36a

View File

@ -3,7 +3,9 @@ package config
import ( import (
"fmt" "fmt"
"io" "io"
"net"
"os" "os"
"time"
yaml "gopkg.in/yaml.v2" yaml "gopkg.in/yaml.v2"
) )
@ -98,16 +100,24 @@ type VolumeDef struct {
} }
type MountDef struct { type MountDef struct {
Type string Type string
Dev string Dev string
Path string Path string
Options string Options string
} }
type VPNDef struct { type VPNDef struct {
Name string `yaml:"name"` Name string `yaml:"name"`
IPs []string ListenPort *int `yaml:"port"`
Config string IPs []string
Peers []VPNPeer
}
type VPNPeer struct {
PublicKey string `yaml:"public_key"`
Endpoint *net.UDPAddr
KeepAlive time.Duration `yaml:"keepalive"`
AllowedIPs []string `yaml:"allowed_ips"`
} }
type GroupDef struct { type GroupDef struct {