From d636afc2b681bed3de7d5bcedca94c6c300daaa1 Mon Sep 17 00:00:00 2001 From: joshzamor Date: Tue, 8 Mar 2016 13:11:48 -0800 Subject: [PATCH 1/5] bumping commons-collections to 3.2.2 and 4.1 due to security notification Notification on elmis implementation: https://github.com/USAID-DELIVER-PROJECT/elmis/pull/1 Referenced: https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2015-8103 https://commons.apache.org/proper/commons-collections/security-reports.html http://foxglovesecurity.com/2015/11/06/what-do-weblogic-websphere-jboss-jenkins-opennms-and-your-application-have-in-common-this-vulnerability/ --- build.gradle | 4 ++-- modules/sms/build.gradle | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 11c9c877c6..7f8b9cd42a 100644 --- a/build.gradle +++ b/build.gradle @@ -95,8 +95,8 @@ subprojects { 'org.springframework.integration:spring-integration-ftp:4.1.2.RELEASE', 'xml-apis:xml-apis:2.0.2', - 'commons-collections:commons-collections:3.2.1', - 'org.apache.commons:commons-collections4:4.0', + 'commons-collections:commons-collections:3.2.2', + 'org.apache.commons:commons-collections4:4.1', 'javax.servlet:javax.servlet-api:3.1.0', 'org.projectlombok:lombok:1.16.2', diff --git a/modules/sms/build.gradle b/modules/sms/build.gradle index 184d3bc38d..32733371a6 100644 --- a/modules/sms/build.gradle +++ b/modules/sms/build.gradle @@ -17,7 +17,7 @@ dependencies { compile 'javax.activation:activation:1.1.1', 'org.springframework.integration:spring-integration-core:4.1.2.RELEASE', 'org.springframework.integration:spring-integration-jdbc:4.1.2.RELEASE', - 'commons-collections:commons-collections:3.2.1', + 'commons-collections:commons-collections:3.2.2', 'commons-lang:commons-lang:2.6', project(':modules:db') From 6d65527b956a14c7d9a8716deea975f5c8c3c2a0 Mon Sep 17 00:00:00 2001 From: Chongsun Ahn Date: Tue, 15 Mar 2016 11:01:14 -0700 Subject: [PATCH 2/5] Fix database build dependency Gradle enableCustom task should depend on baseSeed task, not globalSeed task, so that it will not run the extraSeed task. Running extraSeed can cause problems when applying other seed tasks, such as demoSeed. --- modules/db/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/db/build.gradle b/modules/db/build.gradle index bdb0185eb0..023c17201a 100644 --- a/modules/db/build.gradle +++ b/modules/db/build.gradle @@ -138,7 +138,7 @@ task globalSeed(dependsOn: [baseSeed, extraSeed]) { description 'Runs all seed tasks that apply globally' } -task enableCustom(type: Exec, dependsOn: globalSeed) { +task enableCustom(type: Exec, dependsOn: baseSeed) { onlyIf { toggleOnCustom == 'true' } description 'Runs script to enable project-specific features (if toggleOnCustom is true)' environment("PGPASSWORD", dbPassword) From e051457a1d2590460a225fd7c8b12d0a35829aa4 Mon Sep 17 00:00:00 2001 From: Chongsun Ahn Date: Thu, 17 Mar 2016 18:48:21 -0700 Subject: [PATCH 3/5] OLMIS-60 Add version number to login page During the build, edit the login page to show the version number from the version property file. Build number is either a custom developer build (the property file default) or can be passed in as a parameter. --- build.gradle | 5 +++++ modules/openlmis-web/build.gradle | 6 ++++++ .../src/main/webapp/public/pages/login-form.html | 2 +- version.properties | 4 ++++ 4 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 version.properties diff --git a/build.gradle b/build.gradle index 7f8b9cd42a..4f1cf093e6 100644 --- a/build.gradle +++ b/build.gradle @@ -15,6 +15,11 @@ apply plugin: 'com.github.ben-manes.versions' apply plugin: 'properties' apply plugin: 'sonar-runner' +ext.versionProps = new Properties() +versionProps.load(new FileInputStream("version.properties")) +versionProps.each { versionProp -> + ext.set(versionProp.key, versionProp.value) +} idea.project.languageLevel = '1.7' idea.project.jdkName = '1.7' diff --git a/modules/openlmis-web/build.gradle b/modules/openlmis-web/build.gradle index bb0643fac4..4c1c2468d5 100644 --- a/modules/openlmis-web/build.gradle +++ b/modules/openlmis-web/build.gradle @@ -141,6 +141,12 @@ tasks.withType(War) { else "$line" } + if (fileCopy.name.equals('login-form.html')) { + fileCopy.filter(ReplaceTokens, tokens: [major_version: majorVersion, + minor_version: minorVersion, + hotfix_version: hotfixVersion, + build_version: buildVersion]) + } } } diff --git a/modules/openlmis-web/src/main/webapp/public/pages/login-form.html b/modules/openlmis-web/src/main/webapp/public/pages/login-form.html index 1c1a8b0d17..13a488e5fb 100644 --- a/modules/openlmis-web/src/main/webapp/public/pages/login-form.html +++ b/modules/openlmis-web/src/main/webapp/public/pages/login-form.html @@ -41,7 +41,7 @@

- Powered by OpenLMIS + Powered by OpenLMIS v@major_version@.@minor_version@.@hotfix_version@ build @build_version@
diff --git a/version.properties b/version.properties new file mode 100644 index 0000000000..61fb29b148 --- /dev/null +++ b/version.properties @@ -0,0 +1,4 @@ +majorVersion = 2 +minorVersion = 0 +hotfixVersion = 1 +buildVersion = Developer \ No newline at end of file From bfcd31a38e3afe939426adf295fc936c0970f87e Mon Sep 17 00:00:00 2001 From: Chongsun Ahn Date: Fri, 18 Mar 2016 12:07:07 -0700 Subject: [PATCH 4/5] Rename hotfix to patch Hotfix is only done on a production system as a one-off. Patch is more accurate for naming. --- modules/openlmis-web/build.gradle | 2 +- .../openlmis-web/src/main/webapp/public/pages/login-form.html | 2 +- version.properties | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/openlmis-web/build.gradle b/modules/openlmis-web/build.gradle index 4c1c2468d5..0762f01c6d 100644 --- a/modules/openlmis-web/build.gradle +++ b/modules/openlmis-web/build.gradle @@ -144,7 +144,7 @@ tasks.withType(War) { if (fileCopy.name.equals('login-form.html')) { fileCopy.filter(ReplaceTokens, tokens: [major_version: majorVersion, minor_version: minorVersion, - hotfix_version: hotfixVersion, + hotfix_version: patchVersion, build_version: buildVersion]) } } diff --git a/modules/openlmis-web/src/main/webapp/public/pages/login-form.html b/modules/openlmis-web/src/main/webapp/public/pages/login-form.html index 13a488e5fb..91254d0ff8 100644 --- a/modules/openlmis-web/src/main/webapp/public/pages/login-form.html +++ b/modules/openlmis-web/src/main/webapp/public/pages/login-form.html @@ -41,7 +41,7 @@

- Powered by OpenLMIS v@major_version@.@minor_version@.@hotfix_version@ build @build_version@ + Powered by OpenLMIS v@major_version@.@minor_version@.@patch_version@ build @build_version@
diff --git a/version.properties b/version.properties index 61fb29b148..bfb5b4c9f4 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ majorVersion = 2 minorVersion = 0 -hotfixVersion = 1 +patchVersion = 1 buildVersion = Developer \ No newline at end of file From f8f88dbb0b48e05fd1d3654d12f6b300d6c2a387 Mon Sep 17 00:00:00 2001 From: Chongsun Ahn Date: Fri, 18 Mar 2016 12:21:42 -0700 Subject: [PATCH 5/5] Rename hotfix to patch, part 2 --- modules/openlmis-web/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openlmis-web/build.gradle b/modules/openlmis-web/build.gradle index 0762f01c6d..9ee8e5fe99 100644 --- a/modules/openlmis-web/build.gradle +++ b/modules/openlmis-web/build.gradle @@ -144,7 +144,7 @@ tasks.withType(War) { if (fileCopy.name.equals('login-form.html')) { fileCopy.filter(ReplaceTokens, tokens: [major_version: majorVersion, minor_version: minorVersion, - hotfix_version: patchVersion, + patch_version: patchVersion, build_version: buildVersion]) } }