From 286b994254340ff8aff6f0fe0d636b7cfd555204 Mon Sep 17 00:00:00 2001 From: Enzo Bom Date: Sat, 7 Feb 2026 13:07:10 -0300 Subject: [PATCH 1/2] Improve env vars documentation --- .env.example | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.env.example b/.env.example index 178209c..7c41ada 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,2 @@ -# All variables must be defined in your local system - -# Used locally and in Docker environments +# Used locally and in Docker environments: required to set local env vars in your system and in /.env file of BFF module TS_JWT_SECRET="your-secret-key" \ No newline at end of file From 65ff617eda25282ced24dd42b010cc0ba35371c6 Mon Sep 17 00:00:00 2001 From: Enzo Bom Date: Thu, 12 Feb 2026 16:43:48 -0300 Subject: [PATCH 2/2] Improve env vars and their documentation --- .env.example | 11 +++++++++-- .../infrastructure/client/UserClient.java | 4 ++-- src/main/resources/application.properties | 7 ++++--- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.env.example b/.env.example index 7c41ada..ea5a97e 100644 --- a/.env.example +++ b/.env.example @@ -1,2 +1,9 @@ -# Used locally and in Docker environments: required to set local env vars in your system and in /.env file of BFF module -TS_JWT_SECRET="your-secret-key" \ No newline at end of file +############################################ +# Task Scheduler - Task Scheduler module +# Required Environment Variables +# +# Note: use double quotes only if the value contains spaces or starts with '#'. +############################################ + +# Secret key used to sign and verify JWT tokens +TS_JWT_SECRET=your-secret-key \ No newline at end of file diff --git a/src/main/java/com/javanauta/ts/taskscheduler/infrastructure/client/UserClient.java b/src/main/java/com/javanauta/ts/taskscheduler/infrastructure/client/UserClient.java index 127dd6b..637e58b 100644 --- a/src/main/java/com/javanauta/ts/taskscheduler/infrastructure/client/UserClient.java +++ b/src/main/java/com/javanauta/ts/taskscheduler/infrastructure/client/UserClient.java @@ -6,9 +6,9 @@ import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestParam; -@FeignClient(name = "user", url = "${ts.user.service.url}") +@FeignClient(name = "user", url = "${ts.user.service.uri}") public interface UserClient { - @GetMapping("/user") + @GetMapping UserDTO getUserByEmail(@RequestParam("email") String email, @RequestHeader("Authorization") String token); } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 80b5d07..7e5b2e5 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -5,9 +5,10 @@ server.port=8081 spring.data.mongodb.database=ts_task_scheduler -# Env variables set by bff's docker-compose and used in Docker environment only. Default (localhost) used otherwise +# If environment variables are not defined, localhost defaults will be used (currently, these env vars are only set by +# the System repo's docker compose to run the application in Docker) spring.data.mongodb.uri=${SPRING_DATA_MONGODB_URI:mongodb://localhost:27017/ts_task_scheduler} -ts.user.service.url=${TS_USER_SERVICE_URL:localhost:8080} +ts.user.service.uri=${TS_USER_SERVICE_URI:http://localhost:8080/user} -# Must be set locally - used locally and in docker environment (injected in bff's docker-compose) +# Secret key used to sign and verify JWT tokens (injected via environment variables) ts.jwt.secret=${TS_JWT_SECRET}