mirror of
https://github.com/fankes/beszel.git
synced 2025-10-20 02:09:28 +08:00
update initial settings with minimum log level and use new SetRandomPassword method
This commit is contained in:
@@ -3,7 +3,6 @@ package migrations
|
|||||||
import (
|
import (
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/pocketbase/pocketbase/core"
|
||||||
m "github.com/pocketbase/pocketbase/migrations"
|
m "github.com/pocketbase/pocketbase/migrations"
|
||||||
"github.com/pocketbase/pocketbase/tools/security"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -16,6 +15,7 @@ func init() {
|
|||||||
settings := app.Settings()
|
settings := app.Settings()
|
||||||
settings.Meta.AppName = "Beszel"
|
settings.Meta.AppName = "Beszel"
|
||||||
settings.Meta.HideControls = true
|
settings.Meta.HideControls = true
|
||||||
|
settings.Logs.MinLevel = 4
|
||||||
if err := app.Save(settings); err != nil {
|
if err := app.Save(settings); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -23,7 +23,7 @@ func init() {
|
|||||||
collection, _ := app.FindCollectionByNameOrId(core.CollectionNameSuperusers)
|
collection, _ := app.FindCollectionByNameOrId(core.CollectionNameSuperusers)
|
||||||
user := core.NewRecord(collection)
|
user := core.NewRecord(collection)
|
||||||
user.SetEmail(TempAdminEmail)
|
user.SetEmail(TempAdminEmail)
|
||||||
user.SetPassword(security.RandomString(12))
|
user.SetRandomPassword()
|
||||||
return app.Save(user)
|
return app.Save(user)
|
||||||
}, nil)
|
}, nil)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user