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