From 6e049e9852267523d70899b97e25261ebf717868 Mon Sep 17 00:00:00 2001 From: Entwicklung Date: Sun, 8 Dec 2024 21:18:25 +0100 Subject: [PATCH] * fixing setting the correct scheme fro keycloak reoute --- .env | 1 + config/routes.yaml | 4 +++- config/routes/dev/keycloak.yml | 3 --- config/routes/prod/keycloak.yml | 4 ---- config/services.yaml | 4 +++- installOdcDocker.sh | 1 + 6 files changed, 8 insertions(+), 9 deletions(-) delete mode 100644 config/routes/dev/keycloak.yml delete mode 100644 config/routes/prod/keycloak.yml diff --git a/.env b/.env index 126ff163..83f1d6c4 100644 --- a/.env +++ b/.env @@ -15,6 +15,7 @@ ###> symfony/framework-bundle ### APP_ENV=prod +APP_SCHEME=https APP_DEBUG=0 APP_SECRET=8049593567e0d8a5319abd1960f937f3 TRUSTED_PROXIES=0.0.0.0/0 diff --git a/config/routes.yaml b/config/routes.yaml index 02de8665..af453ced 100644 --- a/config/routes.yaml +++ b/config/routes.yaml @@ -8,11 +8,13 @@ connect_keycloak_check: path: /login/keycloak_login/check controller: App\Controller\LoginControllerKeycloak::check + when@prod: connect_keycloak_check: path: /login/keycloak_login/check controller: App\Controller\LoginControllerKeycloak::check - schemes: [https] + schemes: ['%app.scheme%'] + controllers: resource: '../src/Controller/' diff --git a/config/routes/dev/keycloak.yml b/config/routes/dev/keycloak.yml deleted file mode 100644 index 2ef27717..00000000 --- a/config/routes/dev/keycloak.yml +++ /dev/null @@ -1,3 +0,0 @@ -connect_keycloak_check: - path: /login/keycloak_login/check - controller: App\Controller\LoginControllerKeycloak::check \ No newline at end of file diff --git a/config/routes/prod/keycloak.yml b/config/routes/prod/keycloak.yml deleted file mode 100644 index d74b3ee2..00000000 --- a/config/routes/prod/keycloak.yml +++ /dev/null @@ -1,4 +0,0 @@ -connect_keycloak_check: - path: /login/keycloak_login/check - controller: App\Controller\LoginControllerKeycloak::check - schemes: [https] \ No newline at end of file diff --git a/config/services.yaml b/config/services.yaml index 41e8a2a7..bc4e15ef 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -4,7 +4,7 @@ # Put parameters here that don't need to change on each machine where the app is deployed # https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration parameters: - app.path.images: /uploads/images/products + secret: '%env(APP_SECRET)%' akademieEmail: '%env(AKADEMIE_EMAIL)%' defaultEmail: '%env(DEFAULT_EMAIL)%' @@ -15,6 +15,8 @@ parameters: KEYCLOAK_SECRET: '%env(OAUTH_KEYCLOAK_CLIENT_SECRET)%' KEYCLOAK_ID: '%env(OAUTH_KEYCLOAK_CLIENT_ID)%' superAdminRole: '%env(superAdminRole)%' + app.scheme: '%env(APP_SCHEME)%' + app.path.images: /uploads/images/products services: # default configuration for services in *this* file _defaults: diff --git a/installOdcDocker.sh b/installOdcDocker.sh index 9b236ca8..a35ae6fa 100755 --- a/installOdcDocker.sh +++ b/installOdcDocker.sh @@ -121,6 +121,7 @@ export KEYCLOAK_PW=$KEYCLOAK_PW export ODC_DB_PW=$ODC_DB_PW export KEYCLOAK_ADMIN_PW=$KEYCLOAK_ADMIN_PW export registerEmailAdress=$smtpFrom +export APP_SCHEME=$HTTP_METHOD RANDOMTAG=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 10 | head -n 1); export RANDOMTAG