@@ -11,7 +11,7 @@ Subject: [PATCH 1/2] Define configs with env vars
11
11
4 files changed, 6 insertions(+), 6 deletions(-)
12
12
13
13
diff --git a/app.php b/app.php
14
- index bc5b1b39..26f7687e 100644
14
+ index bc5b1b3..26f7687 100644
15
15
--- a/app.php
16
16
+++ b/app.php
17
17
@@ -12,7 +12,7 @@ use Slim\Views\Blade;
@@ -41,11 +41,24 @@ index bc5b1b39..26f7687e 100644
41
41
42
42
ob_clean(); // No response output before here
43
43
$app->run();
44
+ diff --git a/controllers/BaseApiController.php b/controllers/BaseApiController.php
45
+ index 5941e348..e5b02af4 100644
46
+ --- a/controllers/BaseApiController.php
47
+ +++ b/controllers/BaseApiController.php
48
+ @@ -162,7 +162,7 @@ class BaseApiController extends BaseController
49
+ if (self::$htmlPurifierInstance == null)
50
+ {
51
+ $htmlPurifierConfig = \HTMLPurifier_Config::createDefault();
52
+ - $htmlPurifierConfig->set('Cache.SerializerPath', GROCY_DATAPATH . '/viewcache');
53
+ + $htmlPurifierConfig->set('Cache.SerializerPath', getenv('GROCY_CACHE_DIR'));
54
+ $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');
55
+ $htmlPurifierConfig->set('Attr.EnableID', true);
56
+ $htmlPurifierConfig->set('HTML.SafeIframe', true);
44
57
diff --git a/services/DatabaseService.php b/services/DatabaseService.php
45
- index 4a05bda1..ce41ed17 100644
58
+ index ba79a73..12a851a 100644
46
59
--- a/services/DatabaseService.php
47
60
+++ b/services/DatabaseService.php
48
- @@ -125 ,6 +125 ,6 @@ class DatabaseService
61
+ @@ -137 ,6 +137 ,6 @@ class DatabaseService
49
62
return GROCY_DATAPATH . '/grocy_' . $dbSuffix . '.db';
50
63
}
51
64
@@ -54,7 +67,7 @@ index 4a05bda1..ce41ed17 100644
54
67
}
55
68
}
56
69
diff --git a/services/FilesService.php b/services/FilesService.php
57
- index 7d070350..a6dd4b08 100644
70
+ index 7d07035..a6dd4b0 100644
58
71
--- a/services/FilesService.php
59
72
+++ b/services/FilesService.php
60
73
@@ -10,7 +10,7 @@ class FilesService extends BaseService
@@ -67,18 +80,18 @@ index 7d070350..a6dd4b08 100644
67
80
{
68
81
mkdir($this->StoragePath);
69
82
diff --git a/services/StockService.php b/services/StockService.php
70
- index 7265e82b..13af591a 100644
83
+ index 9f034a5..fd3c0b7 100644
71
84
--- a/services/StockService.php
72
85
+++ b/services/StockService.php
73
- @@ -1761 ,7 +1761 ,7 @@ class StockService extends BaseService
86
+ @@ -1707 ,7 +1707 ,7 @@ class StockService extends BaseService
74
87
throw new \Exception('No barcode lookup plugin defined');
75
88
}
76
89
77
90
- $path = GROCY_DATAPATH . "/plugins/$pluginName.php";
78
91
+ $path = getenv('GROCY_PLUGIN_DIR') . "/$pluginName.php";
79
-
80
92
if (file_exists($path))
81
93
{
94
+ require_once $path;
82
95
- -
83
- 2.41 .0
96
+ 2.42 .0
84
97
0 commit comments