From 1beb2875fa840a7a99c85ad9ed1ca6f351cda01d Mon Sep 17 00:00:00 2001 From: Kai Zimmermann Date: Tue, 17 Jan 2017 15:03:52 +0100 Subject: [PATCH] Upgrade to Spring Boot 1.4 (#415) * Boot upgrade due to known security issues. Signed-off-by: kaizimmerm --- deployHawkBitSandbox.sh | 4 +++- .../application-cloudsandbox.properties | 4 ++++ .../src/main/resources/application.properties | 4 ++++ .../hawkbit-example-mgmt-simulator/README.md | 4 ++-- .../hawkbit-example-mgmt-simulator/pom.xml | 1 + .../resources/application-test.properties | 2 +- .../RepositoryApplicationConfiguration.java | 11 ++++++++++ .../resources/application-test.properties | 2 +- pom.xml | 20 +++++++++---------- 9 files changed, 37 insertions(+), 15 deletions(-) diff --git a/deployHawkBitSandbox.sh b/deployHawkBitSandbox.sh index ac724e5da..45bfac3d0 100644 --- a/deployHawkBitSandbox.sh +++ b/deployHawkBitSandbox.sh @@ -11,11 +11,13 @@ # data example to a cloud foundry enviroment. Expects existing CF CLI # installation and login to be existing already. +cf api https://api.eu-gb.bluemix.net +cf login cf stop hawkbit-simulator cd examples/hawkbit-example-app/target/ cf push cd ../.. -java -jar hawkbit-example-mgmt-simulator/target/hawkbit-example-mgmt-simulator-0.2.0-SNAPSHOT.jar --hawkbit.url=https://hawkbit.eu-gb.mybluemix.net +java -jar hawkbit-example-mgmt-simulator/target/hawkbit-example-mgmt-simulator-0.2.0-SNAPSHOT-exec.jar --hawkbit.url=https://hawkbit.eu-gb.mybluemix.net cd hawkbit-device-simulator/target/ cf push cd ../../.. diff --git a/examples/hawkbit-example-app/src/main/resources/application-cloudsandbox.properties b/examples/hawkbit-example-app/src/main/resources/application-cloudsandbox.properties index 85dfb02ee..ec3c376f5 100644 --- a/examples/hawkbit-example-app/src/main/resources/application-cloudsandbox.properties +++ b/examples/hawkbit-example-app/src/main/resources/application-cloudsandbox.properties @@ -14,6 +14,10 @@ server.tomcat.internal-proxies=.* vaadin.servlet.productionMode=true +# Sandbox, small files only +spring.http.multipart.max-file-size=100KB +spring.http.multipart.max-request-size=-1 + ## Configuration for building download URLs - START hawkbit.artifact.url.protocols.download-http.rel=download-http hawkbit.artifact.url.protocols.download-http.protocol=https diff --git a/examples/hawkbit-example-app/src/main/resources/application.properties b/examples/hawkbit-example-app/src/main/resources/application.properties index 0c32c8f8c..399a386c9 100644 --- a/examples/hawkbit-example-app/src/main/resources/application.properties +++ b/examples/hawkbit-example-app/src/main/resources/application.properties @@ -35,6 +35,10 @@ hawkbit.server.ui.demo.password=admin hawkbit.server.ui.demo.user=admin hawkbit.server.ui.demo.tenant=DEFAULT +# Upload of large files +spring.http.multipart.max-file-size=1024MB +spring.http.multipart.max-request-size=-1 + # UI help links hawkbit.server.ui.links.documentation.root=https://github.com/eclipse/hawkbit hawkbit.server.ui.links.documentation.deployment-view=https://github.com/eclipse/hawkbit diff --git a/examples/hawkbit-example-mgmt-simulator/README.md b/examples/hawkbit-example-mgmt-simulator/README.md index 925df8041..e8003b5c8 100644 --- a/examples/hawkbit-example-mgmt-simulator/README.md +++ b/examples/hawkbit-example-mgmt-simulator/README.md @@ -10,13 +10,13 @@ Run getting started example - $ java -jar hawkbit-example-mgmt-simulator-#version#.jar + $ java -jar hawkbit-example-mgmt-simulator-#version#-exec.jar Run create and start rollout example - $ java -jar hawkbit-example-mgmt-simulator-#version#.jar --createrollout + $ java -jar hawkbit-example-mgmt-simulator-#version#-exec.jar --createrollout ## This example shows diff --git a/examples/hawkbit-example-mgmt-simulator/pom.xml b/examples/hawkbit-example-mgmt-simulator/pom.xml index dcf1bc735..0fa7458f9 100644 --- a/examples/hawkbit-example-mgmt-simulator/pom.xml +++ b/examples/hawkbit-example-mgmt-simulator/pom.xml @@ -32,6 +32,7 @@ ${baseDir} + exec false org.eclipse.hawkbit.mgmt.client.Application JAR diff --git a/hawkbit-ddi-resource/src/test/resources/application-test.properties b/hawkbit-ddi-resource/src/test/resources/application-test.properties index a1f984dfb..5ac6df2f7 100644 --- a/hawkbit-ddi-resource/src/test/resources/application-test.properties +++ b/hawkbit-ddi-resource/src/test/resources/application-test.properties @@ -17,7 +17,7 @@ spring.data.mongodb.port=28017 hawkbit.server.ddi.security.authentication.header.enabled=true hawkbit.server.ddi.security.authentication.gatewaytoken.name=TestToken -multipart.max-file-size=5MB +spring.http.multipart.max-file-size=5MB hawkbit.server.security.dos.maxStatusEntriesPerAction=100 diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/RepositoryApplicationConfiguration.java b/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/RepositoryApplicationConfiguration.java index a41ca95ef..8a08582e7 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/RepositoryApplicationConfiguration.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/RepositoryApplicationConfiguration.java @@ -11,6 +11,7 @@ package org.eclipse.hawkbit.repository.jpa; import java.util.Map; import javax.persistence.EntityManager; +import javax.sql.DataSource; import org.eclipse.hawkbit.ControllerPollProperties; import org.eclipse.hawkbit.repository.ArtifactManagement; @@ -66,9 +67,12 @@ import org.eclipse.hawkbit.security.SecurityTokenGenerator; import org.eclipse.hawkbit.security.SystemSecurityContext; import org.eclipse.hawkbit.tenancy.TenantAware; import org.eclipse.hawkbit.tenancy.configuration.TenantConfigurationProperties; +import org.springframework.beans.factory.ObjectProvider; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.orm.jpa.JpaBaseConfiguration; +import org.springframework.boot.autoconfigure.orm.jpa.JpaProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.orm.jpa.EntityScan; import org.springframework.context.annotation.Bean; @@ -82,6 +86,7 @@ import org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.annotation.EnableTransactionManagement; +import org.springframework.transaction.jta.JtaTransactionManager; import org.springframework.validation.beanvalidation.MethodValidationPostProcessor; import com.google.common.collect.Maps; @@ -102,6 +107,12 @@ import com.google.common.collect.Maps; @EntityScan("org.eclipse.hawkbit.repository.jpa.model") public class RepositoryApplicationConfiguration extends JpaBaseConfiguration { + @Autowired + RepositoryApplicationConfiguration(final DataSource dataSource, final JpaProperties jpaProperties, + final ObjectProvider jtaTransactionManagerProvider) { + super(dataSource, jpaProperties, jtaTransactionManagerProvider); + } + @Bean @ConditionalOnMissingBean public RsqlValidationOracle rsqlValidationOracle() { diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/resources/application-test.properties b/hawkbit-repository/hawkbit-repository-jpa/src/test/resources/application-test.properties index 115f14118..c630197c2 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/resources/application-test.properties +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/resources/application-test.properties @@ -13,7 +13,7 @@ logging.level.org.eclipse.persistence=ERROR spring.data.mongodb.uri=mongodb://localhost/spArtifactRepository${random.value} spring.data.mongodb.port=28017 -multipart.max-file-size=5MB +spring.http.multipart.max-file-size=5MB hawkbit.server.security.dos.maxStatusEntriesPerAction=100 diff --git a/pom.xml b/pom.xml index 8529a17fe..79b1d1c37 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ org.springframework.boot spring-boot-starter-parent - 1.3.8.RELEASE + 1.4.3.RELEASE org.eclipse.hawkbit @@ -101,18 +101,14 @@ 1.8 - 1.3.8.RELEASE + 1.4.3.RELEASE true - - 1.6.5.RELEASE - 4.1.2.RELEASE - 4.3.3.RELEASE - 4.3.2.RELEASE - Hopper-SR5 - - 3.2.2 + + + + 2.0.0 @@ -595,6 +591,10 @@ org.hibernate hibernate-entitymanager + + + org.hibernate + hibernate-core org.springframework.boot