Skip to content
Snippets Groups Projects
Verified Commit 7830e2b3 authored by Martin Weise's avatar Martin Weise
Browse files

Use gateway

parent 558a3afa
Branches
Tags
1 merge request!374Bumped version of DBRepo
...@@ -40,6 +40,10 @@ upstream dashboard-service { ...@@ -40,6 +40,10 @@ upstream dashboard-service {
server dashboard-service:3000; server dashboard-service:3000;
} }
upstream auth-service {
server auth-service:8080;
}
server { server {
listen 8080 default_server; listen 8080 default_server;
server_name _; server_name _;
...@@ -67,6 +71,26 @@ server { ...@@ -67,6 +71,26 @@ server {
proxy_read_timeout 90; proxy_read_timeout 90;
} }
# Proxy Keycloak OIDC connections, c.f. https://www.keycloak.org/server/reverseproxy#_exposed_path_recommendations
location /realms {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://auth-service;
proxy_read_timeout 90;
}
# Proxy Keycloak assets, c.f. https://www.keycloak.org/server/reverseproxy#_exposed_path_recommendations
location /resources {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://auth-service;
proxy_read_timeout 90;
}
location /api/search { location /api/search {
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
......
...@@ -3,19 +3,19 @@ import vuetify from 'vite-plugin-vuetify' ...@@ -3,19 +3,19 @@ import vuetify from 'vite-plugin-vuetify'
const proxy: any = {} const proxy: any = {}
// /* proxies the backend calls, >>NOT<< the frontend calls (clicking) */ /* proxies the backend calls, >>NOT<< the frontend calls */
// if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
// const api = 'http://localhost' const api = 'http://localhost'
// proxy['/api'] = api proxy['/api'] = api
// proxy['/pid'] = { proxy['/pid'] = {
// target: api + '/api', target: api + '/api',
// changeOrigin: true, changeOrigin: true,
// pathRewrite: { pathRewrite: {
// '^/pid': '/pid' '^/pid': '/pid'
// } }
// } }
// process.env.NUXT_PUBLIC_API_SERVER = api process.env.NUXT_PUBLIC_API_SERVER = api
// } }
/** /**
* https://nuxt.com/docs/guide/concepts/rendering#hybrid-rendering * https://nuxt.com/docs/guide/concepts/rendering#hybrid-rendering
...@@ -111,15 +111,15 @@ export default defineNuxtConfig({ ...@@ -111,15 +111,15 @@ export default defineNuxtConfig({
providers: { providers: {
keycloak: { keycloak: {
audience: 'account', audience: 'account',
baseUrl: 'http://localhost:8080/realms/dbrepo', baseUrl: 'http://localhost/realms/dbrepo',
clientId: 'dbrepo-client', clientId: 'dbrepo-client',
clientSecret: '', // inject on runtime clientSecret: '', // inject on runtime
scope: ['openid', 'roles'], scope: ['openid', 'roles'],
optionalClaims: ['realm_access'], optionalClaims: ['realm_access'],
redirectUri: 'http://localhost:3001/auth/keycloak/callback', redirectUri: 'http://localhost/auth/keycloak/callback',
userNameClaim: 'preferred_username', userNameClaim: 'preferred_username',
exposeAccessToken: true, exposeAccessToken: true,
logoutRedirectUri: 'http://localhost:3001', logoutRedirectUri: 'http://localhost',
}, },
}, },
middleware: { middleware: {
......
...@@ -335,7 +335,7 @@ services: ...@@ -335,7 +335,7 @@ services:
NUXT_PUBLIC_API_CLIENT: "${BASE_URL:-http://localhost}" NUXT_PUBLIC_API_CLIENT: "${BASE_URL:-http://localhost}"
NUXT_PUBLIC_API_SERVER: "${BASE_URL:-http://gateway-service}" NUXT_PUBLIC_API_SERVER: "${BASE_URL:-http://gateway-service}"
NUXT_PUBLIC_UPLOAD_CLIENT: "${BASE_URL:-http://localhost}/api/upload/files" NUXT_PUBLIC_UPLOAD_CLIENT: "${BASE_URL:-http://localhost}/api/upload/files"
NUXT_OIDC_PROVIDERS_KEYCLOAK_BASE_URL: "${BASE_URL:-http://localhost:8080}/realms/dbrepo" NUXT_OIDC_PROVIDERS_KEYCLOAK_BASE_URL: "${BASE_URL:-http://localhost}/realms/dbrepo"
NUXT_OIDC_PROVIDERS_KEYCLOAK_CLIENT_ID: "${AUTH_SERVICE_CLIENT:-dbrepo-client}" NUXT_OIDC_PROVIDERS_KEYCLOAK_CLIENT_ID: "${AUTH_SERVICE_CLIENT:-dbrepo-client}"
NUXT_OIDC_PROVIDERS_KEYCLOAK_CLIENT_SECRET: "${AUTH_SERVICE_CLIENT:-MUwRc7yfXSJwX8AdRMWaQC3Nep1VjwgG}" NUXT_OIDC_PROVIDERS_KEYCLOAK_CLIENT_SECRET: "${AUTH_SERVICE_CLIENT:-MUwRc7yfXSJwX8AdRMWaQC3Nep1VjwgG}"
NUXT_OIDC_PROVIDERS_KEYCLOAK_REDIRECT_URI: "${BASE_URL:-http://localhost}/auth/keycloak/callback" NUXT_OIDC_PROVIDERS_KEYCLOAK_REDIRECT_URI: "${BASE_URL:-http://localhost}/auth/keycloak/callback"
......
...@@ -39,6 +39,24 @@ data: ...@@ -39,6 +39,24 @@ data:
proxy_read_timeout 90; proxy_read_timeout 90;
} }
location /realms {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://auth-service;
proxy_read_timeout 90;
}
location /resources {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://auth-service;
proxy_read_timeout 90;
}
location /api/search { location /api/search {
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
......
...@@ -22,4 +22,9 @@ stringData: ...@@ -22,4 +22,9 @@ stringData:
NUXT_PUBLIC_PID_DEFAULT_PUBLISHER: "{{ .Values.ui.public.pid.default.publisher }}" NUXT_PUBLIC_PID_DEFAULT_PUBLISHER: "{{ .Values.ui.public.pid.default.publisher }}"
NUXT_PUBLIC_UPLOAD_CLIENT: "{{ .Values.ui.public.upload.client | default $uploadEndpoint }}" NUXT_PUBLIC_UPLOAD_CLIENT: "{{ .Values.ui.public.upload.client | default $uploadEndpoint }}"
NUXT_PUBLIC_BROKER_CONNECTIONS: "{{ include "dbrepo.broker.connections" . }}" NUXT_PUBLIC_BROKER_CONNECTIONS: "{{ include "dbrepo.broker.connections" . }}"
NUXT_OIDC_PROVIDERS_KEYCLOAK_BASE_URL: "{{ .Values.gateway }}/api/auth/realms/dbrepo"
NUXT_OIDC_PROVIDERS_KEYCLOAK_CLIENT_ID: "{{ .Values.authservice.client.id }}"
NUXT_OIDC_PROVIDERS_KEYCLOAK_CLIENT_SECRET: "{{ .Values.authservice.client.secret }}"
NUXT_OIDC_PROVIDERS_KEYCLOAK_REDIRECT_URI: "{{ .Values.gateway }}/auth/keycloak/callback"
NUXT_OIDC_PROVIDERS_KEYCLOAK_LOGOUT_REDIRECT_URI: "{{ .Values.gateway }}"
{{- end }} {{- end }}
...@@ -585,15 +585,17 @@ dataservice: ...@@ -585,15 +585,17 @@ dataservice:
## @param dataservice.containerSecurityContext.seccompProfile.type Set container's Security Context seccomp profile ## @param dataservice.containerSecurityContext.seccompProfile.type Set container's Security Context seccomp profile
type: "RuntimeDefault" type: "RuntimeDefault"
## @param dataservice.resourcesPreset The container resource preset ## @param dataservice.resourcesPreset The container resource preset
resourcesPreset: "large" resourcesPreset: ""
## @param dataservice.resources Set container requests and limits for different resources like CPU or memory (essential for production workloads) ## @param dataservice.resources Set container requests and limits for different resources like CPU or memory (essential for production workloads)
resources: { } resources:
## requests: requests:
## cpu: 250m cpu: 500m
## memory: 64Mi memory: 1024Mi
## limits: ephemeral-storage: 50Mi
## cpu: 500m limits:
## memory: 1024Mi cpu: 1.0
memory: 3072Mi
ephemeral-storage: 2Gi
## @skip dataservice.resources ## @skip dataservice.resources
grant: grant:
## @param dataservice.grant.read The default database permissions for users with read access. ## @param dataservice.grant.read The default database permissions for users with read access.
...@@ -1054,7 +1056,7 @@ gatewayservice: ...@@ -1054,7 +1056,7 @@ gatewayservice:
computeservice: computeservice:
## @param computeservice.endpoint Configure the number of parallel workers with local[n] ## @param computeservice.endpoint Configure the number of parallel workers with local[n]
endpoint: local[2] endpoint: local[1]
## @section Ingress ## @section Ingress
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment