about summary refs log tree commit diff
path: root/pkgs/servers/grocy/0001-Define-configs-with-env-vars.patch
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/servers/grocy/0001-Define-configs-with-env-vars.patch')
-rw-r--r--pkgs/servers/grocy/0001-Define-configs-with-env-vars.patch29
1 files changed, 21 insertions, 8 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 8afef1211f80..75aa54f9c9c2 100644
--- a/pkgs/servers/grocy/0001-Define-configs-with-env-vars.patch
+++ b/pkgs/servers/grocy/0001-Define-configs-with-env-vars.patch
@@ -11,7 +11,7 @@ Subject: [PATCH 1/2] Define configs with env vars
  4 files changed, 6 insertions(+), 6 deletions(-)

 

 diff --git a/app.php b/app.php

-index bc5b1b39..26f7687e 100644

+index bc5b1b3..26f7687 100644

 --- a/app.php

 +++ b/app.php

 @@ -12,7 +12,7 @@ use Slim\Views\Blade;

@@ -41,11 +41,24 @@ index bc5b1b39..26f7687e 100644
  

  ob_clean(); // No response output before here

  $app->run();

+diff --git a/controllers/BaseApiController.php b/controllers/BaseApiController.php

+index 5941e348..e5b02af4 100644

+--- a/controllers/BaseApiController.php

++++ b/controllers/BaseApiController.php

+@@ -162,7 +162,7 @@ class BaseApiController extends BaseController

+ 		if (self::$htmlPurifierInstance == null)

+ 		{

+ 			$htmlPurifierConfig = \HTMLPurifier_Config::createDefault();

+-			$htmlPurifierConfig->set('Cache.SerializerPath', GROCY_DATAPATH . '/viewcache');

++			$htmlPurifierConfig->set('Cache.SerializerPath', getenv('GROCY_CACHE_DIR'));

+ 			$htmlPurifierConfig->set('HTML.Allowed', 'div,b,strong,i,em,u,a[href|title|target],iframe[src|width|height|frameborder],ul,ol,li,p[style],br,span[style],img[style|width|height|alt|src],table[border|width|style],tbody,tr,td,th,blockquote,*[style|class|id],h1,h2,h3,h4,h5,h6');

+ 			$htmlPurifierConfig->set('Attr.EnableID', true);

+ 			$htmlPurifierConfig->set('HTML.SafeIframe', true);

 diff --git a/services/DatabaseService.php b/services/DatabaseService.php

-index 4a05bda1..ce41ed17 100644

+index ba79a73..12a851a 100644

 --- a/services/DatabaseService.php

 +++ b/services/DatabaseService.php

-@@ -125,6 +125,6 @@ class DatabaseService

+@@ -137,6 +137,6 @@ class DatabaseService

  			return GROCY_DATAPATH . '/grocy_' . $dbSuffix . '.db';

  		}

  

@@ -54,7 +67,7 @@ index 4a05bda1..ce41ed17 100644
  	}

  }

 diff --git a/services/FilesService.php b/services/FilesService.php

-index 7d070350..a6dd4b08 100644

+index 7d07035..a6dd4b0 100644

 --- a/services/FilesService.php

 +++ b/services/FilesService.php

 @@ -10,7 +10,7 @@ class FilesService extends BaseService

@@ -67,18 +80,18 @@ index 7d070350..a6dd4b08 100644
  		{

  			mkdir($this->StoragePath);

 diff --git a/services/StockService.php b/services/StockService.php

-index 7265e82b..13af591a 100644

+index 9f034a5..fd3c0b7 100644

 --- a/services/StockService.php

 +++ b/services/StockService.php

-@@ -1761,7 +1761,7 @@ class StockService extends BaseService

+@@ -1707,7 +1707,7 @@ class StockService extends BaseService

  			throw new \Exception('No barcode lookup plugin defined');

  		}

  

 -		$path = GROCY_DATAPATH . "/plugins/$pluginName.php";

 +		$path = getenv('GROCY_PLUGIN_DIR') . "/$pluginName.php";

- 

  		if (file_exists($path))

  		{

+ 			require_once $path;

 -- 

-2.41.0

+2.42.0