fix: add -password
flag back
This commit is contained in:
11
alist.go
11
alist.go
@ -2,9 +2,11 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/Xhofe/alist/bootstrap"
|
"github.com/Xhofe/alist/bootstrap"
|
||||||
"github.com/Xhofe/alist/conf"
|
"github.com/Xhofe/alist/conf"
|
||||||
_ "github.com/Xhofe/alist/drivers"
|
_ "github.com/Xhofe/alist/drivers"
|
||||||
|
"github.com/Xhofe/alist/model"
|
||||||
"github.com/Xhofe/alist/server"
|
"github.com/Xhofe/alist/server"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
@ -14,6 +16,15 @@ func Init() bool {
|
|||||||
bootstrap.InitConf()
|
bootstrap.InitConf()
|
||||||
bootstrap.InitCron()
|
bootstrap.InitCron()
|
||||||
bootstrap.InitModel()
|
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()
|
server.InitIndex()
|
||||||
bootstrap.InitSettings()
|
bootstrap.InitSettings()
|
||||||
bootstrap.InitAuth()
|
bootstrap.InitAuth()
|
||||||
|
@ -2,6 +2,7 @@ package bootstrap
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
|
|
||||||
"github.com/Xhofe/alist/conf"
|
"github.com/Xhofe/alist/conf"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
@ -29,6 +30,7 @@ func init() {
|
|||||||
flag.StringVar(&conf.ConfigFile, "conf", "data/config.json", "config file")
|
flag.StringVar(&conf.ConfigFile, "conf", "data/config.json", "config file")
|
||||||
flag.BoolVar(&conf.Debug, "debug", false, "start with debug mode")
|
flag.BoolVar(&conf.Debug, "debug", false, "start with debug mode")
|
||||||
flag.BoolVar(&conf.Version, "version", false, "print version info")
|
flag.BoolVar(&conf.Version, "version", false, "print version info")
|
||||||
|
flag.BoolVar(&conf.Password, "password", false, "print current password")
|
||||||
flag.BoolVar(&conf.Docker, "docker", false, "is using docker")
|
flag.BoolVar(&conf.Docker, "docker", false, "is using docker")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
InitLog()
|
InitLog()
|
||||||
|
Reference in New Issue
Block a user