blob: cbb033df4162f203b86cf2f8013bd59c93d1792d (
plain)
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
|
{
name = "freshrss-extensions";
nodes.machine =
{ pkgs, ... }:
{
services.freshrss = {
enable = true;
baseUrl = "http://localhost";
authType = "none";
extensions = [
pkgs.freshrss-extensions.youtube
pkgs.freshrss-extensions.title-wrap
];
};
};
extraPythonPackages = p: [
p.lxml
p.types-lxml
];
testScript = ''
from lxml import etree
machine.wait_for_unit("multi-user.target")
machine.wait_for_open_port(80)
response = machine.succeed("curl --fail-with-body --silent 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
tree = etree.HTML(response)
csrf = tree.xpath("/html/body/header/nav/form/input/@value")[0]
machine.succeed(f"curl --fail-with-body --silent '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 --silent 'http://localhost:80/ext.php?1=&f=xExtension-TitleWrap/static/title_wrap.css'")
'';
}
|