mirror of
https://github.com/seriousm4x/UpSnap.git
synced 2026-04-05 08:53:52 -04:00
feat: add auto binary update
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
|||||||
"github.com/pocketbase/pocketbase"
|
"github.com/pocketbase/pocketbase"
|
||||||
"github.com/pocketbase/pocketbase/apis"
|
"github.com/pocketbase/pocketbase/apis"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/pocketbase/pocketbase/core"
|
||||||
|
"github.com/pocketbase/pocketbase/plugins/ghupdate"
|
||||||
"github.com/pocketbase/pocketbase/plugins/migratecmd"
|
"github.com/pocketbase/pocketbase/plugins/migratecmd"
|
||||||
"github.com/robfig/cron/v3"
|
"github.com/robfig/cron/v3"
|
||||||
"github.com/seriousm4x/upsnap/cronjobs"
|
"github.com/seriousm4x/upsnap/cronjobs"
|
||||||
@@ -58,6 +59,13 @@ func StartPocketBase(distDirFS fs.FS) {
|
|||||||
Automigrate: true,
|
Automigrate: true,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// GitHub selfupdate
|
||||||
|
ghupdate.MustRegister(app, app.RootCmd, ghupdate.Config{
|
||||||
|
Owner: "seriousm4x",
|
||||||
|
Repo: "UpSnap",
|
||||||
|
ArchiveExecutable: "upsnap",
|
||||||
|
})
|
||||||
|
|
||||||
// event hooks
|
// event hooks
|
||||||
app.OnServe().BindFunc(func(se *core.ServeEvent) error {
|
app.OnServe().BindFunc(func(se *core.ServeEvent) error {
|
||||||
se.Router.GET("/{path...}", apis.Static(distDirFS, true))
|
se.Router.GET("/{path...}", apis.Static(distDirFS, true))
|
||||||
|
|||||||
Reference in New Issue
Block a user