From ca42b4aeab84ab0a33658daec2be0dc5371741b2 Mon Sep 17 00:00:00 2001 From: Ioannis Dressos <96877388+idressos@users.noreply.github.com> Date: Sun, 29 Oct 2023 15:56:56 +0200 Subject: [PATCH] Add endpoint field to client --- handler/routes.go | 1 + model/client.go | 1 + templates/base.html | 7 ++++++- templates/clients.html | 11 ++++++++++- templates/wg.conf | 7 ++++--- 5 files changed, 22 insertions(+), 5 deletions(-) diff --git a/handler/routes.go b/handler/routes.go index 6b430ff..232f32b 100644 --- a/handler/routes.go +++ b/handler/routes.go @@ -624,6 +624,7 @@ func UpdateClient(db store.IStore) echo.HandlerFunc { client.AllocatedIPs = _client.AllocatedIPs client.AllowedIPs = _client.AllowedIPs client.ExtraAllowedIPs = _client.ExtraAllowedIPs + client.Endpoint = _client.Endpoint client.PublicKey = _client.PublicKey client.PresharedKey = _client.PresharedKey client.UpdatedAt = time.Now().UTC() diff --git a/model/client.go b/model/client.go index be5fa76..95342f0 100644 --- a/model/client.go +++ b/model/client.go @@ -15,6 +15,7 @@ type Client struct { AllocatedIPs []string `json:"allocated_ips"` AllowedIPs []string `json:"allowed_ips"` ExtraAllowedIPs []string `json:"extra_allowed_ips"` + Endpoint string `json:"endpoint"` UseServerDNS bool `json:"use_server_dns"` Enabled bool `json:"enabled"` CreatedAt time.Time `json:"created_at"` diff --git a/templates/base.html b/templates/base.html index 6e53df3..0412c46 100644 --- a/templates/base.html +++ b/templates/base.html @@ -235,6 +235,10 @@ +