From aed5ea80ac32441a7c141ffffdb18f6263d832df Mon Sep 17 00:00:00 2001 From: Claas Date: Wed, 20 May 2026 12:46:13 +0000 Subject: [PATCH] Remove hardcoded testing JWT secret --- server/.env.example | 1 + server/.gitignore | 6 ++++++ server/src/main/resources/application.properties | 6 +++--- 3 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 server/.env.example diff --git a/server/.env.example b/server/.env.example new file mode 100644 index 0000000..536caab --- /dev/null +++ b/server/.env.example @@ -0,0 +1 @@ +APP_JWT_SECRET=replace-with-a-base64-or-raw-dev-secret diff --git a/server/.gitignore b/server/.gitignore index 667aaef..20356be 100644 --- a/server/.gitignore +++ b/server/.gitignore @@ -31,3 +31,9 @@ build/ ### VS Code ### .vscode/ + +# Local environment overrides +.env +.env.local +.env.* +!.env.example diff --git a/server/src/main/resources/application.properties b/server/src/main/resources/application.properties index 147017f..b194b27 100644 --- a/server/src/main/resources/application.properties +++ b/server/src/main/resources/application.properties @@ -1,11 +1,11 @@ spring.application.name=yealch +spring.config.import=optional:file:.env[.properties] # Enables H2 console to view database tables at http://localhost:8080/h2-console spring.h2.console.enabled=true spring.datasource.url=jdbc:h2:mem:testdb spring.datasource.username=sa spring.datasource.password= -#TODO: read from environment (file) -# Base64-encoded dev secret for JWT signing. Replace for production. -app.jwt.secret=YWVhbGNoLWRldi1zZWNyZXQtZm9yLWp3dC1hdXRoLXNvLXNoYXJlLXRoaXMtY29tcHV0ZXItMzI= +# JWT signing secret must be provided externally, for example via APP_JWT_SECRET. +app.jwt.secret=${APP_JWT_SECRET} app.jwt.expiration-minutes=60 \ No newline at end of file -- knotmirror 0.0.1