fix: add -password flag back

This commit is contained in:
Noah Hsu
2022-08-13 20:56:19 +08:00
parent a66b2d92b7
commit ba9d568539
2 changed files with 13 additions and 0 deletions

View File

@@ -2,9 +2,11 @@ package main
import (
"fmt"
"github.com/Xhofe/alist/bootstrap"
"github.com/Xhofe/alist/conf"
_ "github.com/Xhofe/alist/drivers"
"github.com/Xhofe/alist/model"
"github.com/Xhofe/alist/server"
"github.com/gin-gonic/gin"
log "github.com/sirupsen/logrus"
@@ -14,6 +16,15 @@ func Init() bool {
bootstrap.InitConf()
bootstrap.InitCron()
bootstrap.InitModel()
if conf.Password {
pass, err := model.GetSettingByKey("password")
if err != nil {
log.Errorf(err.Error())
return false
}
fmt.Printf("your password: %s\n", pass.Value)
return false
}
server.InitIndex()
bootstrap.InitSettings()
bootstrap.InitAuth()