From 33b2c4890bb832b9cdcdddc6f8e5a02d167af30d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A4=E9=B8=BF?= <31199914+wsczx@users.noreply.github.com> Date: Fri, 7 Mar 2025 04:32:42 +0000 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8A=A0=E5=AF=86=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E7=94=A8=E6=88=B7=E5=AF=86=E7=A0=81=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/base/cfg.go | 10 ++++++---- server/base/config.go | 1 + server/conf/server-sample.toml | 5 ++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/server/base/cfg.go b/server/base/cfg.go index fd75af0..65cb448 100644 --- a/server/base/cfg.go +++ b/server/base/cfg.go @@ -2,11 +2,12 @@ package base import ( "fmt" - "github.com/bjdgyc/anylink/pkg/utils" "os" "path/filepath" "reflect" "strings" + + "github.com/bjdgyc/anylink/pkg/utils" ) const ( @@ -85,9 +86,10 @@ type ServerConfig struct { Compression bool `json:"compression"` // bool NoCompressLimit int `json:"no_compress_limit"` // int - DisplayError bool `json:"display_error"` - ExcludeExportIp bool `json:"exclude_export_ip"` - AuthAloneOtp bool `json:"auth_alone_otp"` + DisplayError bool `json:"display_error"` + ExcludeExportIp bool `json:"exclude_export_ip"` + AuthAloneOtp bool `json:"auth_alone_otp"` + EncryptionPassword bool `json:"encryption_password"` AntiBruteForce bool `json:"anti_brute_force"` IPWhitelist string `json:"ip_whitelist"` diff --git a/server/base/config.go b/server/base/config.go index e6f75db..d5ee700 100644 --- a/server/base/config.go +++ b/server/base/config.go @@ -73,6 +73,7 @@ var configs = []config{ {Typ: cfgBool, Name: "display_error", Usage: "客户端显示详细错误信息(线上环境慎开启)", ValBool: false}, {Typ: cfgBool, Name: "exclude_export_ip", Usage: "排除出口ip路由(出口ip不加密传输)", ValBool: true}, {Typ: cfgBool, Name: "auth_alone_otp", Usage: "登录单独验证OTP窗口", ValBool: false}, + {Typ: cfgBool, Name: "encryption_password", Usage: "用户密码是否加密保存", ValBool: false}, {Typ: cfgBool, Name: "anti_brute_force", Usage: "是否开启防爆功能", ValBool: true}, {Typ: cfgStr, Name: "ip_whitelist", Usage: "全局IP白名单,多个用逗号分隔,支持单IP和CIDR范围", ValStr: "192.168.90.1,172.16.0.0/24"}, diff --git a/server/conf/server-sample.toml b/server/conf/server-sample.toml index b66477e..87ed29f 100644 --- a/server/conf/server-sample.toml +++ b/server/conf/server-sample.toml @@ -117,6 +117,8 @@ exclude_export_ip = true #登录单独验证OTP窗口 auth_alone_otp = false +#加密保存用户密码 +encryption_password = false #防爆破全局开关 anti_brute_force = true @@ -147,6 +149,3 @@ global_ip_lock_time = 300 #全局锁定状态的保存生命周期(秒),超过则删除记录 global_lock_state_expiration_time = 3600 - - -