From 45f80def41ad4789a231e67fa1ec984370651439 Mon Sep 17 00:00:00 2001 From: Xavier Vello Date: Sat, 27 Jun 2020 21:20:16 +0200 Subject: [PATCH] Setup rspamd controller to serve web UI assets --- mail-server/rspamd.nix | 3 +++ tests/intern.nix | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/mail-server/rspamd.nix b/mail-server/rspamd.nix index f5a2d20..61700c3 100644 --- a/mail-server/rspamd.nix +++ b/mail-server/rspamd.nix @@ -87,6 +87,9 @@ in mode = "0666"; }]; includes = []; + extraConfig = '' + static_dir = "''${WWWDIR}"; # Serve the web UI static assets + ''; }; }; diff --git a/tests/intern.nix b/tests/intern.nix index 039f2e1..f96643c 100644 --- a/tests/intern.nix +++ b/tests/intern.nix @@ -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 ''" ); + }; ''; }