mirror of
https://github.com/speatzle/nfsense.git
synced 2025-09-13 15:19:08 +00:00
Add Wireguard Config
This commit is contained in:
parent
5bf336ff91
commit
a67911df67
5 changed files with 32 additions and 0 deletions
9
internal/definitions/vpn/interface.go
Normal file
9
internal/definitions/vpn/interface.go
Normal file
|
@ -0,0 +1,9 @@
|
|||
package vpn
|
||||
|
||||
type WireguardInterface struct {
|
||||
PublicKey string `json:"public_key"`
|
||||
PrivateKey string `json:"private_key"`
|
||||
ListenPort uint64 `json:"listen_port"`
|
||||
Peers []string `json:"peers"`
|
||||
Comment string `json:"comment,omitempty"`
|
||||
}
|
10
internal/definitions/vpn/peer.go
Normal file
10
internal/definitions/vpn/peer.go
Normal file
|
@ -0,0 +1,10 @@
|
|||
package vpn
|
||||
|
||||
type WireguardPeer struct {
|
||||
PublicKey string `json:"public_key"`
|
||||
PresharedKey *string `json:"preshared_key,omitempty"`
|
||||
AllowedIPs []string `json:"allowed_ips"`
|
||||
Endpoint *string `json:"endpoint,omitempty"`
|
||||
PersistentKeepalive *uint64 `json:"persistent_keepalive,omitempty"`
|
||||
Comment string `json:"comment,omitempty"`
|
||||
}
|
5
internal/definitions/vpn/vpn.go
Normal file
5
internal/definitions/vpn/vpn.go
Normal file
|
@ -0,0 +1,5 @@
|
|||
package vpn
|
||||
|
||||
type VPN struct {
|
||||
Wireguard Wireguard `json:"wireguard" validate:"required,dive"`
|
||||
}
|
6
internal/definitions/vpn/wireguard.go
Normal file
6
internal/definitions/vpn/wireguard.go
Normal file
|
@ -0,0 +1,6 @@
|
|||
package vpn
|
||||
|
||||
type Wireguard struct {
|
||||
Interfaces map[string]WireguardInterface `json:"interfaces" validate:"required,dive"`
|
||||
Peers map[string]WireguardPeer `json:"peers" validate:"required,dive"`
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue