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.
This commit is contained in:
parent
0cdc40cf84
commit
637fc36529
@ -18,7 +18,7 @@ let
|
|||||||
DATA_PATH = cfg.dataDir;
|
DATA_PATH = cfg.dataDir;
|
||||||
}
|
}
|
||||||
// lib.optionalAttrs (cfg.extensions != [ ]) {
|
// lib.optionalAttrs (cfg.extensions != [ ]) {
|
||||||
THIRDPARTY_EXTENSIONS_PATH = "${extension-env}/share/freshrss/";
|
THIRDPARTY_EXTENSIONS_PATH = "${extension-env}/share/freshrss";
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|||||||
@ -8,14 +8,30 @@
|
|||||||
enable = true;
|
enable = true;
|
||||||
baseUrl = "http://localhost";
|
baseUrl = "http://localhost";
|
||||||
authType = "none";
|
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 = ''
|
testScript = ''
|
||||||
machine.wait_for_unit("multi-user.target")
|
machine.wait_for_unit("multi-user.target")
|
||||||
machine.wait_for_open_port(80)
|
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."
|
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'")
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user