1 import ./make-test-python.nix (
4 name = "trilium-server";
7 services.trilium-server.enable = true;
10 services.trilium-server = {
12 dataDir = "/data/trilium";
17 services.trilium-server = {
20 nginx.hostName = "trilium.example.com";
28 with subtest("by default works without configuration"):
29 default.wait_for_unit("trilium-server.service")
31 with subtest("by default available on port 8080"):
32 default.wait_for_unit("trilium-server.service")
33 default.wait_for_open_port(8080)
34 # we output to /dev/null here to avoid a python UTF-8 decode error
35 # but the check will still fail if the service doesn't respond
36 default.succeed("curl --fail -o /dev/null 127.0.0.1:8080")
38 with subtest("by default creates empty document"):
39 default.wait_for_unit("trilium-server.service")
40 default.succeed("test -f /var/lib/trilium/document.db")
42 with subtest("configured with custom data store"):
43 configured.wait_for_unit("trilium-server.service")
44 configured.succeed("test -f /data/trilium/document.db")
46 with subtest("nginx with custom host name"):
47 nginx.wait_for_unit("trilium-server.service")
48 nginx.wait_for_unit("nginx.service")
51 "curl --resolve 'trilium.example.com:80:127.0.0.1' http://trilium.example.com/"