diff --git a/buildx/docker-bake-multi.hcl b/buildx/docker-bake-multi.hcl deleted file mode 100644 index b4c4047fb..000000000 --- a/buildx/docker-bake-multi.hcl +++ /dev/null @@ -1,9 +0,0 @@ -target "build-container" { - output = ["type=registry"] - platforms = ["linux/amd64", "linux/arm64/v8", "linux/arm/v7"] -} - -target "core" { - output = ["type=registry"] - platforms = ["linux/amd64", "linux/arm64/v8"] -} \ No newline at end of file diff --git a/buildx/docker-bake.hcl b/buildx/docker-bake.hcl index 934a46af8..8a029c901 100644 --- a/buildx/docker-bake.hcl +++ b/buildx/docker-bake.hcl @@ -1,7 +1,11 @@ target "build-container" { output = ["type=docker"] + context = "../build-container" + tags = ["fraunhoferaisec/docker-build:develop"] } target "core" { output = ["type=docker"] + context = "../ids-connector" + tags = ["fraunhoferaisec/trusted-connector-core:develop"] } diff --git a/buildx/docker-buildx.sh b/buildx/docker-buildx.sh index fb04510a2..2071a05b3 100755 --- a/buildx/docker-buildx.sh +++ b/buildx/docker-buildx.sh @@ -21,8 +21,8 @@ if [[ ${PIPESTATUS[0]} -ne 4 ]]; then exit 1 fi -OPTIONS=t:b:f:s -LONGOPTS=base-image:,docker-build-tag:,file:,targets:,skip-build,build-container,fast +OPTIONS=t:b:s +LONGOPTS=base-image:,docker-build-tag:,targets:,platforms:,skip-build,build-container,fast ! PARSED=$(getopt --options=$OPTIONS --longoptions=$LONGOPTS --name "$0" -- "$@") if [[ ${PIPESTATUS[0]} -ne 0 ]]; then @@ -32,30 +32,35 @@ fi eval set -- "$PARSED" -DOCKER_BUILD_TAG_ARG="develop" +DOCKER_BUILD_TAGS="develop" BASE_IMAGE_ARG="gcr.io/distroless/java17-debian11" TARGETS="core" -FILES="" +OUTPUT_TYPE="docker" +BAKE_ARGS="" BUILD_CONTAINER=0 SKIP_BUILD=0 FAST_BUILD=0 while true; do case "$1" in - -f | --file) - FILES="${FILES}-f $2 " - shift 2 - ;; --targets) TARGETS="$2" shift 2 ;; + --platforms) + OUTPUT_TYPE="registry" + for p in $2; do + BAKE_ARGS="$BAKE_ARGS --set='*.platform=$p'" + done + shift 2 + ;; -b | --base-image) BASE_IMAGE_ARG="$2" shift 2 ;; -t | --docker-build-tag) - DOCKER_BUILD_TAG_ARG="$2" + DOCKER_BUILD_TAGS="$DOCKER_BUILD_TAGS $2" + BAKE_ARGS="$BAKE_ARGS --set='*.tags=$2'" shift 2 ;; --build-container) @@ -81,19 +86,22 @@ while true; do esac done +# Complete BAKE_ARGS +BAKE_ARGS="$BAKE_ARGS --set '*.output=type=$OUTPUT_TYPE'" + # Enable experimental Docker features (buildx) export DOCKER_CLI_EXPERIMENTAL="enabled" -# Export vars for buildx bake yaml resolution -export DOCKER_BUILD_TAG="$DOCKER_BUILD_TAG_ARG" +# Export vars for Dockerfile export BASE_IMAGE="$BASE_IMAGE_ARG" + printf "######################################################################\n" -printf "Using build tag \"%s\" and base image \"%s\"\n" "$DOCKER_BUILD_TAG" "$BASE_IMAGE" +printf "Using build tags \"%s\" and base image \"%s\"\n" "$DOCKER_BUILD_TAGS" "$BASE_IMAGE" printf "######################################################################\n\n" if [ $BUILD_CONTAINER = 1 ]; then - echo "Building build-container via \"docker buildx bake build-container ${FILES}$*\"..." - eval "docker buildx bake build-container ${FILES}$*" + echo "Building build-container via \"docker buildx bake build-container${BAKE_ARGS}$*\"..." + eval "docker buildx bake build-container${BAKE_ARGS}$*" exit fi if [ $SKIP_BUILD = 0 ]; then @@ -123,5 +131,5 @@ printf "######################################################################\n printf "Detected project version: %s\n" "$PROJECT_VERSION" printf "######################################################################\n\n" -echo "Building images via \"docker buildx bake $TARGETS ${FILES}$*\"..." -eval "docker buildx bake $TARGETS ${FILES}$*" +echo "Building images via \"docker buildx bake ${TARGETS}${BAKE_ARGS}$*\"..." +eval "docker buildx bake ${TARGETS}${BAKE_ARGS}$*" diff --git a/buildx/docker-compose.yml b/buildx/docker-compose.yml deleted file mode 100644 index b26e6d65b..000000000 --- a/buildx/docker-compose.yml +++ /dev/null @@ -1,14 +0,0 @@ -version: '3' -services: - - # Trusted Connector build container - build-container: - image: fraunhoferaisec/docker-build:${DOCKER_BUILD_TAG:-develop} - build: - context: '../docker-build' - - # Trusted Connector core platform - core: - image: fraunhoferaisec/trusted-connector-core:${DOCKER_BUILD_TAG:-develop} - build: - context: '../ids-connector' \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 23769e502..8da1ffee5 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,12 +1,12 @@ [versions] idscp2 = "0.18.1" -ktlint = "0.48.2" +ktlint = "0.50.0" # Kotlin library/compiler version -kotlin = "1.8.10" -kotlinxCoroutines = "1.6.4" +kotlin = "1.9.20" +kotlinxCoroutines = "1.7.3" # HTTP client -ktor = "2.2.3" +ktor = "2.3.5" # The used version of the infomodel from IESE infomodel = "4.1.3" @@ -17,21 +17,21 @@ jaxbCore = "2.3.0.1" jaxbImpl = "2.3.7" jaxActivation = "1.2.0" -camel = "3.18.5" +camel = "3.18.8" influxDB = "2.23" -guava = "31.1-jre" +guava = "32.1.3-jre" junit4 = "4.13.2" -junit5 = "5.9.2" -mockito = "5.1.1" -mapdb = "3.0.9" -jnrunix = "0.38.19" -protobuf = "3.22.0" +junit5 = "5.10.0" +mockito = "5.7.0" +mapdb = "3.0.10" +jnrunix = "0.38.21" +protobuf = "3.25.0" httpclient = "4.5.14" # Needed for policy reasoning with 2p (formerly tuProlog) tup = "4.1.1" -commonsText = "1.10.0" +commonsText = "1.11.0" protonpack = "1.16" # Needed for ACME module @@ -43,8 +43,8 @@ javaxJson = "1.1.4" dockerJavaApi = "0.0.13" # We will pull in a newer version of jackson because of security fixes -jackson = "2.14.2" -jacksonDatabind = "2.14.2" +jackson = "2.15.3" +jacksonDatabind = "2.15.3" orgJson = "20220320" @@ -52,17 +52,17 @@ orgJson = "20220320" commonsFileUpload = "1.5" # Needed for info model manager -commonsCli = "1.5.0" +commonsCli = "1.6.0" javaxValidation = "2.0.1.Final" # Needed for web console -auth0Jwt = "4.3.0" -swagger = "1.6.9" +auth0Jwt = "4.4.0" +swagger = "1.6.12" jose4j = "0.9.3" -jetty = "9.4.50.v20221201" -springBoot = "3.0.2" -springSecurity = "6.0.2" +jetty = "9.4.53.v20231009" +springBoot = "3.1.5" +springSecurity = "6.1.5" bouncyCastle = "1.70" [libraries] @@ -152,13 +152,13 @@ jaxbImpl = ["jaxb-core", "jaxb-impl"] [plugins] springboot = { id = "org.springframework.boot", version.ref = "springBoot" } -spring-dependencyManagement = { id = "io.spring.dependency-management", version = "1.1.0" } +spring-dependencyManagement = { id = "io.spring.dependency-management", version = "1.1.3" } swagger = { id = "com.benjaminsproule.swagger", version = "1.0.14" } -protobuf = { id = "com.google.protobuf", version = "0.9.2" } +protobuf = { id = "com.google.protobuf", version = "0.9.4" } kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } kotlin-plugin-spring = { id = "org.jetbrains.kotlin.plugin.spring", version.ref = "kotlin" } -spotless = { id = "com.diffplug.spotless", version = "6.15.0" } -licenseReport = { id = "com.github.jk1.dependency-license-report", version = "2.1" } -versions = { id = "com.github.ben-manes.versions", version = "0.46.0" } -buildconfig = { id = "com.github.gmazzo.buildconfig", version = "3.1.0" } +spotless = { id = "com.diffplug.spotless", version = "6.22.0" } +licenseReport = { id = "com.github.jk1.dependency-license-report", version = "2.5" } +versions = { id = "com.github.ben-manes.versions", version = "0.49.0" } +buildconfig = { id = "com.github.gmazzo.buildconfig", version = "4.1.2" } node = { id = "com.github.node-gradle.node", version = "3.5.1" } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 7454180f2..ccebba771 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 f72df95a7..744c64d12 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip +networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 1b6c78733..79a61d421 100755 --- a/gradlew +++ b/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,10 +80,10 @@ do esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit # 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" "-Xms64m"' @@ -143,12 +143,16 @@ fi if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -205,6 +209,12 @@ set -- \ org.gradle.wrapper.GradleWrapperMain \ "$@" +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + # Use "xargs" to parse quoted args. # # With -n1 it outputs one arg per line, with the quotes and backslashes removed. diff --git a/gradlew.bat b/gradlew.bat index ac1b06f93..6689b85be 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 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 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal