From b030fecc95d9e5f582bdfb12d8ed7a19e54dbad0 Mon Sep 17 00:00:00 2001 From: nscuro Date: Mon, 9 Sep 2024 20:34:19 +0200 Subject: [PATCH 1/4] Bump Alpine to 3.1.0 Signed-off-by: nscuro --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 84d9fdffcb..9e9c60a93c 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ us.springett alpine-parent - 3.0.1 + 3.1.0 4.0.0 From 478d6584d1ddd4b464fac62738f406df857feadc Mon Sep 17 00:00:00 2001 From: nscuro Date: Mon, 9 Sep 2024 20:34:54 +0200 Subject: [PATCH 2/4] Disable logback status listener in all default configurations Signed-off-by: nscuro --- src/main/docker/logback-json.xml | 2 ++ src/main/docker/logback.xml | 1 + 2 files changed, 3 insertions(+) diff --git a/src/main/docker/logback-json.xml b/src/main/docker/logback-json.xml index 510d884006..03c59e0f24 100644 --- a/src/main/docker/logback-json.xml +++ b/src/main/docker/logback-json.xml @@ -1,5 +1,7 @@ + + diff --git a/src/main/docker/logback.xml b/src/main/docker/logback.xml index 5b2910545e..089b7ce76a 100644 --- a/src/main/docker/logback.xml +++ b/src/main/docker/logback.xml @@ -1,5 +1,6 @@ + ${user.home}/.dependency-track/dependency-track.log From 3b92b440001e2aef4866d3252777083acbb76db1 Mon Sep 17 00:00:00 2001 From: nscuro Date: Mon, 9 Sep 2024 20:39:26 +0200 Subject: [PATCH 3/4] Disable Jetty classpath scanning for faster startup Signed-off-by: nscuro --- pom.xml | 8 ++++++-- src/main/webapp/WEB-INF/jetty-context.xml | 13 +++++++++++++ src/main/webapp/WEB-INF/web.xml | 1 + 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 src/main/webapp/WEB-INF/jetty-context.xml diff --git a/pom.xml b/pom.xml index 9e9c60a93c..72df84de9a 100644 --- a/pom.xml +++ b/pom.xml @@ -734,7 +734,9 @@ ${plugin.jetty.version} - / + + ^$ + ^$ @@ -794,7 +796,9 @@ ${plugin.jetty.version} - / + + ^$ + ^$ src/test/webapp/WEB-INF/h2-console-web.xml diff --git a/src/main/webapp/WEB-INF/jetty-context.xml b/src/main/webapp/WEB-INF/jetty-context.xml new file mode 100644 index 0000000000..89d99c9451 --- /dev/null +++ b/src/main/webapp/WEB-INF/jetty-context.xml @@ -0,0 +1,13 @@ + + + + + + org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern + ^$ + + + org.eclipse.jetty.server.webapp.WebInfIncludeJarPattern + ^$ + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml index 577ff7ba3b..339838a5f3 100644 --- a/src/main/webapp/WEB-INF/web.xml +++ b/src/main/webapp/WEB-INF/web.xml @@ -21,6 +21,7 @@ From f1f5d7610d6681e42e194a86375a5c9b664a68ba Mon Sep 17 00:00:00 2001 From: nscuro Date: Mon, 9 Sep 2024 21:19:23 +0200 Subject: [PATCH 4/4] Extend max length of `TEAM.NAME` column to 255 characters Signed-off-by: nscuro --- .../upgrade/v4120/v4120Updater.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/main/java/org/dependencytrack/upgrade/v4120/v4120Updater.java b/src/main/java/org/dependencytrack/upgrade/v4120/v4120Updater.java index 99f97b16f8..0b6615c481 100644 --- a/src/main/java/org/dependencytrack/upgrade/v4120/v4120Updater.java +++ b/src/main/java/org/dependencytrack/upgrade/v4120/v4120Updater.java @@ -21,12 +21,14 @@ import alpine.common.logging.Logger; import alpine.persistence.AlpineQueryManager; import alpine.server.upgrade.AbstractUpgradeItem; +import alpine.server.util.DbUtil; import org.dependencytrack.model.BomValidationMode; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; +import java.sql.Statement; import static org.dependencytrack.model.ConfigPropertyConstants.BOM_VALIDATION_MODE; @@ -43,6 +45,7 @@ public String getSchemaVersion() { public void executeUpgrade(final AlpineQueryManager qm, final Connection connection) throws Exception { removeExperimentalBomUploadProcessingV2ConfigProperty(connection); migrateBomValidationConfigProperty(connection); + extendTeamNameColumnMaxLength(connection); } private static void removeExperimentalBomUploadProcessingV2ConfigProperty(final Connection connection) throws SQLException { @@ -143,4 +146,24 @@ private static void migrateBomValidationConfigProperty(final Connection connecti } } + private void extendTeamNameColumnMaxLength(final Connection connection) throws SQLException { + LOGGER.info("Extending max length of column TEAM.NAME to 255"); + + try (final Statement stmt = connection.createStatement()) { + if (DbUtil.isMssql()) { + stmt.executeUpdate(""" + ALTER TABLE "TEAM" ALTER COLUMN "NAME" VARChAR(255) NOT NULL + """); + } else if (DbUtil.isMysql()) { + stmt.executeUpdate(""" + ALTER TABLE "TEAM" MODIFY "NAME" VARCHAR(255) NOT NULL + """); + } else { + stmt.executeUpdate(""" + ALTER TABLE "TEAM" ALTER COLUMN "NAME" TYPE VARCHAR(255) + """); + } + } + } + }