summaryrefslogtreecommitdiffstats
path: root/nixos/tests/onlyoffice.nix
blob: 67e4f85057091049e93760234bfaad4405f54de5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
let
  port = 8000;
in
{
  name = "onlyoffice";

  nodes.machine =
    { pkgs, ... }:
    {
      services.onlyoffice = {
        enable = true;
        inherit port;
        hostname = "office.example.com";
        securityNonceFile = "${pkgs.writeText "nixos-test-onlyoffice-nonce.conf" ''
          set $secure_link_secret "nixostest";
        ''}";
      };

      networking.hosts = {
        "::1" = [ "office.example.com" ];
      };
    };

  testScript = ''
    machine.wait_for_unit("onlyoffice-docservice.service")
    machine.wait_for_unit("onlyoffice-converter.service")
    machine.wait_for_open_port(${toString port})
    machine.succeed("curl --fail http://office.example.com/healthcheck")
  '';
}