2021-07-14 22:03:04 +00:00
|
|
|
import ./make-test-python.nix ({ pkgs, lib, ... }: {
|
|
|
|
name = "vikunja";
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
meta.maintainers = with lib.maintainers; [ leona ];
|
2021-07-14 22:03:04 +00:00
|
|
|
|
|
|
|
nodes = {
|
|
|
|
vikunjaSqlite = { ... }: {
|
|
|
|
services.vikunja = {
|
|
|
|
enable = true;
|
|
|
|
database = {
|
|
|
|
type = "sqlite";
|
|
|
|
};
|
|
|
|
frontendScheme = "http";
|
|
|
|
frontendHostname = "localhost";
|
|
|
|
};
|
|
|
|
services.nginx.enable = true;
|
|
|
|
};
|
|
|
|
vikunjaPostgresql = { pkgs, ... }: {
|
|
|
|
services.vikunja = {
|
|
|
|
enable = true;
|
|
|
|
database = {
|
|
|
|
type = "postgres";
|
|
|
|
user = "vikunja-api";
|
|
|
|
database = "vikunja-api";
|
|
|
|
host = "/run/postgresql";
|
|
|
|
};
|
|
|
|
frontendScheme = "http";
|
|
|
|
frontendHostname = "localhost";
|
2023-05-24 13:37:59 +00:00
|
|
|
port = 9090;
|
2021-07-14 22:03:04 +00:00
|
|
|
};
|
|
|
|
services.postgresql = {
|
|
|
|
enable = true;
|
|
|
|
ensureDatabases = [ "vikunja-api" ];
|
|
|
|
ensureUsers = [
|
|
|
|
{ name = "vikunja-api";
|
2024-01-02 11:29:13 +00:00
|
|
|
ensureDBOwnership = true;
|
2021-07-14 22:03:04 +00:00
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
services.nginx.enable = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
testScript =
|
|
|
|
''
|
|
|
|
vikunjaSqlite.wait_for_unit("vikunja-api.service")
|
|
|
|
vikunjaSqlite.wait_for_open_port(3456)
|
|
|
|
vikunjaSqlite.succeed("curl --fail http://localhost:3456/api/v1/info")
|
|
|
|
|
|
|
|
vikunjaSqlite.wait_for_unit("nginx.service")
|
|
|
|
vikunjaSqlite.wait_for_open_port(80)
|
|
|
|
vikunjaSqlite.succeed("curl --fail http://localhost/api/v1/info")
|
|
|
|
vikunjaSqlite.succeed("curl --fail http://localhost")
|
|
|
|
|
|
|
|
vikunjaPostgresql.wait_for_unit("vikunja-api.service")
|
2023-05-24 13:37:59 +00:00
|
|
|
vikunjaPostgresql.wait_for_open_port(9090)
|
|
|
|
vikunjaPostgresql.succeed("curl --fail http://localhost:9090/api/v1/info")
|
2021-07-14 22:03:04 +00:00
|
|
|
|
|
|
|
vikunjaPostgresql.wait_for_unit("nginx.service")
|
|
|
|
vikunjaPostgresql.wait_for_open_port(80)
|
|
|
|
vikunjaPostgresql.succeed("curl --fail http://localhost/api/v1/info")
|
|
|
|
vikunjaPostgresql.succeed("curl --fail http://localhost")
|
|
|
|
'';
|
|
|
|
})
|