about summary refs log tree commit diff
path: root/nixpkgs/pkgs/servers/web-apps/rss-bridge/paths.patch
blob: b226676cb28a092b6a5bc9195edd0ad82571f8f0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
diff --git a/lib/Configuration.php b/lib/Configuration.php
index c38d7cc9..d95e5174 100644
--- a/lib/Configuration.php
+++ b/lib/Configuration.php
@@ -104,8 +104,8 @@ final class Configuration
             }
         }
 
-        if (file_exists(__DIR__ . '/../whitelist.txt')) {
-            $enabledBridges = trim(file_get_contents(__DIR__ . '/../whitelist.txt'));
+        if (file_exists(getenv('RSSBRIDGE_DATA') . '/whitelist.txt')) {
+            $enabledBridges = trim(file_get_contents(getenv('RSSBRIDGE_DATA') . '/whitelist.txt'));
             if ($enabledBridges === '*') {
                 self::setConfig('system', 'enabled_bridges', ['*']);
             } else {
diff --git a/lib/RssBridge.php b/lib/RssBridge.php
index 6ba952eb..a0bbaf03 100644
--- a/lib/RssBridge.php
+++ b/lib/RssBridge.php
@@ -11,8 +11,8 @@ final class RssBridge
         Configuration::verifyInstallation();
 
         $customConfig = [];
-        if (file_exists(__DIR__ . '/../config.ini.php')) {
-            $customConfig = parse_ini_file(__DIR__ . '/../config.ini.php', true, INI_SCANNER_TYPED);
+        if (file_exists(getenv('RSSBRIDGE_DATA') . '/config.ini.php')) {
+            $customConfig = parse_ini_file(getenv('RSSBRIDGE_DATA') . '/config.ini.php', true, INI_SCANNER_TYPED);
         }
         Configuration::loadConfiguration($customConfig, getenv());
 
diff --git a/lib/bootstrap.php b/lib/bootstrap.php
index dc1c0f04..194a3f8f 100644
--- a/lib/bootstrap.php
+++ b/lib/bootstrap.php
@@ -27,7 +27,7 @@ const PATH_LIB_CACHES = __DIR__ . '/../caches/';
 const PATH_LIB_ACTIONS = __DIR__ . '/../actions/';
 
 /** Path to the cache folder */
-const PATH_CACHE = __DIR__ . '/../cache/';
+define('PATH_CACHE', getenv('RSSBRIDGE_DATA') . '/cache/');
 
 /** URL to the RSS-Bridge repository */
 const REPOSITORY = 'https://github.com/RSS-Bridge/rss-bridge/';