at 25.11-pre 1.6 kB view raw
1import ./make-test-python.nix ( 2 { pkgs, lib, ... }: 3 let 4 accessKey = "BKIKJAA5BMMU2RHO6IBB"; 5 secretKey = "V7f1CwQqAcwo80UEIJEjc5gVQUSSx5ohQ9GSrr12"; 6 secretKeyFile = pkgs.writeText "outline-secret-key" '' 7 ${secretKey} 8 ''; 9 rootCredentialsFile = pkgs.writeText "minio-credentials-full" '' 10 MINIO_ROOT_USER=${accessKey} 11 MINIO_ROOT_PASSWORD=${secretKey} 12 ''; 13 in 14 { 15 name = "outline"; 16 17 meta.maintainers = lib.teams.cyberus.members; 18 19 nodes = { 20 outline = 21 { pkgs, config, ... }: 22 { 23 nixpkgs.config.allowUnfree = true; 24 environment.systemPackages = [ pkgs.minio-client ]; 25 services.outline = { 26 enable = true; 27 forceHttps = false; 28 storage = { 29 inherit accessKey secretKeyFile; 30 uploadBucketUrl = "http://localhost:9000"; 31 uploadBucketName = "outline"; 32 region = config.services.minio.region; 33 }; 34 }; 35 services.minio = { 36 enable = true; 37 inherit rootCredentialsFile; 38 }; 39 }; 40 }; 41 42 testScript = '' 43 machine.wait_for_unit("minio.service") 44 machine.wait_for_open_port(9000) 45 46 # Create a test bucket on the server 47 machine.succeed( 48 "mc config host add minio http://localhost:9000 ${accessKey} ${secretKey} --api s3v4" 49 ) 50 machine.succeed("mc mb minio/outline") 51 52 outline.wait_for_unit("outline.service") 53 outline.wait_for_open_port(3000) 54 outline.succeed("curl --fail http://localhost:3000/") 55 ''; 56 } 57)