Setup rspamd controller to serve web UI assets

This commit is contained in:
Xavier Vello 2020-06-27 21:20:16 +02:00
parent 31cf3818df
commit 45f80def41
2 changed files with 7 additions and 0 deletions

View file

@ -87,6 +87,9 @@ in
mode = "0666";
}];
includes = [];
extraConfig = ''
static_dir = "''${WWWDIR}"; # Serve the web UI static assets
'';
};
};

View file

@ -81,5 +81,9 @@ import (pkgs.path + "/nixos/tests/make-test.nix") {
$machine->waitUntilSucceeds("timeout 1 ${pkgs.netcat}/bin/nc -U /run/rspamd/rspamd-milter.sock < /dev/null; [ \$? -eq 124 ]");
$machine->succeed("cat ${sendMail} | ${pkgs.netcat-gnu}/bin/nc localhost 25 | grep -q 'This account cannot receive emails'" );
};
subtest "rspamd controller serves web ui", sub {
$machine->succeed("${pkgs.curl}/bin/curl --unix-socket /run/rspamd/worker-controller.sock http://localhost/ | grep -q '<body>'" );
};
'';
}