mirror of
https://github.com/bjdgyc/anylink.git
synced 2025-09-14 15:06:57 +08:00
增加登录Banner开关,默认开启
This commit is contained in:
@@ -57,6 +57,7 @@ type ServerConfig struct {
|
|||||||
HttpServerLog bool `json:"http_server_log"`
|
HttpServerLog bool `json:"http_server_log"`
|
||||||
Pprof bool `json:"pprof"`
|
Pprof bool `json:"pprof"`
|
||||||
Issuer string `json:"issuer"`
|
Issuer string `json:"issuer"`
|
||||||
|
EnableBanner bool `json:"enable_banner"`
|
||||||
AdminUser string `json:"admin_user"`
|
AdminUser string `json:"admin_user"`
|
||||||
AdminPass string `json:"admin_pass"`
|
AdminPass string `json:"admin_pass"`
|
||||||
AdminOtp string `json:"admin_otp"`
|
AdminOtp string `json:"admin_otp"`
|
||||||
|
@@ -43,6 +43,7 @@ var configs = []config{
|
|||||||
{Typ: cfgBool, Name: "http_server_log", Usage: "开启go标准库http.Server的日志", ValBool: false},
|
{Typ: cfgBool, Name: "http_server_log", Usage: "开启go标准库http.Server的日志", ValBool: false},
|
||||||
{Typ: cfgBool, Name: "pprof", Usage: "开启pprof", ValBool: true},
|
{Typ: cfgBool, Name: "pprof", Usage: "开启pprof", ValBool: true},
|
||||||
{Typ: cfgStr, Name: "issuer", Usage: "系统名称", ValStr: "XX公司VPN"},
|
{Typ: cfgStr, Name: "issuer", Usage: "系统名称", ValStr: "XX公司VPN"},
|
||||||
|
{Typ: cfgBool, Name: "enable_banner", Usage: "登录横幅", ValBool: true},
|
||||||
{Typ: cfgStr, Name: "admin_user", Usage: "管理用户名", ValStr: "admin"},
|
{Typ: cfgStr, Name: "admin_user", Usage: "管理用户名", ValStr: "admin"},
|
||||||
{Typ: cfgStr, Name: "admin_pass", Usage: "管理用户密码", ValStr: defaultPwd},
|
{Typ: cfgStr, Name: "admin_pass", Usage: "管理用户密码", ValStr: defaultPwd},
|
||||||
{Typ: cfgStr, Name: "admin_otp", Usage: "管理用户otp,生成命令 ./anylink tool -o", ValStr: ""},
|
{Typ: cfgStr, Name: "admin_otp", Usage: "管理用户otp,生成命令 ./anylink tool -o", ValStr: ""},
|
||||||
|
@@ -38,6 +38,8 @@ pprof = true
|
|||||||
|
|
||||||
#系统名称
|
#系统名称
|
||||||
issuer = "XX公司VPN"
|
issuer = "XX公司VPN"
|
||||||
|
#登录横幅
|
||||||
|
enable_banner = true
|
||||||
#后台管理用户
|
#后台管理用户
|
||||||
admin_user = "admin"
|
admin_user = "admin"
|
||||||
#pass 123456
|
#pass 123456
|
||||||
|
@@ -149,11 +149,14 @@ func CreateSession(w http.ResponseWriter, r *http.Request, authSession *AuthSess
|
|||||||
rd := RequestData{
|
rd := RequestData{
|
||||||
SessionId: sess.Sid,
|
SessionId: sess.Sid,
|
||||||
SessionToken: sess.Sid + "@" + sess.Token,
|
SessionToken: sess.Sid + "@" + sess.Token,
|
||||||
Banner: other.Banner,
|
// Banner: other.Banner,
|
||||||
ProfileName: base.Cfg.ProfileName,
|
ProfileName: base.Cfg.ProfileName,
|
||||||
ProfileHash: profileHash,
|
ProfileHash: profileHash,
|
||||||
CertHash: certHash,
|
CertHash: certHash,
|
||||||
}
|
}
|
||||||
|
if base.Cfg.EnableBanner {
|
||||||
|
rd.Banner = other.Banner
|
||||||
|
}
|
||||||
|
|
||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
tplRequest(tpl_complete, w, rd)
|
tplRequest(tpl_complete, w, rd)
|
||||||
|
Reference in New Issue
Block a user