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.

+19 -3
+1 -1
nixos/modules/services/web-apps/freshrss.nix
··· 18 18 DATA_PATH = cfg.dataDir; 19 19 } 20 20 // lib.optionalAttrs (cfg.extensions != [ ]) { 21 - THIRDPARTY_EXTENSIONS_PATH = "${extension-env}/share/freshrss/"; 21 + THIRDPARTY_EXTENSIONS_PATH = "${extension-env}/share/freshrss"; 22 22 }; 23 23 in 24 24 {
+18 -2
nixos/tests/freshrss/extensions.nix
··· 8 8 enable = true; 9 9 baseUrl = "http://localhost"; 10 10 authType = "none"; 11 - extensions = [ pkgs.freshrss-extensions.youtube ]; 11 + extensions = [ 12 + pkgs.freshrss-extensions.youtube 13 + pkgs.freshrss-extensions.title-wrap 14 + ]; 12 15 }; 13 16 }; 17 + extraPythonPackages = p: [ 18 + p.lxml 19 + p.lxml-stubs 20 + ]; 21 + skipTypeCheck = true; 14 22 15 23 testScript = '' 16 24 machine.wait_for_unit("multi-user.target") 17 25 machine.wait_for_open_port(80) 18 - response = machine.succeed("curl -vvv -s http://localhost:80/i/?c=extension") 26 + response = machine.succeed("curl -s http://localhost:80/i/?c=extension") 19 27 assert '<span class="ext_name disabled">YouTube Video Feed</span>' in response, "Extension not present in extensions page." 28 + 29 + # enable Title-Wrap extension 30 + from lxml import etree 31 + tree = etree.HTML(response) 32 + csrf = tree.xpath("/html/body/header/nav/form/input/@value")[0] 33 + response = machine.succeed(f"curl --fail-with-body -s 'http://localhost:80/i/?c=extension&a=enable&e=Title-Wrap' -d '_csrf={csrf}'") 34 + # verify that the Title-Wrap css is accessible. 35 + machine.succeed("curl --fail-with-body -s 'http://localhost:80/ext.php?1=&f=xExtension-TitleWrap/static/title_wrap.css'") 20 36 ''; 21 37 }