1{ pkgs, ... }:
2{
3 name = "postfixadmin";
4 meta = with pkgs.lib.maintainers; {
5 maintainers = [ globin ];
6 };
7
8 nodes = {
9 postfixadmin =
10 { config, pkgs, ... }:
11 {
12 services.postfixadmin = {
13 enable = true;
14 hostName = "postfixadmin";
15 setupPasswordFile = pkgs.writeText "insecure-test-setup-pw-file" "$2y$10$r0p63YCjd9rb9nHrV9UtVuFgGTmPDLKu.0UIJoQTkWCZZze2iuB1m";
16 };
17 services.nginx.virtualHosts.postfixadmin = {
18 forceSSL = false;
19 enableACME = false;
20 };
21 };
22 };
23
24 testScript = ''
25 postfixadmin.start
26 postfixadmin.wait_for_unit("postgresql.target")
27 postfixadmin.wait_for_unit("phpfpm-postfixadmin.service")
28 postfixadmin.wait_for_unit("nginx.service")
29 postfixadmin.succeed(
30 "curl -sSfL http://postfixadmin/setup.php -X POST -F 'setup_password=not production'"
31 )
32 postfixadmin.succeed("curl -sSfL http://postfixadmin/ | grep 'Mail admins login here'")
33 '';
34}