nixos/freshrss: improve + nixosTests.freshrss: improve (#474594)
This commit is contained in:
@@ -357,15 +357,15 @@ in
|
||||
|
||||
script =
|
||||
let
|
||||
isUserAuth = cfg.authType == "form" || cfg.authType == "none";
|
||||
|
||||
userScriptArgs = ''--user ${cfg.defaultUser} ${
|
||||
optionalString (cfg.authType == "form") ''--password "$(cat ${cfg.passwordFile})"''
|
||||
}'';
|
||||
updateUserScript = optionalString (cfg.authType == "form" || cfg.authType == "none") ''
|
||||
./cli/update-user.php ${userScriptArgs}
|
||||
'';
|
||||
createUserScript = optionalString (cfg.authType == "form" || cfg.authType == "none") ''
|
||||
./cli/create-user.php ${userScriptArgs}
|
||||
'';
|
||||
mkUserScript = name: optionalString isUserAuth ''./cli/${name}.php ${userScriptArgs}'';
|
||||
|
||||
updateUserScript = mkUserScript "update-user";
|
||||
createUserScript = mkUserScript "create-user";
|
||||
in
|
||||
''
|
||||
# do installation or reconfigure
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
testScript = ''
|
||||
machine.wait_for_unit("multi-user.target")
|
||||
machine.wait_for_open_port(80)
|
||||
response = machine.succeed("curl -vvv -s -H 'Host: freshrss' http://localhost:80/i/")
|
||||
response = machine.succeed("curl --fail-with-body --silent --header 'Host: freshrss' http://localhost:80/i/")
|
||||
assert '<title>Login · FreshRSS</title>' in response, "Login page didn't load successfully"
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -20,17 +20,18 @@
|
||||
];
|
||||
|
||||
testScript = ''
|
||||
from lxml import etree
|
||||
|
||||
machine.wait_for_unit("multi-user.target")
|
||||
machine.wait_for_open_port(80)
|
||||
response = machine.succeed("curl -s http://localhost:80/i/?c=extension")
|
||||
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
|
||||
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}'")
|
||||
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 -s 'http://localhost:80/ext.php?1=&f=xExtension-TitleWrap/static/title_wrap.css'")
|
||||
machine.succeed("curl --fail-with-body --silent 'http://localhost:80/ext.php?1=&f=xExtension-TitleWrap/static/title_wrap.css'")
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
testScript = ''
|
||||
machine.wait_for_unit("multi-user.target")
|
||||
machine.wait_for_open_port(80)
|
||||
response = machine.succeed("curl -vvv -s -H 'Host: freshrss' -H 'Remote-User: testuser' http://localhost:80/i/")
|
||||
response = machine.succeed("curl --fail-with-body --silent -H 'Remote-User: testuser' http://localhost:80/i/")
|
||||
assert 'Account: testuser' in response, "http_auth method didn't work."
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
testScript = ''
|
||||
machine.wait_for_unit("multi-user.target")
|
||||
machine.wait_for_open_port(80)
|
||||
response = machine.succeed("curl -vvv -s -H 'Host: freshrss' http://localhost:80/i/")
|
||||
response = machine.succeed("curl --fail-with-body --silent http://localhost:80/i/")
|
||||
assert '<title>Login · FreshRSS</title>' in response, "Login page didn't load successfully"
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
testScript = ''
|
||||
machine.wait_for_unit("multi-user.target")
|
||||
machine.wait_for_open_port(80)
|
||||
response = machine.succeed("curl -vvv -s http://localhost:80/i/")
|
||||
response = machine.succeed("curl --fail-with-body --silent http://localhost:80/i/")
|
||||
assert '<title> · FreshRSS</title>' in response, "FreshRSS stream page didn't load successfully"
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
machine.wait_for_unit("multi-user.target")
|
||||
machine.wait_for_open_port(5432)
|
||||
machine.wait_for_open_port(80)
|
||||
response = machine.succeed("curl -vvv -s -H 'Host: freshrss' http://localhost:80/i/")
|
||||
response = machine.succeed("curl --fail-with-body --silent http://localhost:80/i/")
|
||||
assert '<title>Login · FreshRSS</title>' in response, "Login page didn't load successfully"
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
let
|
||||
buildFreshRssExtension = (callPackage ./freshrss-utils.nix { }).buildFreshRssExtension;
|
||||
|
||||
official_extensions_version = "unstable-2024-04-27";
|
||||
official_extensions_version = "unstable-2025-12-26";
|
||||
official_extensions_src = fetchFromGitHub {
|
||||
owner = "FreshRSS";
|
||||
repo = "Extensions";
|
||||
rev = "71de129744ba37fd4cf363b78445f5345bc6d0b7";
|
||||
hash = "sha256-A+hOjbGNfhwTOAMeo08MUdqfWxxetzLz865oQQDsQlg=";
|
||||
rev = "42c32bfd9af2d816933cf310e24d25888a8e167d";
|
||||
hash = "sha256-El488QK3xWQM01GsuyBizud6VghXsRDqiOblnMfjVxE=";
|
||||
};
|
||||
|
||||
baseExtensions =
|
||||
@@ -107,6 +107,20 @@ let
|
||||
};
|
||||
};
|
||||
|
||||
unsafe-auto-login = buildFreshRssExtension {
|
||||
FreshRssExtUniqueId = "UnsafeAutologin";
|
||||
pname = "unsafe-auto-login";
|
||||
version = official_extensions_version;
|
||||
src = official_extensions_src;
|
||||
sourceRoot = "${official_extensions_src.name}/xExtension-UnsafeAutologin";
|
||||
meta = {
|
||||
description = "FreshRSS extension to bring back unsafe autologin functionality.";
|
||||
homepage = "https://github.com/FreshRSS/Extensions/tree/master/xExtension-UnsafeAutologin";
|
||||
license = lib.licenses.agpl3Only;
|
||||
maintainers = [ lib.maintainers.stunkymonkey ];
|
||||
};
|
||||
};
|
||||
|
||||
youtube = buildFreshRssExtension {
|
||||
FreshRssExtUniqueId = "YouTube";
|
||||
pname = "youtube";
|
||||
|
||||
Reference in New Issue
Block a user