From b52aba415f690a2a00fd7b07dd0be614c3be53a7 Mon Sep 17 00:00:00 2001 From: elb Date: Thu, 3 Feb 2022 14:16:45 +0100 Subject: [PATCH 1/8] add Dockerfile and standalone-ha xml --- Dockerfile | 3 + standalone-ha.xml | 663 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 666 insertions(+) create mode 100644 Dockerfile create mode 100644 standalone-ha.xml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0cd58bb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM jboss/keycloak:16.1.1 +COPY ./target/keycloak-otp-config-spi-1.0-SNAPSHOT-keycloak.jar /opt/jboss/keycloak/standalone/deployments/keycloak-otp-config-spi-1.0-SNAPSHOT-keycloak.jar +COPY ./standalone-ha.xml /opt/jboss/keycloak/standalone/configuration/standalone-ha.xml \ No newline at end of file diff --git a/standalone-ha.xml b/standalone-ha.xml new file mode 100644 index 0000000..e45f735 --- /dev/null +++ b/standalone-ha.xml @@ -0,0 +1,663 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE + h2 + + sa + sa + + + + jdbc:mariadb://${env.DB_ADDR:mariadb}:${env.DB_PORT:3306}/${env.DB_DATABASE:keycloak}${env.JDBC_PARAMS:} + mariadb + + IdleConnections + + + ${env.DB_USER:keycloak} + ${env.DB_PASSWORD:password} + + + SELECT 1 + true + 60000 + + + + + org.h2.jdbcx.JdbcDataSource + + + org.mariadb.jdbc.MySQLDataSource + + + + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + auth + + + classpath:${jboss.home.dir}/providers/* + + + master + 900 + + 2592000 + true + true + ${env.KEYCLOAK_WELCOME_THEME:keycloak} + ${env.KEYCLOAK_DEFAULT_THEME:keycloak} + ${jboss.home.dir}/themes + + + + + + + + + + + + + jpa + + + basic + + + + + + + + + + + + + + + + + + + default + + + + + + + + ${keycloak.jta.lookup.provider:jboss} + + + + + + + + + + + ${keycloak.x509cert.lookup.provider:default} + + + + ${keycloak.hostname.provider:default} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From ce6f13072c1414f32bd749bc2bc575ba7b5ddfbc Mon Sep 17 00:00:00 2001 From: elb-o4b <92034313+elb-o4b@users.noreply.github.com> Date: Thu, 10 Feb 2022 13:47:57 +0100 Subject: [PATCH 2/8] feat: create Dockerfile with custom keycloak jar --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..738f0e2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,2 @@ +FROM jboss/keycloak:16.1.1 +COPY ./keycloak-otp-config-spi-1.0-SNAPSHOT-keycloak.jar /opt/jboss/keycloak/standalone/deployments/keycloak-otp-config-spi-1.0-SNAPSHOT-keycloak.jar From fc9bc33c630e3f628994f7fbab173cdd8f3c6a19 Mon Sep 17 00:00:00 2001 From: Markus Eberl Date: Wed, 16 Mar 2022 14:11:05 +0100 Subject: [PATCH 3/8] feat: remode caritas templates --- .../messages/messages_de.properties | 4 - .../messages/messages_en.properties | 4 - .../templates/html/otp-email.ftl | 82 ------------------- .../templates/text/otp-email.ftl | 2 - 4 files changed, 92 deletions(-) delete mode 100644 src/main/resources/theme-resources/messages/messages_de.properties delete mode 100644 src/main/resources/theme-resources/messages/messages_en.properties delete mode 100644 src/main/resources/theme-resources/templates/html/otp-email.ftl delete mode 100644 src/main/resources/theme-resources/templates/text/otp-email.ftl diff --git a/src/main/resources/theme-resources/messages/messages_de.properties b/src/main/resources/theme-resources/messages/messages_de.properties deleted file mode 100644 index 4135637..0000000 --- a/src/main/resources/theme-resources/messages/messages_de.properties +++ /dev/null @@ -1,4 +0,0 @@ -emailSubject=Ihr Zwei-Faktor-Authentifizierungscode -emailCodeBody={0} -emailTtlBody={0} -emailTextBody=Liebe(r) Benutzer_in,\n\nIhr E-Mail-Code lautet {0} und ist für {1} Minuten gültig.\n\nLiebe Grüße,\nIhr Caritas Team \ No newline at end of file diff --git a/src/main/resources/theme-resources/messages/messages_en.properties b/src/main/resources/theme-resources/messages/messages_en.properties deleted file mode 100644 index f7d8940..0000000 --- a/src/main/resources/theme-resources/messages/messages_en.properties +++ /dev/null @@ -1,4 +0,0 @@ -emailSubject=Your two-factor authentication code -emailCodeBody={0} -emailTtlBody={0} -emailTextBody=Dear User,\n\nYour email code is {0} and is valid for {1} minutes.\n\nBest regards,\nYour Caritas team diff --git a/src/main/resources/theme-resources/templates/html/otp-email.ftl b/src/main/resources/theme-resources/templates/html/otp-email.ftl deleted file mode 100644 index a2fbe85..0000000 --- a/src/main/resources/theme-resources/templates/html/otp-email.ftl +++ /dev/null @@ -1,82 +0,0 @@ - - -
- - - - - - -
- - - - - - - - - - - - - - - - - - - -
-
- -
-
- - - -

- Online-Beratung

-
Online. Anonym. - Sicher. -
-
- -
- -
-
- Liebe(r) Benutzer_in, -

- Ihr E-Mail-Code lautet ${kcSanitize(msg("emailCodeBody",otp))?no_esc} - und ist für ${kcSanitize(msg("emailTtlBody", ttl))?no_esc} Minuten - gültig. -

- Liebe Grüße,
- Ihr Caritas Team -


-
-
-
- - - - - -
-
- Impressum -   |   - Datenschutz -
-
-
- - diff --git a/src/main/resources/theme-resources/templates/text/otp-email.ftl b/src/main/resources/theme-resources/templates/text/otp-email.ftl deleted file mode 100644 index 1bfa088..0000000 --- a/src/main/resources/theme-resources/templates/text/otp-email.ftl +++ /dev/null @@ -1,2 +0,0 @@ -<#ftl output_format="plainText"> -${msg("emailTextBody", otp, ttl)} \ No newline at end of file From 4bfd4b4ff15c892999634ab4d77898aa8bdb369d Mon Sep 17 00:00:00 2001 From: Markus Eberl Date: Wed, 8 Jun 2022 17:18:43 +0200 Subject: [PATCH 4/8] feat: use quarkus keycloak update --- Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0cd58bb..9073fa3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,4 @@ -FROM jboss/keycloak:16.1.1 -COPY ./target/keycloak-otp-config-spi-1.0-SNAPSHOT-keycloak.jar /opt/jboss/keycloak/standalone/deployments/keycloak-otp-config-spi-1.0-SNAPSHOT-keycloak.jar -COPY ./standalone-ha.xml /opt/jboss/keycloak/standalone/configuration/standalone-ha.xml \ No newline at end of file +FROM quay.io/keycloak/keycloak:17.0.0 +COPY ./target/keycloak-otp-config-spi-1.0-SNAPSHOT-keycloak.jar /opt/keycloak/providers/keycloak-otp-config-spi-1.0-SNAPSHOT-keycloak.jar + +ENTRYPOINT /opt/keycloak/bin/kc.sh start --auto-build From 4e9ae766b2372ddb35b81a942b566bb35f506202 Mon Sep 17 00:00:00 2001 From: Markus Eberl Date: Wed, 29 Jun 2022 12:23:29 +0200 Subject: [PATCH 5/8] chore: adapt target --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index cc2111f..f95eebd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,4 @@ FROM quay.io/keycloak/keycloak:17.0.0 -COPY ./target/keycloak-otp-config-spi-1.0-SNAPSHOT-keycloak.jar /opt/keycloak/providers/keycloak-otp-config-spi-1.0-SNAPSHOT-keycloak.jar +COPY target/keycloak-otp-config-spi-1.0-SNAPSHOT-keycloak.jar /opt/keycloak/providers/keycloak-otp-config-spi-1.0-SNAPSHOT-keycloak.jar ENTRYPOINT /opt/keycloak/bin/kc.sh start --auto-build - From b720b8c4506789b999c232a4468dda3d705a324b Mon Sep 17 00:00:00 2001 From: Markus Eberl Date: Wed, 29 Jun 2022 12:28:22 +0200 Subject: [PATCH 6/8] chore: debug path output --- .github/workflows/dockerImage.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/dockerImage.yml b/.github/workflows/dockerImage.yml index 46e5ca9..ef66d93 100644 --- a/.github/workflows/dockerImage.yml +++ b/.github/workflows/dockerImage.yml @@ -50,6 +50,7 @@ jobs: run: | echo "DOCKER_REGISTRY=$(echo "docker.pkg.github.com/${{ github.repository }}" | awk '{print tolower($0)}')" >> $GITHUB_ENV echo "DOCKER_IMAGE=$(echo "${{ github.repository }}" | awk -F / '{print tolower($2)}')" >> $GITHUB_ENV + ls -la shell: bash - name: Push to GitHub Packages uses: docker/build-push-action@v1.1.1 From e41a4265df87afa9164be55c5ea5a8d3a27b1c33 Mon Sep 17 00:00:00 2001 From: Markus Eberl Date: Wed, 29 Jun 2022 12:32:46 +0200 Subject: [PATCH 7/8] chore: correct jar path --- .github/workflows/dockerImage.yml | 1 - Dockerfile | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/dockerImage.yml b/.github/workflows/dockerImage.yml index ef66d93..46e5ca9 100644 --- a/.github/workflows/dockerImage.yml +++ b/.github/workflows/dockerImage.yml @@ -50,7 +50,6 @@ jobs: run: | echo "DOCKER_REGISTRY=$(echo "docker.pkg.github.com/${{ github.repository }}" | awk '{print tolower($0)}')" >> $GITHUB_ENV echo "DOCKER_IMAGE=$(echo "${{ github.repository }}" | awk -F / '{print tolower($2)}')" >> $GITHUB_ENV - ls -la shell: bash - name: Push to GitHub Packages uses: docker/build-push-action@v1.1.1 diff --git a/Dockerfile b/Dockerfile index f95eebd..2c0cf99 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ FROM quay.io/keycloak/keycloak:17.0.0 -COPY target/keycloak-otp-config-spi-1.0-SNAPSHOT-keycloak.jar /opt/keycloak/providers/keycloak-otp-config-spi-1.0-SNAPSHOT-keycloak.jar +COPY keycloak-otp-config-spi-1.0-SNAPSHOT-keycloak.jar /opt/keycloak/providers/keycloak-otp-config-spi-1.0-SNAPSHOT-keycloak.jar ENTRYPOINT /opt/keycloak/bin/kc.sh start --auto-build From 5ab63d716a98ed00623d11943430277e237b52e9 Mon Sep 17 00:00:00 2001 From: Markus Eberl Date: Fri, 12 Aug 2022 10:44:08 +0200 Subject: [PATCH 8/8] chore: remove unused old jboss config --- standalone-ha.xml | 663 ---------------------------------------------- 1 file changed, 663 deletions(-) delete mode 100644 standalone-ha.xml diff --git a/standalone-ha.xml b/standalone-ha.xml deleted file mode 100644 index e45f735..0000000 --- a/standalone-ha.xml +++ /dev/null @@ -1,663 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE - h2 - - sa - sa - - - - jdbc:mariadb://${env.DB_ADDR:mariadb}:${env.DB_PORT:3306}/${env.DB_DATABASE:keycloak}${env.JDBC_PARAMS:} - mariadb - - IdleConnections - - - ${env.DB_USER:keycloak} - ${env.DB_PASSWORD:password} - - - SELECT 1 - true - 60000 - - - - - org.h2.jdbcx.JdbcDataSource - - - org.mariadb.jdbc.MySQLDataSource - - - - - - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - auth - - - classpath:${jboss.home.dir}/providers/* - - - master - 900 - - 2592000 - true - true - ${env.KEYCLOAK_WELCOME_THEME:keycloak} - ${env.KEYCLOAK_DEFAULT_THEME:keycloak} - ${jboss.home.dir}/themes - - - - - - - - - - - - - jpa - - - basic - - - - - - - - - - - - - - - - - - - default - - - - - - - - ${keycloak.jta.lookup.provider:jboss} - - - - - - - - - - - ${keycloak.x509cert.lookup.provider:default} - - - - ${keycloak.hostname.provider:default} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file