fix: check default credentials during a fresh installation
Some checks are pending
Build and Release 3X-UI / build (386) (push) Waiting to run
Build and Release 3X-UI / build (amd64) (push) Waiting to run
Build and Release 3X-UI / build (arm64) (push) Waiting to run
Build and Release 3X-UI / build (armv5) (push) Waiting to run
Build and Release 3X-UI / build (armv6) (push) Waiting to run
Build and Release 3X-UI / build (armv7) (push) Waiting to run
Build and Release 3X-UI / build (s390x) (push) Waiting to run

This commit is contained in:
Shishkevich D.
2025-05-06 09:05:32 +07:00
committed by GitHub
parent 63edc63ab0
commit 13cf7271d6
8 changed files with 16 additions and 12 deletions

View File

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