增加加密保存用户密码开关

This commit is contained in:
孤鸿 2025-03-07 04:32:42 +00:00
parent 38781eab8c
commit 33b2c4890b
3 changed files with 9 additions and 7 deletions

View File

@ -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"`

View File

@ -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"},

View File

@ -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