diff options
author | Andy Chun @noneucat <andy@lolc.at> | 2022-11-30 21:36:57 -0800 |
---|---|---|
committer | Andy Chun @noneucat <andy@lolc.at> | 2022-11-30 21:48:14 -0800 |
commit | 8fef1cc76639301df728271ba057cc14435998c7 (patch) | |
tree | a0405541e6dd967d8e2a7c9d5944d15054a0b63b /pkgs/servers/grocy | |
parent | 38e591dd05ffc8bdf79dc752ba78b05e370416fa (diff) |
nixos/grocy: set storage path correctly in patch
This commit restores the proper setting of `$this->StoragePath` using `GROCY_STORAGE_DIR` in `FilesService`. The previous iteration of this patch mistakenly patches out the setting of `$groupFolderPath` in the `GetFilePath` method, which the method subsequently tries to return. This causes `GetFilePath` to return, for example, `/file.png` (an incorrect root path) for files instead of `/var/lib/grocy/userpictures/file.png`.
Diffstat (limited to 'pkgs/servers/grocy')
-rw-r--r-- | pkgs/servers/grocy/0001-Define-configs-with-env-vars.patch | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/pkgs/servers/grocy/0001-Define-configs-with-env-vars.patch b/pkgs/servers/grocy/0001-Define-configs-with-env-vars.patch index 4e3d36c33c9f1..4429a804e80d7 100644 --- a/pkgs/servers/grocy/0001-Define-configs-with-env-vars.patch +++ b/pkgs/servers/grocy/0001-Define-configs-with-env-vars.patch @@ -1,4 +1,4 @@ -From 035709eeac697945a26276cc17b996c1a0678ddc Mon Sep 17 00:00:00 2001 +From 05b762c6ca58ecb5fd631a019fbda69b0647785f Mon Sep 17 00:00:00 2001 From: Maximilian Bosch <maximilian@mbosch.me> Date: Tue, 22 Dec 2020 15:38:56 +0100 Subject: [PATCH] Define configs with env vars @@ -33,10 +33,10 @@ index 17ba6a99..89f48089 100644 $container->set('UrlManager', function (Container $container) { diff --git a/services/DatabaseService.php b/services/DatabaseService.php -index dfcd5d4b..bc8d1a1d 100644 +index c093f361..0894791f 100644 --- a/services/DatabaseService.php +++ b/services/DatabaseService.php -@@ -107,6 +107,6 @@ class DatabaseService +@@ -114,6 +114,6 @@ class DatabaseService return GROCY_DATAPATH . '/grocy_' . $dbSuffix . '.db'; } @@ -45,23 +45,23 @@ index dfcd5d4b..bc8d1a1d 100644 } } diff --git a/services/FilesService.php b/services/FilesService.php -index 7d070350..fba2e923 100644 +index 7d070350..a6dd4b08 100644 --- a/services/FilesService.php +++ b/services/FilesService.php -@@ -103,7 +103,7 @@ class FilesService extends BaseService +@@ -10,7 +10,7 @@ class FilesService extends BaseService - public function GetFilePath($group, $fileName) + public function __construct() { -- $groupFolderPath = $this->StoragePath . '/' . $group; +- $this->StoragePath = GROCY_DATAPATH . '/storage'; + $this->StoragePath = getenv('GROCY_STORAGE_DIR'); - - if (!file_exists($groupFolderPath)) + if (!file_exists($this->StoragePath)) { + mkdir($this->StoragePath); diff --git a/services/StockService.php b/services/StockService.php -index f73ac5bd..6b6e693a 100644 +index 85f57803..15556112 100644 --- a/services/StockService.php +++ b/services/StockService.php -@@ -1589,8 +1589,7 @@ class StockService extends BaseService +@@ -1704,8 +1704,7 @@ class StockService extends BaseService throw new \Exception('No barcode lookup plugin defined'); } @@ -72,5 +72,5 @@ index f73ac5bd..6b6e693a 100644 { require_once $path; -- -2.31.1 +2.38.1 |