feat: web login page (#1058)

This commit is contained in:
Levi authored and GitHub committed 2025-07-16 01:02:25 +08:00
1 parent 2927d1ef2b
commit 4f7b8a05ad
22 files changed
+771 -43

No files matched your search

+3 -3
View File
@@ -26,9 +26,9 @@ func parse() *args {
var cliArgs args
cliArgs.Address = flag.String("A", "0.0.0.0", "Bind Address")
cliArgs.Port = flag.Int("P", 9999, "Bind Port")
cliArgs.Username = flag.String("u", "gopeed", "HTTP Basic Auth Username")
cliArgs.Password = flag.String("p", "", "HTTP Basic Auth Pwd")
cliArgs.ApiToken = flag.String("T", "", "API token, it must be configured when using HTTP API in the case of enabling basic authentication")
cliArgs.Username = flag.String("u", "gopeed", "Web Authentication Username")
cliArgs.Password = flag.String("p", "", "Web Authentication Password, if no password is set, web authentication will not be enabled")
cliArgs.ApiToken = flag.String("T", "", "API token, it must be configured when using HTTP API in the case of enabling web authentication")
cliArgs.StorageDir = flag.String("d", "", "Storage directory")
cliArgs.configPath = flag.String("c", "./config.json", "Config file path")
flag.Parse()
+3 -3
View File
@@ -23,9 +23,9 @@ func main() {
}
args := parse()
var webBasicAuth *model.WebBasicAuth
var webAuth *model.WebAuth
if isNotBlank(args.Username) && isNotBlank(args.Password) {
webBasicAuth = &model.WebBasicAuth{
webAuth = &model.WebAuth{
Username: *args.Username,
Password: *args.Password,
}
@@ -52,7 +52,7 @@ func main() {
ProductionMode: true,
WebEnable: true,
WebFS: sub,
WebBasicAuth: webBasicAuth,
WebAuth: webAuth,
}
cmd.Start(cfg)
}