From 48a59e50d94655d594be9565d9745fa07f5423cf Mon Sep 17 00:00:00 2001 From: Daniel McCoy Stephenson Date: Fri, 10 Nov 2023 10:17:49 -0700 Subject: [PATCH 1/4] Added image documentation to `docs/dockerhub.md` --- docs/dockerhub.md | 54 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 docs/dockerhub.md diff --git a/docs/dockerhub.md b/docs/dockerhub.md new file mode 100644 index 0000000..08000c5 --- /dev/null +++ b/docs/dockerhub.md @@ -0,0 +1,54 @@ +# jpo-security-svcs + +## GitHub Repository Link +https://github.com/usdot-jpo-ode/jpo-security-svcs + +## Purpose +The purpose of the jpo-security-svcs program is to provide a REST endpoint for signing TIMs. + +## How to pull the latest image +The latest image can be pulled using the following command: +> docker pull usdotjpoode/jpo-security-svcs:latest + +## Required environment variables +- SEC_USE_CERTIFICATES + +## Expected files/directories +The following should get mounted when running the container: +- creds/ +- cert.jks +- logback.xml + +## Direct Dependencies +None + +## Indirect Dependencies +The SEC will not receive messages to process if the ODE is not running. + +## Example docker-compose.yml with direct dependencies: +``` +version: '3' +services: + sec: + image: usdotjpoode/jpo-security-svcs:release_q3 + ports: + - "8090:8090" + environment: + SEC_CRYPTO_SERVICE_BASE_URI: ${SEC_CRYPTO_SERVICE_BASE_URI} + SEC_CRYPTO_SERVICE_ENDPOINT_SIGN_PATH: ${SEC_CRYPTO_SERVICE_ENDPOINT_SIGN_PATH} + SEC_USE_CERTFICATES: ${SEC_USE_CERTFICATES} + SEC_KEY_STORE_PASSWORD: ${SEC_KEY_STORE_PASSWORD} + volumes: + - ./creds:/usr/local/share/ca-certificates + - ./cert.jks:/home/cert.jks + - ./logback.xml:/home/logback.xml + command: sh -c "update-ca-certificates && java -Dlogback.configurationFile=/home/logback.xml -jar /home/jpo-security-svcs.jar" + logging: + options: + max-size: "10m" + max-file: "5" +``` + +## Expected startup output +The latest line in the logs should look like this: +> jpo-security-svcs-sec-1 | 2023-11-09 18:09:35 [main] INFO Application - Started Application in 2.569 seconds (JVM running for 3.274) From c8e063cc11c3a22422683112f43cfff0985654b3 Mon Sep 17 00:00:00 2001 From: Marc Wodahl Date: Wed, 3 Jan 2024 10:19:15 -0700 Subject: [PATCH 2/4] Update Dockerfile, pom.xml --- Dockerfile | 4 ++-- pom.xml | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4218f9f..42a7dd9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM maven:3.5.4-jdk-8-alpine as builder +FROM maven:3.8-eclipse-temurin-21-alpine as builder WORKDIR /home COPY ./pom.xml . @@ -6,7 +6,7 @@ COPY ./src ./src RUN mvn clean package -FROM eclipse-temurin:11-jre-alpine +FROM eclipse-temurin:21-jre-alpine RUN apk update RUN apk add ca-certificates diff --git a/pom.xml b/pom.xml index c150201..2df27b3 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ org.springframework.boot spring-boot-starter-parent - 1.4.1.RELEASE + 3.1.3 @@ -49,6 +49,7 @@ org.json json + 20231013 org.springframework.boot @@ -61,14 +62,14 @@ 4.5.3 - javax.xml.bind - jaxb-api - 2.3.1 + jakarta.xml.bind + jakarta.xml.bind-api + 4.0.0 - 1.8 + 21 From 129736131108078fb99912f27e065ec05879a499 Mon Sep 17 00:00:00 2001 From: Daniel McCoy Stephenson Date: Thu, 25 Jan 2024 13:46:23 -0700 Subject: [PATCH 3/4] Removed an unnecessary comment from docker-compose.yml --- docker-compose.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index ccc8db4..e64d62f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,3 @@ -# DOCKER_SHARED_VOLUME_WINDOWS should be defined for Windows host machine as C: and not defined for Linux hosts - version: '3' services: sec: From 86df869044329143a45b50f49ef672500e7fd0e4 Mon Sep 17 00:00:00 2001 From: Daniel McCoy Stephenson Date: Fri, 26 Jan 2024 13:34:47 -0700 Subject: [PATCH 4/4] Modified java version in `ci.yml` --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 08c3248..38c99af 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,7 @@ jobs: jpo-security-svcs: runs-on: ubuntu-latest container: - image: openjdk:17-jdk-slim-buster + image: maven:3.8-eclipse-temurin-21-alpine options: --user root steps: - name: Checkout ${{ github.event.repository.name }} @@ -18,7 +18,7 @@ jobs: maven-version: 3.8.2 - uses: actions/setup-java@v3 with: - java-version: '11' + java-version: '21' distribution: 'temurin' - name: Build run: |