From 5fc8cc8d9471fba3bf9946615ba0958fb4475603 Mon Sep 17 00:00:00 2001 From: coward Date: Fri, 24 May 2024 16:08:00 +0800 Subject: [PATCH] =?UTF-8?q?:art:=E4=B8=80=E4=BA=9B=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- repository/client.go | 6 +++++- script/script.go | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/repository/client.go b/repository/client.go index f7ae4ec..2df1d01 100644 --- a/repository/client.go +++ b/repository/client.go @@ -109,7 +109,11 @@ func (r clientRepo) Save(p param.SaveClient, adminId string) (client *entity.Cli if p.Id != "" { keys, _ := json.Marshal(p.Keys) ent.Keys = string(keys) - if err = r.Model(&entity.Client{}).Where("id = ?", p.Id).Updates(ent).Error; err != nil { + if err = r.Model(&entity.Client{}). + Where("id = ?", p.Id).Select("name", "email", "subnet_range", "ip_allocation", + "allowed_ips", "extra_allowed_ips", "endpoint", "use_server_dns", "enable_after_creation", + "user_id", "enabled"). + Updates(ent).Error; err != nil { return } return diff --git a/script/script.go b/script/script.go index 87d529f..5f85663 100644 --- a/script/script.go +++ b/script/script.go @@ -109,7 +109,7 @@ func (s Script) InitServer() error { "dnsServer": []string{"10.10.10.1/24"}, "MTU": 1450, "persistentKeepalive": 15, - "firewallMark": "", + "firewallMark": "0xca6c", "table": "", "configFilePath": "/etc/wireguard/wg0.conf", }