From 28799ceb8e27880cfd4926554e4fe6d961836f46 Mon Sep 17 00:00:00 2001 From: jeessy2 <6205259+jeessy2@users.noreply.github.com> Date: Sat, 4 Nov 2023 10:23:12 +0800 Subject: [PATCH] fix: Ensure that access from the internet is not possible when login information is not filled in (#904) --- config/config.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/config.go b/config/config.go index 227d1ea09..c37db0e93 100755 --- a/config/config.go +++ b/config/config.go @@ -104,6 +104,11 @@ func GetConfigCached() (conf Config, err error) { return *cache.ConfigSingle, err } + // 未填写登录信息, 确保不能从公网访问 + if cache.ConfigSingle.Username == "" && cache.ConfigSingle.Password == "" { + cache.ConfigSingle.NotAllowWanAccess = true + } + // remove err cache.Err = nil return *cache.ConfigSingle, err