1{ pkgs, ... }:
2let
3 port = 81;
4in
5{
6 name = "keter";
7 meta = with pkgs.lib.maintainers; {
8 maintainers = [ jappie ];
9 };
10
11 nodes.machine =
12 { config, pkgs, ... }:
13 {
14 services.keter = {
15 enable = true;
16
17 globalKeterConfig = {
18 cli-port = 123; # just adding this to test the freeform
19 listeners = [
20 {
21 host = "*4";
22 inherit port;
23 }
24 ];
25 };
26 bundle = {
27 appName = "test-bundle";
28 domain = "localhost";
29 executable = pkgs.writeShellScript "run" ''
30 ${pkgs.python3}/bin/python -m http.server $PORT
31 '';
32 };
33 };
34 };
35
36 testScript = ''
37 machine.wait_for_unit("keter.service")
38
39 machine.wait_for_open_port(${toString port})
40 machine.wait_for_console_text("Activating app test-bundle with hosts: localhost")
41
42
43 machine.succeed("curl --fail http://localhost:${toString port}/")
44 '';
45}