diff --git a/backend/pb/pb.go b/backend/pb/pb.go index c0c151d0..6c59c2c4 100644 --- a/backend/pb/pb.go +++ b/backend/pb/pb.go @@ -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))