From cb363a051563483f6ac79e4f476d3041348c217e Mon Sep 17 00:00:00 2001 From: jhonatapers Date: Tue, 13 May 2025 22:06:19 -0300 Subject: [PATCH] fix: fix application configuration files for production and local environments --- .../src/main/resources/application-dev.yml | 7 +++++ .../src/main/resources/application-local.yml | 13 ++++++++- .../src/main/resources/application-prd.yml | 28 +++++++++++++++++++ .../src/main/resources/application.yml | 10 ++++--- 4 files changed, 53 insertions(+), 5 deletions(-) create mode 100644 infrastructure/src/main/resources/application-prd.yml diff --git a/infrastructure/src/main/resources/application-dev.yml b/infrastructure/src/main/resources/application-dev.yml index 615c1b85..40ceab16 100644 --- a/infrastructure/src/main/resources/application-dev.yml +++ b/infrastructure/src/main/resources/application-dev.yml @@ -16,6 +16,13 @@ postgres: username: ${POSTGRES_USER} password: ${POSTGRES_PASSWORD} +db: + ddl-auto: ${DB_DDL_AUTO} + +reuqest-timeout: ${REQUEST_TIMEOUT} + storage: + max-file-size: ${MAX_FILE_SIZE} + max-request-size: ${MAX_REQUEST_SIZE} file-system: location: ${STORAGE_LOCATION} \ No newline at end of file diff --git a/infrastructure/src/main/resources/application-local.yml b/infrastructure/src/main/resources/application-local.yml index db006c14..3382e121 100644 --- a/infrastructure/src/main/resources/application-local.yml +++ b/infrastructure/src/main/resources/application-local.yml @@ -4,6 +4,10 @@ server: keycloak: realm: callv2 host: http://localhost:8090 + client: + user-api: + client-id: user-api + client-secret: local-client-secret postgres: host: localhost @@ -12,6 +16,13 @@ postgres: username: postgres password: postgres +db: + ddl-auto: none + +reuqest-timeout: 600000 + storage: + max-file-size: 1024MB + max-request-size: 1024MB file-system: - location: /home/jhonatapers/callv2/storage \ No newline at end of file + location: / \ No newline at end of file diff --git a/infrastructure/src/main/resources/application-prd.yml b/infrastructure/src/main/resources/application-prd.yml new file mode 100644 index 00000000..03447535 --- /dev/null +++ b/infrastructure/src/main/resources/application-prd.yml @@ -0,0 +1,28 @@ +server: + port: ${SERVER_PORT} + +keycloak: + realm: ${KEYCLOAK_REALM} + host: ${KEYCLOAK_HOST} + client: + user-api: + client-id: ${KEYCLOAK_CLIENT_ID} + client-secret: ${KEYCLOAK_CLIENT_SECRET} + +postgres: + host: ${POSTGRES_HOST} + port: ${POSTGRES_PORT} + database: ${POSTGRES_DATABASE} + username: ${POSTGRES_USER} + password: ${POSTGRES_PASSWORD} + +db: + ddl-auto: none + +reuqest-timeout: ${REQUEST_TIMEOUT} + +storage: + max-file-size: ${MAX_FILE_SIZE} + max-request-size: ${MAX_REQUEST_SIZE} + file-system: + location: ${STORAGE_LOCATION} \ No newline at end of file diff --git a/infrastructure/src/main/resources/application.yml b/infrastructure/src/main/resources/application.yml index eff8f608..b1b22075 100644 --- a/infrastructure/src/main/resources/application.yml +++ b/infrastructure/src/main/resources/application.yml @@ -8,14 +8,16 @@ server: min-response-size: 1024 spring: + profiles: + active: ${SPRING_PROFILES_ACTIVE:prd} mvc: async: - request-timeout: 600000 + request-timeout: ${reuqest-timeout:30000} servlet: multipart: enabled: true - max-file-size: 10240MB - max-request-size: 10240MB + max-file-size: ${storage.max-file-size:10240MB} + max-request-size: ${storage.max-request-size:10240MB} security: oauth2: resourceserver: @@ -29,5 +31,5 @@ spring: url: jdbc:postgresql://${postgres.host}:${postgres.port}/${postgres.database} jpa: hibernate: - ddl-auto: none + ddl-auto: ${db.ddl-auto} show-sql: true \ No newline at end of file