diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..eb403d8 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,61 @@ +name: openEQUELLA Admin Console Launcer CI + +on: + push: + branches: + - master + - develop + - release/** + tags: + - "**" + pull_request: + branches: + - master + - develop + - release/** + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Gradle Cache + uses: actions/cache@v2 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + + - name: Set up JDK 1.8 + uses: actions/setup-java@v2 + with: + distribution: adopt + java-version: 8 + + - name: Build with Gradle + run: ./gradlew build + + - name: Save artefacts + uses: actions/upload-artifact@v2.2.4 + with: + name: Artefacts + path: build/distributions + + - name: Save Coverage Report + uses: actions/upload-artifact@v2.2.4 + with: + name: CoverageReport + path: build/reports/tests/test + + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: build/distributions/* + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 98bdae7..0000000 --- a/.travis.yml +++ /dev/null @@ -1,30 +0,0 @@ -language: java -jdk: - - openjdk8 - -cache: - directories: - - $HOME/.gradle/caches/ - - $HOME/.gradle/wrapper/ - -before_install: - - sudo apt-get install -y awscli - -install: true - -script: - - ./gradlew build - -before_cache: - - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock - - rm -fr $HOME/.gradle/caches/*/plugin-resolution/ - -deploy: - provider: releases - api-key: - secure: TXedn0kc5TaLol+/Hl1RoOKvhucANcgUMqQw5FxE4wUJfqxbqT5fVeLVPjn9II8G1tgkB8v1zqG+wMk3e264/vhyf3IA5DBVj0UX5a4X/QfMCO2iQFBoQ+DRFBWCM1szPbfNxwbO2kzr+laX7t/fOBA+ESHPv6d6BLR1Ll0sZaX1re4hQBPT12fpdm+7rx1Peb1u/4j56dxiYMkI1qUbvYzxmS6EgBHO4LtXxNEpw9IPknUCecWCl6tRbKgg1Xsppm9/LQMn9Xc64o7GLE+BD+rBy93QnCZJUHNcUZvK+D0TXGfRxffpkYs6ZBtU9PjSv/603a6N6gmrnyi/m9NDBLpbnRtvBIzRj0CupFFdeAe6pfhEdmQ4HbJGPxdb7BOndOc+waAI6ObT+3qCg138h8mbBW12O0pQRm+0XXrTM5aVWqklMKyprPK2q3GeJt1pBrBZcQpXw6MqG9aF95uz7L2cZ9sfVM4eVGR/diLq+9bSgieR3ZEqi/R0QvrgcGe+V5CuT+O3DxzBZbpdlvxB7f3EKEv23nJFwR7d/i54rCi/GNKhIBAt3vItm6dz5tX8PyyPAfNaRos0+wrmLVxwPFWVPPmttu1zNPRvmia8rv7stG94W5/4Z43DVQYjkbLYU6vND9ZoPtqKC82NuMePKcwKKW2w3XKr2JjRmsoulMc= - file_glob: true - file: build/distributions/* - skip_cleanup: true - on: - tags: true \ No newline at end of file diff --git a/NOTICE.md b/NOTICE.md index 24d7b8a..e74baa8 100644 --- a/NOTICE.md +++ b/NOTICE.md @@ -19,11 +19,11 @@ the License. | Category | License | Dependency | Notes | | --------------------- | ------------------------------------------------------------------------- | ---------------------------------------------------- | ----------------------- | -| Apache | [ASF 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) | nebula.lint # 9.3.4 | | +| Apache | [ASF 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) | nebula.lint # 16.26.0 | | | Apache | [ASF 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) | com.github.hierynomus.license # 0.15.0 | | | Apache | [ASF 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) | com.google.guava:guava # 27.0.1-jre | | -| Apache | [ASF 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) | com.fasterxml.jackson.core:jackson-databind # 2.9.8 | | -| Apache | [ASF 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) | org.jasypt:jasypt # 1.9.2 | | -| Eclipse Public License| [Eclipse Public License 1.0](http://www.eclipse.org/legal/epl-v10.html ) | junit:junit # 4.12 | | -| MIT License | [MIT License](http://www.opensource.org/licenses/mit-license.php) | org.slf4j:slf4j-api # 1.7.26 | | -| MIT License | [MIT License](http://www.opensource.org/licenses/mit-license.php) | org.slf4j:slf4j-simple # 1.6.4 | | +| Apache | [ASF 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) | com.fasterxml.jackson.core:jackson-databind # 2.12.3 | | +| Apache | [ASF 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) | org.jasypt:jasypt # 1.9.3 | | +| Eclipse Public License| [Eclipse Public License 1.0](http://www.eclipse.org/legal/epl-v10.html ) | junit:junit # 4.13.2 | | +| MIT License | [MIT License](http://www.opensource.org/licenses/mit-license.php) | org.slf4j:slf4j-api # 1.7.31 | | +| MIT License | [MIT License](http://www.opensource.org/licenses/mit-license.php) | org.slf4j:slf4j-simple # 1.7.31 | | diff --git a/README.md b/README.md index 34b00bb..2c43928 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ For development, you can run the app via: ~$ ./gradlew run --console=verbose ``` -##Apereo Header validation +## Apereo Header validation The gradle build includes a task which will check that each source file in the common and configurator projects has an Apereo license notice at the top of the file. This license is stored in `LICENSE` in the root of this repository. In order to apply the headers, run: @@ -40,3 +40,44 @@ These packages will be produced as part of the standard build task. ``` -$ ./gradlew build ``` + +## Adding Root CA Certificates +If openEQUELLA is configured to use SSL with a certificate that is not recognized by Java, (such as with a self-signed certificate, an internal CA, smaller/lesser known third party CAs) +then the admin-console-package will fail to log in to the institution because of this error displayed in the terminal window: + +``` +Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: +PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: +unable to find valid certification path to requested target +``` + +This is because the Java Keystore used by the admin console package does not recognize the Root CA certificate used to sign openEQUELLA's SSL certificate. + +The admin-console-package uses its own copy of the JRE, in the `jdk8u242-b08-jre` folder. +The keystore we need to update is within this folder, at the path `jdk8u242-b08-jre/lib/security/cacerts`. + +The bundled JRE comes with a command line tool which you can use for updating these keystores, called `keytool`. +This should work in Mac, Linux and Windows. It is stored in `jdk8u242-b08-jre/bin`. + +**NOTE:** + +If Java is installed on your system it will have its own version of `keystore`. +You should use the one within the admin-console-package's bundled JRE rather than your system Java version, to ensure compatibility. + +You will need a copy of the Root CA certificate used to sign your SSL certificate saved as a .pem file for the following command's `-file` argument. + +`-alias` can be whatever you wish to call this key store entry. + +`-storepass` must be `changeit` - unless you have specifically changed this password first, +in which case you should use whatever it was set to. + +``` +keytool -import -trustcacerts -keystore path/to/adminconsolepackage/jdk8u242-b08-jre/lib/security/cacerts -storepass changeit -alias giveYourCertANameHere -file path/to/rootCA.pem +``` + +The command will display the certificate and prompt the user to `Trust this certificate? [no]:`. Type `yes` and hit Enter. +If successful, the response will be: + + Certificate was added to keystore. + +Now close and reopen the admin-console-package and attempt to log into your openEQUELLA's admin console. The error should be gone and login should be successful. diff --git a/build.gradle b/build.gradle index bce88ad..7d7c6c2 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ plugins { id 'java' id 'application' id 'base' - id 'nebula.lint' version '9.3.4' + id 'nebula.lint' version '16.26.0' id 'com.github.hierynomus.license' version '0.15.0' } @@ -18,10 +18,10 @@ repositories { } dependencies { - implementation 'org.slf4j:slf4j-api:1.7.26' - implementation 'com.fasterxml.jackson.core:jackson-databind:2.10.2' - implementation 'org.jasypt:jasypt:1.9.2' - runtimeOnly 'org.slf4j:slf4j-simple:1.6.4' + implementation 'org.slf4j:slf4j-api:1.7.31' + implementation 'com.fasterxml.jackson.core:jackson-databind:2.12.3' + implementation 'org.jasypt:jasypt:1.9.3' + runtimeOnly 'org.slf4j:slf4j-simple:1.7.31' testImplementation "junit:junit:$junitVersion" } diff --git a/gradle.properties b/gradle.properties index 9bd04cb..722cd1f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,2 @@ -junitVersion=4.12 -artifactVersion=1.1.0 +junitVersion=4.13.2 +artifactVersion=1.1.1 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 87b738c..5c2d1cf 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 4550030..0ebb310 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Mon May 13 17:09:22 AEST 2019 -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6-all.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index af6708f..83f2acf 100755 --- a/gradlew +++ b/gradlew @@ -1,5 +1,21 @@ #!/usr/bin/env sh +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + ############################################################################## ## ## Gradle start up script for UN*X @@ -28,7 +44,7 @@ APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m"' +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" @@ -109,8 +125,8 @@ if $darwin; then GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` JAVACMD=`cygpath --unix "$JAVACMD"` diff --git a/gradlew.bat b/gradlew.bat index 6d57edc..24467a1 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,84 +1,100 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/launcher-scripts/Windows-launcher.bat b/launcher-scripts/Windows-launcher.bat index 1f21924..f8bb1db 100755 --- a/launcher-scripts/Windows-launcher.bat +++ b/launcher-scripts/Windows-launcher.bat @@ -1,7 +1,7 @@ @echo off -set OLD_JAVA_HOME=%JAVA_HOME% -set BAT_DIRECTORY=%~dp0 -set JAVA_HOME=%BAT_DIRECTORY%jdk8u242-b08-jre +set OLD_JAVA_HOME="%JAVA_HOME%" +set "BAT_DIRECTORY=%~dp0" +set "JAVA_HOME=%BAT_DIRECTORY%jdk8u242-b08-jre" start "Admin console launcher" /D "%BAT_DIRECTORY%\libs" "%JAVA_HOME%\bin\javaw" -DLAUNCHER_JAVA_PATH="%JAVA_HOME%\bin\java" -jar admin.jar -set JAVA_HOME=%OLD_JAVA_HOME% -set OLD_JAVA_HOME= +set JAVA_HOME="%OLD_JAVA_HOME%" +set OLD_JAVA_HOME=""