diff --git a/.gitignore b/.gitignore index 2be9b02..6b325ba 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,8 @@ build/ !**/src/main/**/build/ !**/src/test/**/build/ +bindings/ca-certificates/*.pem + ### STS ### .apt_generated .classpath diff --git a/README.md b/README.md index 3bccf3e..36dc2fc 100644 --- a/README.md +++ b/README.md @@ -199,6 +199,35 @@ Diese Anwendung ist auch als Docker-Image verfügbar: https://github.com/CCC-MF/ ./gradlew bootBuildImage ``` +### Integration eines eigenen Root CA Zertifikats + +Wird eine eigene Root CA verwendet, die nicht offiziell signiert ist, wird es zu Problemen beim SSL-Handshake kommen, wenn z.B. gPAS zur Generierung von Pseudonymen verwendet wird. + +Hier bietet es sich an, das Root CA Zertifikat in das Image zu integrieren. + +#### Integration beim Bauen des Images + +Hier muss die Zeile `"BP_EMBED_CERTS" to "true"` in der Datei `build.gradle.kts` verwendet werden und darf nicht als Kommentar verwendet werden. + +Die PEM-Datei mit dem/den Root CA Zertifikat(en) muss dabei im vorbereiteten Verzeichnis [`bindings/ca-certificates`](bindings/ca-certificates) enthalten sein. + +#### Integration zur Laufzeit + +Hier muss die Umgebungsvariable `SERVICE_BINDING_ROOT` z.B. auf den Wert `/bindings` gesetzt sein. +Zudem muss ein Verzeichnis `bindings/ca-certificates` - analog zum Verzeichnis [`bindings/ca-certificates`](bindings/ca-certificates) mit einer PEM-Datei als Docker-Volume eingebunden werden. + +Beispiel für Docker-Compose: + +``` +... + environment: + SERVICE_BINDING_ROOT: /bindings + ... + volumes: + - "/path/to/bindings/ca-certificates/:/bindings/ca-certificates/:ro" +... +``` + ## Deployment *Ausführen als Docker Container:* diff --git a/bindings/ca-certificates/README.md b/bindings/ca-certificates/README.md new file mode 100644 index 0000000..709f488 --- /dev/null +++ b/bindings/ca-certificates/README.md @@ -0,0 +1,5 @@ +# Hinweis für Root CA Zertifikate + +PEM-Datei(en) in diesem Verzeichnis ablegen. + +Die Datei `type` gibt dabei an, dass hier CA Zertifikate zu finden sind. diff --git a/bindings/ca-certificates/type b/bindings/ca-certificates/type new file mode 100644 index 0000000..54619ed --- /dev/null +++ b/bindings/ca-certificates/type @@ -0,0 +1 @@ +ca-certificates \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index ea727c4..9ee6e63 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -113,7 +113,14 @@ task("integrationTest") { tasks.named("bootBuildImage") { imageName.set("ghcr.io/ccc-mf/etl-processor") + // Binding for CA Certs + bindings.set(listOf( + "$rootDir/bindings/ca-certificates/:/platform/bindings/ca-certificates" + )) + environment.set(environment.get() + mapOf( + // Enable this line to embed CA Certs into image on build time + //"BP_EMBED_CERTS" to "true", "BP_OCI_SOURCE" to "https://github.com/CCC-MF/etl-processor", "BP_OCI_LICENSES" to "AGPLv3", "BP_OCI_DESCRIPTION" to "ETL Processor for bwHC MTB files"