new
This commit is contained in:
parent
3fb940ba5b
commit
5c860a45e1
|
@ -82,10 +82,8 @@ Also, if the database path doesn't exist, File Browser will enter into
|
|||
the quick setup mode and a new database will be bootstraped and a new
|
||||
user created with the credentials from options "username" and "password".`,
|
||||
Run: python(func(cmd *cobra.Command, args []string, d pythonData) {
|
||||
settings.Initialize()
|
||||
serverConfig := settings.GlobalConfiguration.Server
|
||||
log.Println(cfgFile)
|
||||
|
||||
if !d.hadDB {
|
||||
quickSetup(cmd.Flags(), d)
|
||||
}
|
||||
|
|
|
@ -85,8 +85,7 @@ func dbExists(path string) (bool, error) {
|
|||
func python(fn pythonFunc, cfg pythonConfig) cobraFunc {
|
||||
return func(cmd *cobra.Command, args []string) {
|
||||
data := pythonData{hadDB: true}
|
||||
|
||||
path := getParam(cmd.Flags(), "database")
|
||||
path := settings.GlobalConfiguration.Server.Database
|
||||
exists, err := dbExists(path)
|
||||
|
||||
if err != nil {
|
||||
|
@ -100,6 +99,7 @@ func python(fn pythonFunc, cfg pythonConfig) cobraFunc {
|
|||
data.hadDB = exists
|
||||
db, err := storm.Open(path)
|
||||
checkErr(err)
|
||||
|
||||
defer db.Close()
|
||||
data.store, err = bolt.NewStorage(db)
|
||||
checkErr(err)
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
server:
|
||||
port: 8050
|
||||
baseURL: /
|
||||
#baseURL: /
|
||||
address: ''
|
||||
log: stdout
|
||||
database: ./database.db
|
||||
database: database.db
|
||||
root: /srv
|
||||
general:
|
||||
disable-thumbnails: false
|
||||
|
|
|
@ -10,7 +10,7 @@ import (
|
|||
|
||||
var GlobalConfiguration Settings
|
||||
|
||||
func Initialize() {
|
||||
func init() {
|
||||
// Open and read the YAML file
|
||||
yamlFile, err := os.Open("filebrowser.yml")
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue