Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport release-24.11] Update TT-RSS, add simple test and updater flag customization #366774

Merged
merged 5 commits into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion nixos/modules/services/web-apps/tt-rss.nix
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,17 @@ let
'';
};

updateDaemon = {
commandFlags = mkOption {
type = types.str;
default = "--quiet";
description = ''
Command-line flags passed to the update daemon.
The default --quiet flag mutes all logging, including errors.
'';
};
};

extraConfig = mkOption {
type = types.lines;
default = "";
Expand Down Expand Up @@ -622,7 +633,7 @@ let
serviceConfig = {
User = "${cfg.user}";
Group = "tt_rss";
ExecStart = "${phpPackage}/bin/php ${cfg.root}/www/update.php --daemon --quiet";
ExecStart = "${phpPackage}/bin/php ${cfg.root}/www/update.php --daemon ${cfg.updateDaemon.commandFlags}";
Restart = "on-failure";
RestartSec = "60";
SyslogIdentifier = "tt-rss";
Expand Down
1 change: 1 addition & 0 deletions nixos/tests/all-tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1062,6 +1062,7 @@ in {
trilium-server = handleTestOn ["x86_64-linux"] ./trilium-server.nix {};
tsm-client-gui = handleTest ./tsm-client-gui.nix {};
ttyd = handleTest ./web-servers/ttyd.nix {};
tt-rss = handleTest ./web-apps/tt-rss.nix {};
txredisapi = handleTest ./txredisapi.nix {};
tuptime = handleTest ./tuptime.nix {};
turbovnc-headless-server = handleTest ./turbovnc-headless-server.nix {};
Expand Down
22 changes: 22 additions & 0 deletions nixos/tests/web-apps/tt-rss.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import ../make-test-python.nix (
{ ... }:
{
name = "tt-rss-nixos";

nodes.machine =
{ pkgs, ... }:
{
services.tt-rss = {
enable = true;
virtualHost = "localhost";
selfUrlPath = "http://localhost/";
singleUserMode = true;
};
};

testScript = ''
machine.wait_for_unit("tt-rss.service")
machine.succeed("curl -sSfL http://localhost/ | grep 'Tiny Tiny RSS'")
'';
}
)
27 changes: 21 additions & 6 deletions pkgs/servers/tt-rss/default.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
{ lib, stdenv, fetchgit }:
{
lib,
stdenv,
fetchgit,
nixosTests,
unstableGitUpdater,
}:

stdenv.mkDerivation rec {
pname = "tt-rss";
version = "unstable-2023-04-13";
version = "0-unstable-2024-11-04";

src = fetchgit {
url = "https://git.tt-rss.org/fox/tt-rss.git";
rev = "0578bf802571781a0a7e3debbbec66437a7d28b4";
hash = "sha256-j6R1QoH8SzUtyI3rGE6rHriboAfApAo/Guw8WbJ7LqU=";
rev = "42ebdb027ec249fb8e693c41d7ee80ecdc68d6ec";
hash = "sha256-QN7CwUufQSFlFde0NebO/kOYtEZCyL0ut+CNEpJMIMA=";
};

installPhase = ''
Expand All @@ -18,16 +24,25 @@ stdenv.mkDerivation rec {

# see the code of Config::get_version(). you can check that the version in
# the footer of the preferences pages is not UNKNOWN
echo "23.04" > $out/version_static.txt
echo "${version}" > $out/version_static.txt

runHook postInstall
'';

passthru = {
inherit (nixosTests) tt-rss;
updateScript = unstableGitUpdater { hardcodeZeroVersion = true; };
};

meta = with lib; {
description = "Web-based news feed (RSS/Atom) aggregator";
license = licenses.gpl2Plus;
homepage = "https://tt-rss.org";
maintainers = with maintainers; [ globin zohl ];
maintainers = with maintainers; [
gileri
globin
zohl
];
platforms = platforms.all;
};
}
Loading