From 999fa7eb675d50f1b1eb24a9f11f5669a6a0169f Mon Sep 17 00:00:00 2001 From: Hugo Renard Date: Fri, 10 Oct 2025 18:32:56 +0200 Subject: [PATCH] listmonk: 3.0.0 -> 5.1.0 --- nixos/tests/listmonk.nix | 8 ++------ pkgs/by-name/li/listmonk/frontend.nix | 2 +- pkgs/by-name/li/listmonk/package.nix | 7 ++++--- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/nixos/tests/listmonk.nix b/nixos/tests/listmonk.nix index 7535f07c44c9..7d4af8dce31b 100644 --- a/nixos/tests/listmonk.nix +++ b/nixos/tests/listmonk.nix @@ -10,10 +10,6 @@ import ./make-test-python.nix ( services.mailhog.enable = true; services.listmonk = { enable = true; - settings = { - admin_username = "listmonk"; - admin_password = "hunter2"; - }; database = { createLocally = true; # https://github.com/knadh/listmonk/blob/174a48f252a146d7e69dab42724e3329dbe25ebe/internal/messenger/email/email.go#L18-L27 @@ -34,11 +30,10 @@ import ./make-test-python.nix ( start_all() - basic_auth = "listmonk:hunter2" def generate_listmonk_request(type, url, data=None): if data is None: data = {} json_data = json.dumps(data) - return f'curl -u "{basic_auth}" -X {type} "http://localhost:9000/api/{url}" -H "Content-Type: application/json; charset=utf-8" --data-raw \'{json_data}\''' + return f'curl -j -b cookies.txt -X {type} "http://localhost:9000/api/{url}" -H "Content-Type: application/json; charset=utf-8" --data-raw \'{json_data}\''' machine.wait_for_unit("mailhog.service") machine.wait_for_unit("postgresql.target") @@ -47,6 +42,7 @@ import ./make-test-python.nix ( machine.wait_for_open_port(8025) machine.wait_for_open_port(9000) machine.succeed("[[ -f /var/lib/listmonk/.db_settings_initialized ]]") + machine.succeed('curl -c cookies.txt -X POST "http://localhost:9000/admin/login" --data email=listmonk@test.local --data username=listmonk --data password=hunter22 --data password2=hunter22') assert json.loads(machine.succeed(generate_listmonk_request("GET", 'health')))['data'], 'Health endpoint returned unexpected value' diff --git a/pkgs/by-name/li/listmonk/frontend.nix b/pkgs/by-name/li/listmonk/frontend.nix index 0162c2aa062a..bdfd81be7d64 100644 --- a/pkgs/by-name/li/listmonk/frontend.nix +++ b/pkgs/by-name/li/listmonk/frontend.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation (finalAttrs: { offlineCache = fetchYarnDeps { yarnLock = "${src}/frontend/yarn.lock"; - hash = "sha256-TdrglyRtb2Q8SFtoiCoDj/zBV2+7DwzIm/Fzlt0ZvSo="; + hash = "sha256-pOBW3E3Nw+4IEwnNxNjZ+QfR7IF9Zk6MxnD8pFzssro="; }; nativeBuildInputs = [ diff --git a/pkgs/by-name/li/listmonk/package.nix b/pkgs/by-name/li/listmonk/package.nix index 99f523b3b40c..d38bf8d2fbc8 100644 --- a/pkgs/by-name/li/listmonk/package.nix +++ b/pkgs/by-name/li/listmonk/package.nix @@ -11,16 +11,16 @@ buildGoModule (finalAttrs: { pname = "listmonk"; - version = "3.0.0"; + version = "5.1.0"; src = fetchFromGitHub { owner = "knadh"; repo = "listmonk"; rev = "v${finalAttrs.version}"; - hash = "sha256-eNX+2ens+mz2V8ZBHtFFHDVbi64AAiiREElMjh67Dd8="; + hash = "sha256-rb0/T7I6yLGJBXikOHuXwDdW20nFXpssXfgViHSIIOU="; }; - vendorHash = "sha256-XAm2VfX1nHWTuAV2COEn8qrqPNv0xbaWgTYCpjrEfMw="; + vendorHash = "sha256-bFUWjaaFHB2pnGHBsvUBS2icQkMrB/CfXFa+3vGFFvU="; nativeBuildInputs = [ stuffbin @@ -44,6 +44,7 @@ buildGoModule (finalAttrs: { "config.toml.sample" "schema.sql" "queries.sql" + "permissions.json" "static/public:/public" "static/email-templates" "${finalAttrs.passthru.frontend}:/admin"