Loading nixos/modules/services/web-apps/dependency-track.nix +20 −2 Original line number Diff line number Diff line Loading @@ -509,9 +509,27 @@ in upstreams.dependency-track.servers."localhost:${toString cfg.port}" = { }; virtualHosts.${cfg.nginx.domain} = { locations = { "/".alias = "${cfg.package.frontend}/dist/"; "/" = { alias = "${cfg.package.frontend}/dist/"; index = "index.html"; tryFiles = "$uri $uri/ /index.html"; extraConfig = '' location ~ (index\.html)$ { add_header Cache-Control "max-age=0, no-cache, no-store, must-revalidate"; add_header Pragma "no-cache"; add_header Expires 0; } ''; }; "/api".proxyPass = "http://dependency-track"; "= /static/config.json".alias = frontendConfigFile; "= /static/config.json" = { alias = frontendConfigFile; extraConfig = '' add_header Cache-Control "max-age=0, no-cache, no-store, must-revalidate"; add_header Pragma "no-cache"; add_header Expires 0; ''; }; }; }; }; Loading nixos/tests/dependency-track.nix +19 −14 Original line number Diff line number Diff line Loading @@ -45,7 +45,9 @@ import ./make-test-python.nix ( }; }; testScript = '' testScript = # python '' import json start_all() Loading @@ -61,6 +63,9 @@ import ./make-test-python.nix ( server.succeed("curl http://localhost/api/version") ) assert version["version"] == "${pkgs.dependency-track.version}" with subtest("nginx serves frontend"): server.succeed("curl http://localhost/ | grep \"<title>Dependency-Track</title>\"") ''; } ) Loading
nixos/modules/services/web-apps/dependency-track.nix +20 −2 Original line number Diff line number Diff line Loading @@ -509,9 +509,27 @@ in upstreams.dependency-track.servers."localhost:${toString cfg.port}" = { }; virtualHosts.${cfg.nginx.domain} = { locations = { "/".alias = "${cfg.package.frontend}/dist/"; "/" = { alias = "${cfg.package.frontend}/dist/"; index = "index.html"; tryFiles = "$uri $uri/ /index.html"; extraConfig = '' location ~ (index\.html)$ { add_header Cache-Control "max-age=0, no-cache, no-store, must-revalidate"; add_header Pragma "no-cache"; add_header Expires 0; } ''; }; "/api".proxyPass = "http://dependency-track"; "= /static/config.json".alias = frontendConfigFile; "= /static/config.json" = { alias = frontendConfigFile; extraConfig = '' add_header Cache-Control "max-age=0, no-cache, no-store, must-revalidate"; add_header Pragma "no-cache"; add_header Expires 0; ''; }; }; }; }; Loading
nixos/tests/dependency-track.nix +19 −14 Original line number Diff line number Diff line Loading @@ -45,7 +45,9 @@ import ./make-test-python.nix ( }; }; testScript = '' testScript = # python '' import json start_all() Loading @@ -61,6 +63,9 @@ import ./make-test-python.nix ( server.succeed("curl http://localhost/api/version") ) assert version["version"] == "${pkgs.dependency-track.version}" with subtest("nginx serves frontend"): server.succeed("curl http://localhost/ | grep \"<title>Dependency-Track</title>\"") ''; } )