From 9afc4d4efb45ee0bb1089f68ac472bcaee8ec235 Mon Sep 17 00:00:00 2001 From: Thilo Billerbeck Date: Tue, 23 May 2023 14:41:53 +0200 Subject: [PATCH] pocketbase: 0.15.3 -> 0.16.3 updated pocketbase --- pkgs/servers/pocketbase/default.nix | 13 +++++++---- .../pocketbase/remove-update-method.patch | 22 +++++++++++++++++++ 2 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 pkgs/servers/pocketbase/remove-update-method.patch diff --git a/pkgs/servers/pocketbase/default.nix b/pkgs/servers/pocketbase/default.nix index 462479745b87..fb0b0f012955 100644 --- a/pkgs/servers/pocketbase/default.nix +++ b/pkgs/servers/pocketbase/default.nix @@ -5,16 +5,16 @@ buildGoModule rec { pname = "pocketbase"; - version = "0.15.3"; + version = "0.16.3"; src = fetchFromGitHub { owner = "pocketbase"; repo = pname; rev = "v${version}"; - sha256 = "sha256-9LIOBfNOa+u7yLL7iWb/e7c8ZSiyjukqaY0ifVR2iSs="; + sha256 = "sha256-AKKCd80gxeL2s1yFX3pjwgxn7UDbrrhFUkMWDDcrN0c="; }; - vendorHash = "sha256-LFIJClPByaLXtsBOk7SjpJlIuQhWbVIs6H4PXhd7oyo="; + vendorHash = "sha256-J1vZn5x7wxM/UshcB+FdaiXiq4mZF7KvZxR5iPb37UQ="; # This is the released subpackage from upstream repo subPackages = [ "examples/base" ]; @@ -32,10 +32,15 @@ buildGoModule rec { mv $out/bin/base $out/bin/pocketbase ''; + patches = [ + # To provide a consistent update experience, we remove the built in update method + ./remove-update-method.patch + ]; + meta = with lib; { description = "Open Source realtime backend in 1 file"; homepage = "https://github.com/pocketbase/pocketbase"; license = licenses.mit; - maintainers = with maintainers; [ dit7ya ]; + maintainers = with maintainers; [ dit7ya thilobillerbeck ]; }; } diff --git a/pkgs/servers/pocketbase/remove-update-method.patch b/pkgs/servers/pocketbase/remove-update-method.patch new file mode 100644 index 000000000000..a68ae58bd0ba --- /dev/null +++ b/pkgs/servers/pocketbase/remove-update-method.patch @@ -0,0 +1,22 @@ +diff --git a/examples/base/main.go b/examples/base/main.go +index 908d31d..04b8f1d 100644 +--- a/examples/base/main.go ++++ b/examples/base/main.go +@@ -10,7 +10,6 @@ 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/jsvm" + "github.com/pocketbase/pocketbase/plugins/migratecmd" + ) +@@ -80,9 +79,6 @@ func main() { + Dir: migrationsDir, + }) + +- // GitHub selfupdate +- ghupdate.MustRegister(app, app.RootCmd, nil) +- + app.OnAfterBootstrap().Add(func(e *core.BootstrapEvent) error { + app.Dao().ModelQueryTimeout = time.Duration(queryTimeout) * time.Second + return nil