1 import ./make-test-python.nix (
7 meta.maintainers = with lib.maintainers; [ _0x4A6F ];
12 networking.firewall.allowedTCPPorts = [ 8080 ];
13 services.xandikos.enable = true;
16 networking.firewall.allowedTCPPorts = [ 80 8080 ];
17 services.xandikos.enable = true;
18 services.xandikos.address = "localhost";
19 services.xandikos.port = 8080;
20 services.xandikos.routePrefix = "/xandikos-prefix/";
21 services.xandikos.extraOptions = [
26 recommendedProxySettings = true;
27 virtualHosts."xandikos" = {
28 serverName = "xandikos.local";
29 basicAuth.xandikos = "snakeOilPassword";
30 locations."/xandikos/" = {
31 proxyPass = "http://localhost:8080/xandikos-prefix/";
41 with subtest("Xandikos default"):
42 xandikos_default.wait_for_unit("multi-user.target")
43 xandikos_default.wait_for_unit("xandikos.service")
44 xandikos_default.wait_for_open_port(8080)
45 xandikos_default.succeed("curl --fail http://localhost:8080/")
46 xandikos_default.succeed(
47 "curl -s --fail --location http://localhost:8080/ | grep -i Xandikos"
49 xandikos_client.wait_for_unit("network.target")
50 xandikos_client.fail("curl --fail http://xandikos_default:8080/")
52 with subtest("Xandikos proxy"):
53 xandikos_proxy.wait_for_unit("multi-user.target")
54 xandikos_proxy.wait_for_unit("xandikos.service")
55 xandikos_proxy.wait_for_open_port(8080)
56 xandikos_proxy.succeed("curl --fail http://localhost:8080/")
57 xandikos_proxy.succeed(
58 "curl -s --fail --location http://localhost:8080/ | grep -i Xandikos"
60 xandikos_client.wait_for_unit("network.target")
61 xandikos_client.fail("curl --fail http://xandikos_proxy:8080/")
62 xandikos_client.succeed(
63 "curl -s --fail -u xandikos:snakeOilPassword -H 'Host: xandikos.local' http://xandikos_proxy/xandikos/ | grep -i Xandikos"
65 xandikos_client.succeed(
66 "curl -s --fail -u xandikos:snakeOilPassword -H 'Host: xandikos.local' http://xandikos_proxy/xandikos/user/ | grep -i Xandikos"