Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShishkevich D. <135337715+shishkevichd@users.noreply.github.com>2025-05-06 05:05:32 +0300
committerGitHub <noreply@github.com>2025-05-06 05:05:32 +0300
commit13cf7271d6350a883a124d809b969321934abb7a (patch)
treea822f006abd9afcebe82b052feeb5b1bb7fc5032 /main.go
parent63edc63ab0c1b2ec679dde0292d5e557da8e350e (diff)
fix: check default credentials during a fresh installation
Diffstat (limited to 'main.go')
-rw-r--r--main.go7
1 files changed, 7 insertions, 0 deletions
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)
}