From 95469bd3e6d1ba088996a2aae89a490cfb963ff4 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Fri, 24 Nov 2023 02:50:49 +0100 Subject: [PATCH] miniflux: fix http user agent regression Miniflux in 2.0.5.0 introduced a regression in its HTTP client, where the global user-agent would fall back to that of the generic Go library it uses. This user agent is banned/rate-limited on many pages, which causes feed refreshes to be greeted by e.g. HTTP/403. --- pkgs/servers/miniflux/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/servers/miniflux/default.nix b/pkgs/servers/miniflux/default.nix index 88244b78e220..85038a616450 100644 --- a/pkgs/servers/miniflux/default.nix +++ b/pkgs/servers/miniflux/default.nix @@ -1,4 +1,4 @@ -{ lib, buildGo121Module, fetchFromGitHub, installShellFiles, nixosTests }: +{ lib, buildGo121Module, fetchFromGitHub, fetchpatch, installShellFiles, nixosTests }: let pname = "miniflux"; @@ -14,6 +14,15 @@ in buildGo121Module { sha256 = "sha256-+oNF/Zwc1Z/cu3SQC/ZTekAW5Qef9RKrdszunLomGII="; }; + patches = [ + (fetchpatch { + # https://github.com/miniflux/v2/pull/2193, remove after 2.0.50 + name = "miniflux-user-agent-regression.patch"; + url = "https://github.com/miniflux/v2/commit/7a03291442a4e35572c73a2fcfe809fa8e03063e.patch"; + hash = "sha256-tJ1l5rqD0x0xtQs+tDwpFHOY+7k6X02bkwVJo6RAdb8="; + }) + ]; + vendorHash = "sha256-jLyjQ+w/QS9uA0pGWF2X6dEfOifcI2gC2sgi1STEzpU="; nativeBuildInputs = [ installShellFiles ];