Change:
Grocy does not properly save manuals for equipment The issue appears to be introduced by in a patch applied by nixpkgs. Changing that hunk to: Fixes the issue. I'm not currently setup for making a PR, I'm a bit busy, but I wanted an issue for other people to find if they run into the problem. grocy in nixos configuration (admin/admin is default) a new piece of equipment and attach a PDF manual to it to download manual; it will fail system: host os: multi-user?: sandbox: version: channels(aidenn): channels(root): nixpkgs:
appears to be the maintainer.
I marked this as stale due to inactivity. &rarr;

Discussion:
}; testScript = '' <ins> from base64 import b64encode from urllib.parse import quote </ins> machine.start() machine.wait_for_open_port(80) machine.wait_for_unit("multi-user.target")

machine.succeed("curl -sSI http://localhost/api/tasks 2>&1 | grep '401 Unauthorized'") <ins> file_name = "test.txt" file_name_base64 = b64encode(file_name.encode('ascii')).decode('ascii') file_name_base64_urlencode = quote(file_name_base64) machine.succeed( f"echo Sample equipment manual > /tmp/{file_name}" ) machine.succeed( f"curl -sSf -X 'PUT' -b 'grocy_session={cookie}' " + f" 'http://localhost/api/files/equipmentmanuals/{file_name_base64_urlencode}' " + "  --header 'Accept: */*' " + "  --header 'Content-Type: application/octet-stream' " + f" --data-binary '@/tmp/{file_name}' " ) machine.succeed( f"curl -sSf -X 'GET' -b 'grocy_session={cookie}' " + f" 'http://localhost/api/files/equipmentmanuals/{file_name_base64_urlencode}' " + "  --header 'Accept: application/octet-stream' " + f" | cmp /tmp/{file_name}" ) </ins> machine.shutdown() ''; })

<del> From 035709eeac697945a26276cc17b996c1a0678ddc Mon Sep 17 00:00:00 2001 </del> <ins> From 05b762c6ca58ecb5fd631a019fbda69b0647785f Mon Sep 17 00:00:00 2001 </ins> From: Maximilian Bosch <maximilian@mbosch.me> Date: Tue, 22 Dec 2020 15:38:56 +0100 Subject: [PATCH] Define configs with env vars

$container->set('UrlManager', function (Container $container) { diff --git a/services/DatabaseService.php b/services/DatabaseService.php <del> index dfcd5d4b..bc8d1a1d 100644 </del> <ins> index c093f361..0894791f 100644 </ins> --- a/services/DatabaseService.php +++ b/services/DatabaseService.php <del> @@ -107,6 +107,6 @@ class DatabaseService </del> <ins> @@ -114,6 +114,6 @@ class DatabaseService </ins> return GROCY_DATAPATH . '/grocy_' . $dbSuffix . '.db'; }

} } diff --git a/services/FilesService.php b/services/FilesService.php <del> index 7d070350..fba2e923 100644 </del> <ins> index 7d070350..a6dd4b08 100644 </ins> --- a/services/FilesService.php +++ b/services/FilesService.php <del> @@ -103,7 +103,7 @@ class FilesService extends BaseService </del> <ins> @@ -10,7 +10,7 @@ class FilesService extends BaseService </ins> <del> public function GetFilePath($group, $fileName) </del> <ins> public function __construct() </ins> { <del> -		$groupFolderPath = $this->StoragePath . '/' . $group; </del> <ins> -		$this->StoragePath = GROCY_DATAPATH . '/storage'; </ins> +		$this->StoragePath = getenv('GROCY_STORAGE_DIR'); <del> if (!file_exists($groupFolderPath)) </del> <ins> if (!file_exists($this->StoragePath)) </ins> { <ins> mkdir($this->StoragePath); </ins> diff --git a/services/StockService.php b/services/StockService.php <del> index f73ac5bd..6b6e693a 100644 </del> <ins> index 85f57803..15556112 100644 </ins> --- a/services/StockService.php +++ b/services/StockService.php <del> @@ -1589,8 +1589,7 @@ class StockService extends BaseService </del> <ins> @@ -1704,8 +1704,7 @@ class StockService extends BaseService </ins> throw new Exception('No barcode lookup plugin defined'); }

{ require_once $path; -- <del> 2.31.1 </del> <ins> 2.38.1 </ins>