nixos/ntfy-sh: use dynamic user and add defaults
This commit is contained in:
@@ -3,6 +3,7 @@ import ./make-test-python.nix {
|
||||
|
||||
nodes.machine = { ... }: {
|
||||
services.ntfy-sh.enable = true;
|
||||
services.ntfy-sh.settings.base-url = "http://localhost:2586";
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
@@ -12,12 +13,14 @@ import ./make-test-python.nix {
|
||||
|
||||
machine.wait_for_unit("multi-user.target")
|
||||
|
||||
machine.wait_for_open_port(80)
|
||||
machine.wait_for_open_port(2586)
|
||||
|
||||
machine.succeed(f"curl -d '{msg}' localhost:80/test")
|
||||
machine.succeed(f"curl -d '{msg}' localhost:2586/test")
|
||||
|
||||
notif = json.loads(machine.succeed("curl -s localhost:80/test/json?poll=1"))
|
||||
notif = json.loads(machine.succeed("curl -s localhost:2586/test/json?poll=1"))
|
||||
|
||||
assert msg == notif["message"], "Wrong message"
|
||||
|
||||
machine.succeed("ntfy user list")
|
||||
'';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user