grocy: 3.0.1 -> 3.1.0

ChangeLog: https://github.com/grocy/grocy/releases/tag/v3.1.0

+23 -23
+1 -1
nixos/tests/grocy.nix
··· 40 40 41 41 assert task_name == "Test Task" 42 42 43 - machine.succeed("curl -sSfI http://localhost/api/tasks 2>&1 | grep '401 Unauthorized'") 43 + machine.succeed("curl -sSI http://localhost/api/tasks 2>&1 | grep '401 Unauthorized'") 44 44 45 45 machine.shutdown() 46 46 '';
+20 -20
pkgs/servers/grocy/0001-Define-configs-with-env-vars.patch
··· 1 - From 7ed6c641cc501246931721700b73f40dce7e8f4b Mon Sep 17 00:00:00 2001 1 + From 035709eeac697945a26276cc17b996c1a0678ddc Mon Sep 17 00:00:00 2001 2 2 From: Maximilian Bosch <maximilian@mbosch.me> 3 3 Date: Tue, 22 Dec 2020 15:38:56 +0100 4 - Subject: [PATCH 1/2] Define configs with env vars 4 + Subject: [PATCH] Define configs with env vars 5 5 6 6 --- 7 7 app.php | 4 ++-- ··· 11 11 4 files changed, 5 insertions(+), 6 deletions(-) 12 12 13 13 diff --git a/app.php b/app.php 14 - index 8176ebe..04432ba 100644 14 + index 17ba6a99..89f48089 100644 15 15 --- a/app.php 16 16 +++ b/app.php 17 - @@ -10,7 +10,7 @@ use Slim\Factory\AppFactory; 17 + @@ -11,7 +11,7 @@ use Slim\Views\Blade; 18 18 require_once __DIR__ . '/vendor/autoload.php'; 19 19 20 20 // Load config files 21 21 -require_once GROCY_DATAPATH . '/config.php'; 22 22 +require_once getenv('GROCY_CONFIG_FILE'); 23 23 require_once __DIR__ . '/config-dist.php'; // For not in own config defined values we use the default ones 24 + require_once __DIR__ . '/helpers/ConfigurationValidator.php'; 24 25 25 - // Definitions for dev/demo/prerelease mode 26 - @@ -37,7 +37,7 @@ $app = AppFactory::create(); 26 + @@ -62,7 +62,7 @@ $app = AppFactory::create(); 27 27 28 28 $container = $app->getContainer(); 29 29 $container->set('view', function (Container $container) { 30 - - return new Slim\Views\Blade(__DIR__ . '/views', GROCY_DATAPATH . '/viewcache'); 31 - + return new Slim\Views\Blade(__DIR__ . '/views', getenv('GROCY_CACHE_DIR')); 30 + - return new Blade(__DIR__ . '/views', GROCY_DATAPATH . '/viewcache'); 31 + + return new Blade(__DIR__ . '/views', getenv('GROCY_CACHE_DIR')); 32 32 }); 33 + 33 34 $container->set('UrlManager', function (Container $container) { 34 - return new UrlManager(GROCY_BASE_URL); 35 35 diff --git a/services/DatabaseService.php b/services/DatabaseService.php 36 - index d1080b0..8bc4ee1 100644 36 + index dfcd5d4b..bc8d1a1d 100644 37 37 --- a/services/DatabaseService.php 38 38 +++ b/services/DatabaseService.php 39 - @@ -105,6 +105,6 @@ class DatabaseService 39 + @@ -107,6 +107,6 @@ class DatabaseService 40 40 return GROCY_DATAPATH . '/grocy_' . $dbSuffix . '.db'; 41 41 } 42 42 ··· 45 45 } 46 46 } 47 47 diff --git a/services/FilesService.php b/services/FilesService.php 48 - index 8c1483e..8f74b4b 100644 48 + index 7d070350..fba2e923 100644 49 49 --- a/services/FilesService.php 50 50 +++ b/services/FilesService.php 51 - @@ -70,7 +70,7 @@ class FilesService extends BaseService 52 - { 53 - parent::__construct(); 51 + @@ -103,7 +103,7 @@ class FilesService extends BaseService 54 52 55 - - $this->StoragePath = GROCY_DATAPATH . '/storage'; 53 + public function GetFilePath($group, $fileName) 54 + { 55 + - $groupFolderPath = $this->StoragePath . '/' . $group; 56 56 + $this->StoragePath = getenv('GROCY_STORAGE_DIR'); 57 57 58 - if (!file_exists($this->StoragePath)) 58 + if (!file_exists($groupFolderPath)) 59 59 { 60 60 diff --git a/services/StockService.php b/services/StockService.php 61 - index 4741b4b..6d4e748 100644 61 + index f73ac5bd..6b6e693a 100644 62 62 --- a/services/StockService.php 63 63 +++ b/services/StockService.php 64 - @@ -1374,8 +1374,7 @@ class StockService extends BaseService 64 + @@ -1589,8 +1589,7 @@ class StockService extends BaseService 65 65 throw new \Exception('No barcode lookup plugin defined'); 66 66 } 67 67 ··· 72 72 { 73 73 require_once $path; 74 74 -- 75 - 2.29.2 75 + 2.31.1 76 76
+2 -2
pkgs/servers/grocy/default.nix
··· 2 2 3 3 stdenv.mkDerivation rec { 4 4 pname = "grocy"; 5 - version = "3.0.1"; 5 + version = "3.1.0"; 6 6 7 7 src = fetchurl { 8 8 url = "https://github.com/grocy/grocy/releases/download/v${version}/grocy_${version}.zip"; 9 - sha256 = "sha256-Yjxv0LcLNtpYs4ntBano9NUxwdWgF5etA/M6hUVzOa8="; 9 + sha256 = "sha256-ohviTI2np6z+SjV2CDScouI8Lh2Ru4+CE00KlgT40i8="; 10 10 }; 11 11 12 12 nativeBuildInputs = [ unzip ];