record added time
This commit is contained in:
parent
3277362e6e
commit
1e046a20a1
1
add.go
1
add.go
@ -36,6 +36,7 @@ func Add() {
|
|||||||
Owner: owner,
|
Owner: owner,
|
||||||
Hostname: hostname,
|
Hostname: hostname,
|
||||||
Description: description,
|
Description: description,
|
||||||
|
Added: time.Now(),
|
||||||
PublicKey: publicKey,
|
PublicKey: publicKey,
|
||||||
PrivateKey: privateKey, // omitted from server config JSON!
|
PrivateKey: privateKey, // omitted from server config JSON!
|
||||||
PresharedKey: GenerateJSONKey(),
|
PresharedKey: GenerateJSONKey(),
|
||||||
|
@ -5,6 +5,7 @@ import (
|
|||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net"
|
"net"
|
||||||
"os"
|
"os"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/go-playground/validator/v10"
|
"github.com/go-playground/validator/v10"
|
||||||
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
|
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
|
||||||
@ -20,6 +21,7 @@ type PeerConfig struct {
|
|||||||
Description string `validate:"required,gte=1,lte=255"`
|
Description string `validate:"required,gte=1,lte=255"`
|
||||||
// Internal VPN IP address. Added to AllowedIPs in server config as a /32
|
// Internal VPN IP address. Added to AllowedIPs in server config as a /32
|
||||||
IP net.IP `validate:"required`
|
IP net.IP `validate:"required`
|
||||||
|
Added time.Time `validate:"required"`
|
||||||
// TODO ExternalIP support (Endpoint)
|
// TODO ExternalIP support (Endpoint)
|
||||||
//ExternalIP net.UDPAddr `validate:"required,udp4_addr"`
|
//ExternalIP net.UDPAddr `validate:"required,udp4_addr"`
|
||||||
// TODO support routing additional networks (AllowedIPs)
|
// TODO support routing additional networks (AllowedIPs)
|
||||||
|
@ -107,6 +107,7 @@ func GenerateReport(dev *wgtypes.Device, conf *DsnetConfig, oldReport *DsnetRepo
|
|||||||
Hostname: peer.Hostname,
|
Hostname: peer.Hostname,
|
||||||
Owner: peer.Owner,
|
Owner: peer.Owner,
|
||||||
Description: peer.Description,
|
Description: peer.Description,
|
||||||
|
Added: peer.Added,
|
||||||
IP: peer.IP,
|
IP: peer.IP,
|
||||||
ExternalIP: externalIP,
|
ExternalIP: externalIP,
|
||||||
Status: status,
|
Status: status,
|
||||||
@ -167,6 +168,8 @@ type PeerReport struct {
|
|||||||
Owner string
|
Owner string
|
||||||
// Description of what the host is and/or does
|
// Description of what the host is and/or does
|
||||||
Description string
|
Description string
|
||||||
|
// date peer was added to dsnet config
|
||||||
|
Added time.Time
|
||||||
// Internal VPN IP address. Added to AllowedIPs in server config as a /32
|
// Internal VPN IP address. Added to AllowedIPs in server config as a /32
|
||||||
IP net.IP
|
IP net.IP
|
||||||
// Last known external IP
|
// Last known external IP
|
||||||
|
Loading…
Reference in New Issue
Block a user