mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-11 18:32:23 +08:00
nixos/freshrss: fix loading extensions' static content
Before this change, the THIRDPARTY_EXTENSIONS_PATH would end up with a
double-slash in the path, which was breaking FreshRSS's is_valid_path
detection.
(cherry picked from commit 637fc36529)
This commit is contained in:
committed by
Michael Daniels
parent
1c6aede85d
commit
4714abbe16
@@ -18,7 +18,7 @@ let
|
||||
DATA_PATH = cfg.dataDir;
|
||||
}
|
||||
// lib.optionalAttrs (cfg.extensions != [ ]) {
|
||||
THIRDPARTY_EXTENSIONS_PATH = "${extension-env}/share/freshrss/";
|
||||
THIRDPARTY_EXTENSIONS_PATH = "${extension-env}/share/freshrss";
|
||||
};
|
||||
in
|
||||
{
|
||||
|
||||
@@ -8,14 +8,30 @@
|
||||
enable = true;
|
||||
baseUrl = "http://localhost";
|
||||
authType = "none";
|
||||
extensions = [ pkgs.freshrss-extensions.youtube ];
|
||||
extensions = [
|
||||
pkgs.freshrss-extensions.youtube
|
||||
pkgs.freshrss-extensions.title-wrap
|
||||
];
|
||||
};
|
||||
};
|
||||
extraPythonPackages = p: [
|
||||
p.lxml
|
||||
p.lxml-stubs
|
||||
];
|
||||
skipTypeCheck = true;
|
||||
|
||||
testScript = ''
|
||||
machine.wait_for_unit("multi-user.target")
|
||||
machine.wait_for_open_port(80)
|
||||
response = machine.succeed("curl -vvv -s http://localhost:80/i/?c=extension")
|
||||
response = machine.succeed("curl -s http://localhost:80/i/?c=extension")
|
||||
assert '<span class="ext_name disabled">YouTube Video Feed</span>' in response, "Extension not present in extensions page."
|
||||
|
||||
# enable Title-Wrap extension
|
||||
from lxml import etree
|
||||
tree = etree.HTML(response)
|
||||
csrf = tree.xpath("/html/body/header/nav/form/input/@value")[0]
|
||||
response = machine.succeed(f"curl --fail-with-body -s 'http://localhost:80/i/?c=extension&a=enable&e=Title-Wrap' -d '_csrf={csrf}'")
|
||||
# verify that the Title-Wrap css is accessible.
|
||||
machine.succeed("curl --fail-with-body -s 'http://localhost:80/ext.php?1=&f=xExtension-TitleWrap/static/title_wrap.css'")
|
||||
'';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user