From 13cf7271d6350a883a124d809b969321934abb7a Mon Sep 17 00:00:00 2001 From: "Shishkevich D." <135337715+shishkevichd@users.noreply.github.com> Date: Tue, 6 May 2025 09:05:32 +0700 Subject: fix: check default credentials during a fresh installation --- main.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'main.go') diff --git a/main.go b/main.go index e0b83969..ed30a11f 100644 --- a/main.go +++ b/main.go @@ -16,6 +16,7 @@ import ( "x-ui/web" "x-ui/web/global" "x-ui/web/service" + "x-ui/util/crypto" "github.com/op/go-logging" ) @@ -161,6 +162,12 @@ func showSetting(show bool) { } else { fmt.Println("Panel is secure with SSL") } + + hasDefaultCredential := func() bool { + return userModel.Username == "admin" && crypto.CheckPasswordHash(userModel.Password, "admin") + }() + + fmt.Println("hasDefaultCredential:", hasDefaultCredential) fmt.Println("port:", port) fmt.Println("webBasePath:", webBasePath) } -- cgit v1.2.3