From ba40aba5790a457f42dfe90a945444396b3a8ef4 Mon Sep 17 00:00:00 2001 From: Francisco J Lopez-Pellicer Date: Thu, 4 Jul 2024 00:43:40 +0200 Subject: [PATCH] Bug #3: Refactor environment variables - Remove overwritten defaults of application-dev.yml - Use upper case environment properties in docker-compose.yml; update README.md where required - Add restart always in docker-compose.yml - Make explicit secret in backend and proxy are the same --- README.md | 2 +- back/backend/config/application-dev.yml | 6 ------ docker-compose.yml | 15 ++++++++------- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 51e4c59..27a7808 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ The SITMUN Application Stack uses Docker Compose to define the services, specifi ### Configuration Notes -For testing purposes, the use of the `proxy` is controlled by the `sitmun.proxy.force` environment variable in `backend`, which by default is `true`. +For testing purposes, the use of the `proxy` is controlled by the `SITMUN_PROXY_FORCE` environment variable in `backend`, which by default is `true`. Data is stored in the `pgdata` volume, which is used by the `postgres` service. diff --git a/back/backend/config/application-dev.yml b/back/backend/config/application-dev.yml index e5b1f99..437493a 100644 --- a/back/backend/config/application-dev.yml +++ b/back/backend/config/application-dev.yml @@ -33,9 +33,6 @@ spring: indent-output: true datasource: type: com.zaxxer.hikari.HikariDataSource - url: ${JDBC_DATABASE_URL} - username: ${JDBC_DATABASE_USERNAME} - password: ${JDBC_DATABASE_PASSWORD} hikari: poolName: Hikari auto-commit: false @@ -60,8 +57,6 @@ security: jwt: secret: 9ef80c644166846897f6a87d3cf6ab204d144229 token-validity-in-miliseconds: 36000000 - middleware: - secret: 9ef80c644166846897f6a87d3cf6ab204d144229 ldap: host: ldap://localhost:1389 base_dn: dc=example,dc=com @@ -83,4 +78,3 @@ sitmun: cartographies-by-created-date.size: 30 #last days users-by-created-date.size: 30 # last days users-per-application.size: 30 # last days - diff --git a/docker-compose.yml b/docker-compose.yml index 58e1499..e85b9e2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ services: front: - build: - context: ./front + build: ./front + restart: always ports: - "9000:80" environment: @@ -14,6 +14,7 @@ services: backend: build: ./back/backend + restart: always ports: - "9001:8080" depends_on: @@ -22,15 +23,15 @@ services: - SPRING_DATASOURCE_URL=jdbc:postgresql://persistence:5432/sitmun3 - SPRING_DATASOURCE_USERNAME=sitmun3 - SPRING_DATASOURCE_PASSWORD=sitmun3 - - spring.datasource.driver-class-name=org.postgresql.Driver - - sitmun.proxy.force=true - - sitmun.proxy.url=http://localhost:9000/middleware + - SITMUN_PROXY_FORCE=true + - SITMUN_PROXY_URL=http://localhost:9000/middleware + - SECURITY_AUTHENTICATION_MIDDLEWARE_SECRET=9ef80c644166846897f6a87d3cf6ab204d144229 volumes: - ./back/backend/config:/usr/src/config proxy: - build: - context: ./back/proxy + build: ./back/proxy + restart: always ports: - "9002:8080" depends_on: