From db60287e0a261ad4d2d389a0a8fbcf537a3834d0 Mon Sep 17 00:00:00 2001
From: Martin Weise <martin.weise@tuwien.ac.at>
Date: Wed, 4 Jun 2025 21:49:51 +0200
Subject: [PATCH] Updated the gateway

Signed-off-by: Martin Weise <martin.weise@tuwien.ac.at>
---
 dbrepo-gateway-service/dbrepo.conf     | 9 +++++++++
 helm/dbrepo/files/dbrepo.conf          | 9 +++++++++
 helm/dbrepo/templates/auth-secret.yaml | 2 ++
 3 files changed, 20 insertions(+)

diff --git a/dbrepo-gateway-service/dbrepo.conf b/dbrepo-gateway-service/dbrepo.conf
index 0fcec7824a..9f989dae65 100644
--- a/dbrepo-gateway-service/dbrepo.conf
+++ b/dbrepo-gateway-service/dbrepo.conf
@@ -14,6 +14,15 @@ server {
     listen 8080 default_server;
     server_name _;
 
+    location /admin/ {
+        proxy_set_header        X-Real-IP $remote_addr;
+        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
+        proxy_set_header        X-Forwarded-Host $host;
+        proxy_set_header        X-Forwarded-Proto $scheme;
+        proxy_pass              http://auth-service:8080/;
+        proxy_read_timeout      90;
+    }
+
     location /dashboard/ {
         proxy_set_header        Host $http_host;
         proxy_set_header        X-Real-IP $remote_addr;
diff --git a/helm/dbrepo/files/dbrepo.conf b/helm/dbrepo/files/dbrepo.conf
index e1ed114d1e..935ce4b9b5 100644
--- a/helm/dbrepo/files/dbrepo.conf
+++ b/helm/dbrepo/files/dbrepo.conf
@@ -27,6 +27,15 @@ server {
         autoindex_localtime     on;
     }
 
+    location /admin/ {
+        proxy_set_header        X-Real-IP $remote_addr;
+        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
+        proxy_set_header        X-Forwarded-Host $host;
+        proxy_set_header        X-Forwarded-Proto $scheme;
+        proxy_pass              http://auth-service:8080/;
+        proxy_read_timeout      90;
+    }
+
     location /dashboard/ {
         proxy_set_header        Host $http_host;
         proxy_set_header        X-Real-IP $remote_addr;
diff --git a/helm/dbrepo/templates/auth-secret.yaml b/helm/dbrepo/templates/auth-secret.yaml
index da47194ddf..fd10d3b259 100644
--- a/helm/dbrepo/templates/auth-secret.yaml
+++ b/helm/dbrepo/templates/auth-secret.yaml
@@ -14,6 +14,8 @@ stringData:
   KC_LOG_FILE_LEVEL: "debug"
   KC_LOG_FILE_OUTPUT: "json"
   KEYCLOAK_HOSTNAME: "{{ .Values.gateway }}"
+  KEYCLOAK_HOSTNAME_ADMIN: "{{ .Values.gateway }}/admin/"
+  KEYCLOAK_PROXY_HEADERS: "xforwarded"
   LDAP_ROOT: "{{ .Values.identityservice.global.ldapDomain }}"
   LDAP_ADMIN_DN: "cn={{ .Values.identityservice.global.adminUser }},{{ .Values.identityservice.global.ldapDomain }}"
   LDAP_ADMIN_PASSWORD: "{{ .Values.identityservice.global.adminPassword }}"
-- 
GitLab