From 3018beaac615590c2bdf077749413af2f8f38e31 Mon Sep 17 00:00:00 2001 From: gileri Date: Sat, 21 Dec 2024 17:10:43 +0100 Subject: [PATCH 1/6] tt-rss: Update license --- pkgs/by-name/tt/tt-rss/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/tt/tt-rss/package.nix b/pkgs/by-name/tt/tt-rss/package.nix index 105812d93537..716d0f4d3aa1 100644 --- a/pkgs/by-name/tt/tt-rss/package.nix +++ b/pkgs/by-name/tt/tt-rss/package.nix @@ -36,7 +36,7 @@ stdenv.mkDerivation rec { meta = with lib; { description = "Web-based news feed (RSS/Atom) aggregator"; - license = licenses.gpl2Plus; + license = licenses.gpl3Plus; homepage = "https://tt-rss.org"; maintainers = with maintainers; [ gileri From 2cc6ef5b2f4b9c28abf8335a86517146ccbb17d6 Mon Sep 17 00:00:00 2001 From: gileri Date: Sat, 21 Dec 2024 17:12:15 +0100 Subject: [PATCH 2/6] tt-rss: fix passthru.tests syntax --- pkgs/by-name/tt/tt-rss/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/tt/tt-rss/package.nix b/pkgs/by-name/tt/tt-rss/package.nix index 716d0f4d3aa1..619e5e97dbca 100644 --- a/pkgs/by-name/tt/tt-rss/package.nix +++ b/pkgs/by-name/tt/tt-rss/package.nix @@ -30,7 +30,7 @@ stdenv.mkDerivation rec { ''; passthru = { - inherit (nixosTests) tt-rss; + tests = { inherit (nixosTests) tt-rss; }; updateScript = unstableGitUpdater { hardcodeZeroVersion = true; }; }; From e09c54ce6b30f851c66890bcb3d29aa7014af82e Mon Sep 17 00:00:00 2001 From: gileri Date: Sun, 22 Dec 2024 15:46:58 +0100 Subject: [PATCH 3/6] tt-rss: More comprehensive test --- nixos/tests/web-apps/tt-rss.nix | 21 ++++++++++++++++++- .../tt/tt-rss-plugin-auth-ldap/package.nix | 5 +++++ .../tt/tt-rss-theme-feedly/package.nix | 5 +++++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/nixos/tests/web-apps/tt-rss.nix b/nixos/tests/web-apps/tt-rss.nix index 7bd4413d7286..af9753bd138e 100644 --- a/nixos/tests/web-apps/tt-rss.nix +++ b/nixos/tests/web-apps/tt-rss.nix @@ -10,13 +10,32 @@ import ../make-test-python.nix ( enable = true; virtualHost = "localhost"; selfUrlPath = "http://localhost/"; + pluginPackages = with pkgs; [ + tt-rss-plugin-auth-ldap + ]; singleUserMode = true; + themePackages = with pkgs; [ tt-rss-theme-feedly ]; }; }; testScript = '' + import json + import re machine.wait_for_unit("tt-rss.service") - machine.succeed("curl -sSfL http://localhost/ | grep 'Tiny Tiny RSS'") + + matches = re.search('__csrf_token = "([^"]*)"', machine.succeed("curl -sSfL --cookie cjar --cookie-jar cjar -sSfL http://localhost/")) + if matches is None: + assert False, "CSRF token not found" + csrf_token = matches.group(1) + + # Ensure themes are loaded. No API found for these, so it's a crude check. + preference_page = machine.succeed("curl -sSfL --cookie cjar --cookie-jar cjar http://localhost/backend.php?op=Pref_Prefs") + assert "feedly" in preference_page + + plugins = json.loads(machine.succeed(f"curl -sSfL --cookie cjar --cookie-jar cjar 'http://localhost/backend.php' -X POST --data-raw 'op=Pref_Prefs&method=getPluginsList&csrf_token={csrf_token}'"))["plugins"] + expected_plugins = ["auth_ldap"]; + found_plugins = [p["name"] for p in plugins if p["name"] in expected_plugins] + assert len(found_plugins) == len(expected_plugins), f"Expected plugins {expected_plugins}, found {found_plugins}" ''; } ) diff --git a/pkgs/by-name/tt/tt-rss-plugin-auth-ldap/package.nix b/pkgs/by-name/tt/tt-rss-plugin-auth-ldap/package.nix index c3d7f206e5b3..713fd3978416 100644 --- a/pkgs/by-name/tt/tt-rss-plugin-auth-ldap/package.nix +++ b/pkgs/by-name/tt/tt-rss-plugin-auth-ldap/package.nix @@ -1,5 +1,6 @@ { lib, + nixosTests, stdenv, fetchFromGitHub, }: @@ -19,6 +20,10 @@ stdenv.mkDerivation { install -D plugins/auth_ldap/init.php $out/auth_ldap/init.php ''; + passthru = { + tests = { inherit (nixosTests) tt-rss; }; + }; + meta = with lib; { description = "Plugin for TT-RSS to authenticate users via ldap"; license = licenses.asl20; diff --git a/pkgs/by-name/tt/tt-rss-theme-feedly/package.nix b/pkgs/by-name/tt/tt-rss-theme-feedly/package.nix index 18e14aae380d..b211d25c17a5 100644 --- a/pkgs/by-name/tt/tt-rss-theme-feedly/package.nix +++ b/pkgs/by-name/tt/tt-rss-theme-feedly/package.nix @@ -1,5 +1,6 @@ { lib, + nixosTests, stdenv, fetchFromGitHub, }: @@ -23,6 +24,10 @@ stdenv.mkDerivation rec { cp -ra feedly *.css $out ''; + passthru = { + tests = { inherit (nixosTests) tt-rss; }; + }; + meta = with lib; { description = "Feedly theme for Tiny Tiny RSS"; license = licenses.mit; From 28e64a092be2e4e97951f8ecbf8953f0acc04538 Mon Sep 17 00:00:00 2001 From: gileri Date: Mon, 23 Dec 2024 12:27:53 +0100 Subject: [PATCH 4/6] tt-rss-plugin-ff-instagram: Mark as broken --- pkgs/by-name/tt/tt-rss-plugin-ff-instagram/package.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/by-name/tt/tt-rss-plugin-ff-instagram/package.nix b/pkgs/by-name/tt/tt-rss-plugin-ff-instagram/package.nix index 8cbfb42618bf..0593d8c80f1f 100644 --- a/pkgs/by-name/tt/tt-rss-plugin-ff-instagram/package.nix +++ b/pkgs/by-name/tt/tt-rss-plugin-ff-instagram/package.nix @@ -23,6 +23,7 @@ stdenv.mkDerivation { ''; meta = with lib; { + broken = true; # Plugin code does not conform to plugin API changes. See https://github.com/wltb/ff_instagram/issues/13 description = "Plugin for Tiny Tiny RSS that allows to fetch posts from Instagram user sites"; longDescription = '' Plugin for Tiny Tiny RSS that allows to fetch posts from Instagram user sites. From 57fb17649b22bf6e39d15dcc9d8a8e809fe1f3cc Mon Sep 17 00:00:00 2001 From: gileri Date: Wed, 29 Jan 2025 00:03:10 +0100 Subject: [PATCH 5/6] tt-rss: Add feediron to tests --- nixos/tests/web-apps/tt-rss.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nixos/tests/web-apps/tt-rss.nix b/nixos/tests/web-apps/tt-rss.nix index af9753bd138e..1dc2daf535d7 100644 --- a/nixos/tests/web-apps/tt-rss.nix +++ b/nixos/tests/web-apps/tt-rss.nix @@ -12,6 +12,12 @@ import ../make-test-python.nix ( selfUrlPath = "http://localhost/"; pluginPackages = with pkgs; [ tt-rss-plugin-auth-ldap + tt-rss-plugin-feediron + ]; + plugins = [ + "auth_internal" + "feediron" + "note" ]; singleUserMode = true; themePackages = with pkgs; [ tt-rss-theme-feedly ]; @@ -33,7 +39,7 @@ import ../make-test-python.nix ( assert "feedly" in preference_page plugins = json.loads(machine.succeed(f"curl -sSfL --cookie cjar --cookie-jar cjar 'http://localhost/backend.php' -X POST --data-raw 'op=Pref_Prefs&method=getPluginsList&csrf_token={csrf_token}'"))["plugins"] - expected_plugins = ["auth_ldap"]; + expected_plugins = ["auth_internal", "auth_ldap", "feediron", "note"]; found_plugins = [p["name"] for p in plugins if p["name"] in expected_plugins] assert len(found_plugins) == len(expected_plugins), f"Expected plugins {expected_plugins}, found {found_plugins}" ''; From d3ac26dcd183fe42cc3e8b2baa935dc52f0923ec Mon Sep 17 00:00:00 2001 From: gileri Date: Thu, 27 Mar 2025 22:12:06 +0100 Subject: [PATCH 6/6] tt-rss: Disable auto-update on each upstream commit --- pkgs/by-name/tt/tt-rss/package.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/by-name/tt/tt-rss/package.nix b/pkgs/by-name/tt/tt-rss/package.nix index 619e5e97dbca..f6f7fc2cf831 100644 --- a/pkgs/by-name/tt/tt-rss/package.nix +++ b/pkgs/by-name/tt/tt-rss/package.nix @@ -1,3 +1,4 @@ +# nixpkgs-update: no auto update { lib, stdenv,