From 8d42254ac74b0401d77426885ee69e5defb037a3 Mon Sep 17 00:00:00 2001 From: Denis Lugowski Date: Sun, 16 Nov 2025 08:56:38 +0100 Subject: [PATCH] fix(fullstack): Use platform linux/amd64 for image building, some env var fixes --- .gitea/workflows/backend.yaml | 1 + .gitea/workflows/frontend.yaml | 1 + .../src/main/resources/application.yaml | 13 +++++------ legalconsenthub/nuxt.config.ts | 3 ++- .../server/api/jwt/refresh.post.ts | 23 ++++++++----------- 5 files changed, 20 insertions(+), 21 deletions(-) diff --git a/.gitea/workflows/backend.yaml b/.gitea/workflows/backend.yaml index c807b00..6e2f63a 100644 --- a/.gitea/workflows/backend.yaml +++ b/.gitea/workflows/backend.yaml @@ -100,6 +100,7 @@ jobs: context: . file: ./legalconsenthub-backend/Dockerfile push: ${{ gitea.event_name == 'push' && gitea.ref == 'refs/heads/main' }} + platforms: linux/amd64 tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/.gitea/workflows/frontend.yaml b/.gitea/workflows/frontend.yaml index 670212f..fc3c7dc 100644 --- a/.gitea/workflows/frontend.yaml +++ b/.gitea/workflows/frontend.yaml @@ -94,6 +94,7 @@ jobs: context: . file: ./legalconsenthub/Dockerfile push: ${{ gitea.event_name == 'push' && gitea.ref == 'refs/heads/main' }} + platforms: linux/amd64 tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/legalconsenthub-backend/src/main/resources/application.yaml b/legalconsenthub-backend/src/main/resources/application.yaml index 29e183a..93288c5 100644 --- a/legalconsenthub-backend/src/main/resources/application.yaml +++ b/legalconsenthub-backend/src/main/resources/application.yaml @@ -3,11 +3,10 @@ spring: name: legalconsenthub datasource: - hikari: - auto-commit: false - url: jdbc:h2:mem:legalconsenthub-database - username: user - password: pw + auto-commit: false + url: ${LEGALCONSENTHUB_DB_URL} + username: ${LEGALCONSENTHUB_DB_APP_USER} + password: ${LEGALCONSENTHUB_DB_PASSWORD} jpa: show-sql: true @@ -36,5 +35,5 @@ spring: oauth2: resourceserver: jwt: - issuer-uri: http://localhost:7080/realms/legalconsenthub - jwk-set-uri: http://localhost:7080/realms/legalconsenthub/protocol/openid-connect/certs + issuer-uri: ${SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_ISSUER_URI} + jwk-set-uri: ${SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_JWK_SET_URI} diff --git a/legalconsenthub/nuxt.config.ts b/legalconsenthub/nuxt.config.ts index 5095d15..42d7ad8 100644 --- a/legalconsenthub/nuxt.config.ts +++ b/legalconsenthub/nuxt.config.ts @@ -6,7 +6,8 @@ export default defineNuxtConfig({ public: { clientProxyBasePath: 'NOT_SET', serverApiBaseUrl: 'NOT_SET', - serverApiBasePath: 'NOT_SET' + serverApiBasePath: 'NOT_SET', + keycloakTokenUrl: 'http://localhost:7080/realms/legalconsenthub/protocol/openid-connect/token' }, oauth: { keycloak: { diff --git a/legalconsenthub/server/api/jwt/refresh.post.ts b/legalconsenthub/server/api/jwt/refresh.post.ts index 2a58d3c..e2f37a3 100644 --- a/legalconsenthub/server/api/jwt/refresh.post.ts +++ b/legalconsenthub/server/api/jwt/refresh.post.ts @@ -11,19 +11,16 @@ export default eventHandler(async (event) => { } try { - const { access_token, refresh_token } = await $fetch( - `http://localhost:7080/realms/legalconsenthub/protocol/openid-connect/token`, - { - method: 'POST', - headers: { 'content-type': 'application/x-www-form-urlencoded' }, - body: new URLSearchParams({ - grant_type: 'refresh_token', - client_id: config.oauth.keycloak.clientId, - client_secret: config.oauth.keycloak.clientSecret, - refresh_token: session.jwt.refreshToken - }).toString() - } - ) + const { access_token, refresh_token } = await $fetch(config.public.keycloakTokenUrl, { + method: 'POST', + headers: { 'content-type': 'application/x-www-form-urlencoded' }, + body: new URLSearchParams({ + grant_type: 'refresh_token', + client_id: config.oauth.keycloak.clientId, + client_secret: config.oauth.keycloak.clientSecret, + refresh_token: session.jwt.refreshToken + }).toString() + }) await setUserSession(event, { jwt: {