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