mirror of
https://github.com/stashapp/stash-box.git
synced 2026-02-04 21:35:26 -06:00
36 lines
785 B
Go
36 lines
785 B
Go
//go:generate go run github.com/99designs/gqlgen
|
|
package main
|
|
|
|
import (
|
|
"embed"
|
|
|
|
"github.com/stashapp/stash-box/pkg/api"
|
|
"github.com/stashapp/stash-box/pkg/database"
|
|
"github.com/stashapp/stash-box/pkg/manager"
|
|
"github.com/stashapp/stash-box/pkg/manager/config"
|
|
"github.com/stashapp/stash-box/pkg/manager/cron"
|
|
"github.com/stashapp/stash-box/pkg/sqlx"
|
|
"github.com/stashapp/stash-box/pkg/user"
|
|
)
|
|
|
|
//nolint
|
|
//go:embed frontend/build
|
|
var ui embed.FS
|
|
|
|
func main() {
|
|
manager.Initialize()
|
|
|
|
const databaseProvider = "postgres"
|
|
db := database.Initialize(databaseProvider, config.GetDatabasePath())
|
|
txnMgr := sqlx.NewTxnMgr(db)
|
|
user.CreateSystemUsers(txnMgr.Repo())
|
|
api.Start(txnMgr, ui)
|
|
cron.Init(txnMgr)
|
|
blockForever()
|
|
}
|
|
|
|
func blockForever() {
|
|
c := make(chan struct{})
|
|
<-c
|
|
}
|