Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rss-bridge: 2022-06-14 -> 2023-03-22 #223066

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions pkgs/servers/web-apps/rss-bridge/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,18 @@

stdenv.mkDerivation rec {
pname = "rss-bridge";
version = "2022-06-14";
version = "2023-03-22";

src = fetchFromGitHub {
owner = "RSS-Bridge";
repo = "rss-bridge";
rev = version;
sha256 = "sha256-yH+m65CIZokZSbnv1zfpKC/Qr/mPPC6dG49Zn62X0l4=";
sha256 = "sha256-76XmPFb9w//GK9T4H41FxLBpWdTvJA28E0kWCCV/AFM=";
};

postPatch = ''
substituteInPlace lib/rssbridge.php \
--replace "define('PATH_CACHE', PATH_ROOT . 'cache/');" "define('PATH_CACHE', getenv('RSSBRIDGE_DATA') . '/cache/');" \
--replace "define('FILE_CONFIG', PATH_ROOT . 'config.ini.php');" "define('FILE_CONFIG', getenv('RSSBRIDGE_DATA') . '/config.ini.php');" \
--replace "define('WHITELIST', PATH_ROOT . 'whitelist.txt');" "define('WHITELIST', getenv('RSSBRIDGE_DATA') . '/whitelist.txt');"
'';
patches = [
./paths.patch
];

installPhase = ''
mkdir $out/
Expand Down
32 changes: 32 additions & 0 deletions pkgs/servers/web-apps/rss-bridge/paths.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
diff --git a/lib/RssBridge.php b/lib/RssBridge.php
index 62e8acc5..00eca8be 100644
--- a/lib/RssBridge.php
+++ b/lib/RssBridge.php
@@ -25,8 +25,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 8e5cf69c..7fece356 100644
--- a/lib/bootstrap.php
+++ b/lib/bootstrap.php
@@ -28,10 +28,10 @@ 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/');

/** Path to the whitelist file */
-const WHITELIST = __DIR__ . '/../whitelist.txt';
+define('WHITELIST', getenv('RSSBRIDGE_DATA') . '/whitelist.txt');

/** Path to the default whitelist file */
const WHITELIST_DEFAULT = __DIR__ . '/../whitelist.default.txt';