feat: add auto binary update

This commit is contained in:
Maxi Quoß
2025-08-04 02:52:06 +02:00
parent 16b78768f5
commit f8a26547bc

View File

@@ -10,6 +10,7 @@ import (
"github.com/pocketbase/pocketbase"
"github.com/pocketbase/pocketbase/apis"
"github.com/pocketbase/pocketbase/core"
"github.com/pocketbase/pocketbase/plugins/ghupdate"
"github.com/pocketbase/pocketbase/plugins/migratecmd"
"github.com/robfig/cron/v3"
"github.com/seriousm4x/upsnap/cronjobs"
@@ -58,6 +59,13 @@ func StartPocketBase(distDirFS fs.FS) {
Automigrate: true,
})
// GitHub selfupdate
ghupdate.MustRegister(app, app.RootCmd, ghupdate.Config{
Owner: "seriousm4x",
Repo: "UpSnap",
ArchiveExecutable: "upsnap",
})
// event hooks
app.OnServe().BindFunc(func(se *core.ServeEvent) error {
se.Router.GET("/{path...}", apis.Static(distDirFS, true))