dependency-track: don't bundle frontend in jar

Bundling the frontend in the jar is deprecated by upstream and causes
the frontend from being serve after weeks of runtime.
This commit is contained in:
Alexander Sieg 2025-03-02 16:16:18 +01:00
parent 28e18569a4
commit 8af0a5abfd
3 changed files with 11 additions and 8 deletions

View file

@ -463,6 +463,10 @@
[Prisma ORM upgrade guide](https://www.prisma.io/docs/orm/more/upgrade-guides/upgrading-versions/upgrading-to-prisma-6)
for more information.
- `depdendency-track` no longer bundes the UI inside the jar. This bundling
functionality is deprecated by upstream and causes UI assets not being served
after weeks of runtime.
- `nq` was updated to 1.0, which renames the `fq` and `tq` utilities to `nqtail` and `nqterm` respectively.
- `zf` was updated to 0.10.2, which includes breaking changes from the [0.10.0 release](https://github.com/natecraddock/zf/releases/tag/0.10.0).

View file

@ -509,7 +509,8 @@ in
upstreams.dependency-track.servers."localhost:${toString cfg.port}" = { };
virtualHosts.${cfg.nginx.domain} = {
locations = {
"/".proxyPass = "http://dependency-track";
"/".alias = "${cfg.package.frontend}/dist/";
"/api".proxyPass = "http://dependency-track";
"= /static/config.json".alias = frontendConfigFile;
};
};

View file

@ -28,6 +28,11 @@ let
hash = "sha256-IcahhuWX1Ba7kmyJaNJlY1gcVHOR6uynyr7w5MMwRgo=";
};
installPhase = ''
mkdir $out
cp -R ./dist $out/
'';
npmDepsHash = "sha256-LeSKSZYtjrZ84RkhGbLEMHVi1fw7FK/137F0V4hjSCE=";
forceGitDeps = true;
makeCacheWritable = true;
@ -74,17 +79,11 @@ maven.buildMavenPackage rec {
"-Dmaven.test.skip=true"
"-P enhance"
"-P embedded-jetty"
"-P bundle-ui"
"-Dservices.bom.merge.skip=false"
"-Dlogback.configuration.file=${src}/src/main/docker/logback.xml"
"-Dcyclonedx-cli.path=${lib.getExe cyclonedx-cli}"
];
preBuild = ''
mkdir -p frontend
cp -r ${frontend}/lib/node_modules/@dependencytrack/frontend/dist frontend/
'';
afterDepsSetup = ''
mvn cyclonedx:makeBom -Dmaven.repo.local=$mvnDeps/.m2 \
org.codehaus.mojo:exec-maven-plugin:exec@merge-services-bom
@ -105,7 +104,6 @@ maven.buildMavenPackage rec {
'';
passthru = {
# passthru for nix-update
inherit frontend;
tests = {
inherit (nixosTests) dependency-track;