forked from stashapp/stash-box
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
36 lines (30 loc) · 789 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//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
}