diff options
author | Felix Bühler <Stunkymonkey@users.noreply.github.com> | 2024-04-17 21:46:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-17 21:46:52 +0200 |
commit | 671372c8ed0e0a12e1de3e2e93abd19cd1d6c631 (patch) | |
tree | f5534749a85d8c3c5f50d2b9abdf293f6a1c14d8 | |
parent | dd1ddc55baaaf0f315a41ef4aa2599537ac3929a (diff) | |
parent | 90e673b1b8e32cd66c7311cb9036a2d2cf32ee4a (diff) |
Merge pull request #304052 from mattchrist/freshrss-authtype-none
nixos/freshrss: fix startup when authType = "none"
-rw-r--r-- | nixos/modules/services/web-apps/freshrss.nix | 6 | ||||
-rw-r--r-- | nixos/tests/all-tests.nix | 1 | ||||
-rw-r--r-- | nixos/tests/freshrss-none-auth.nix | 19 | ||||
-rw-r--r-- | pkgs/servers/web-apps/freshrss/default.nix | 2 |
4 files changed, 24 insertions, 4 deletions
diff --git a/nixos/modules/services/web-apps/freshrss.nix b/nixos/modules/services/web-apps/freshrss.nix index 016c4202e4b3..77c5ecb24617 100644 --- a/nixos/modules/services/web-apps/freshrss.nix +++ b/nixos/modules/services/web-apps/freshrss.nix @@ -268,11 +268,11 @@ in script = let - userScriptArgs = ''--user ${cfg.defaultUser} --password "$(cat ${cfg.passwordFile})"''; - updateUserScript = optionalString (cfg.authType == "form") '' + 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") '' + createUserScript = optionalString (cfg.authType == "form" || cfg.authType == "none") '' ./cli/create-user.php ${userScriptArgs} ''; in diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index a99fedaddd76..a2011bc836e8 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -330,6 +330,7 @@ in { freshrss-sqlite = handleTest ./freshrss-sqlite.nix {}; freshrss-pgsql = handleTest ./freshrss-pgsql.nix {}; freshrss-http-auth = handleTest ./freshrss-http-auth.nix {}; + freshrss-none-auth = handleTest ./freshrss-none-auth.nix {}; frigate = handleTest ./frigate.nix {}; frp = handleTest ./frp.nix {}; frr = handleTest ./frr.nix {}; diff --git a/nixos/tests/freshrss-none-auth.nix b/nixos/tests/freshrss-none-auth.nix new file mode 100644 index 000000000000..fd63470386a0 --- /dev/null +++ b/nixos/tests/freshrss-none-auth.nix @@ -0,0 +1,19 @@ +import ./make-test-python.nix ({ lib, pkgs, ... }: { + name = "freshrss"; + meta.maintainers = with lib.maintainers; [ mattchrist ]; + + nodes.machine = { pkgs, ... }: { + services.freshrss = { + enable = true; + baseUrl = "http://localhost"; + authType = "none"; + }; + }; + + testScript = '' + machine.wait_for_unit("multi-user.target") + machine.wait_for_open_port(80) + response = machine.succeed("curl -vvv -s http://127.0.0.1:80/i/") + assert '<title>Main stream · FreshRSS</title>' in response, "FreshRSS stream page didn't load successfully" + ''; +}) diff --git a/pkgs/servers/web-apps/freshrss/default.nix b/pkgs/servers/web-apps/freshrss/default.nix index 639a9a780c62..9cf085f8c2b0 100644 --- a/pkgs/servers/web-apps/freshrss/default.nix +++ b/pkgs/servers/web-apps/freshrss/default.nix @@ -17,7 +17,7 @@ stdenvNoCC.mkDerivation rec { }; passthru.tests = { - inherit (nixosTests) freshrss-sqlite freshrss-pgsql freshrss-http-auth; + inherit (nixosTests) freshrss-sqlite freshrss-pgsql freshrss-http-auth freshrss-none-auth; }; buildInputs = [ php ]; |