From 5152c3f9dd4a0a93306740da58192a36baa0fbec Mon Sep 17 00:00:00 2001 From: Florian Ehrenstorfer Date: Tue, 25 Feb 2025 16:03:33 +0100 Subject: [PATCH] update mail config #248 --- server/application-server/compose.yaml | 2 +- .../src/main/resources/application-prod.yml | 18 ++++++++++++++++++ .../src/main/resources/application.yml | 13 +++++++------ 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/server/application-server/compose.yaml b/server/application-server/compose.yaml index 9b79c3bad..07dfefcd6 100644 --- a/server/application-server/compose.yaml +++ b/server/application-server/compose.yaml @@ -38,7 +38,7 @@ services: restart: unless-stopped volumes: - ./postfix-config:/config # See https://github.com/ls1admin/postfix-container-tum-mailrelay/tree/main for details - hostname: hephaestus.aet.cit.tum.de + hostname: ${APP_HOSTNAME:localhost} networks: - app-network diff --git a/server/application-server/src/main/resources/application-prod.yml b/server/application-server/src/main/resources/application-prod.yml index e06ca2557..e20c40a64 100644 --- a/server/application-server/src/main/resources/application-prod.yml +++ b/server/application-server/src/main/resources/application-prod.yml @@ -13,6 +13,19 @@ spring: jwt: issuer-uri: ${KEYCLOAK_URL}/realms/${KEYCLOAK_REALM} + mail: + host: ${POSTFIX_HOST:localhost} + port: ${POSTFIX_PORT:25} + username: ${POSTFIX_USERNAME:} + password: ${POSTFIX_PASSWORD:} + properties: + mail: + transport: + protocol: smtp + smtp: + starttls: + enable: true + hephaestus: host-url: ${APPLICATION_HOST_URL} @@ -30,6 +43,11 @@ hephaestus: intelligence-service: url: ${INTELLIGENCE_SERVICE_URL} + mail: + enabled: ${MAIL_ENABLED:false} + sender: ${MAIL_SENDER:} + signature: ${MAIL_SIGNATURE:} + keycloak: url: ${KEYCLOAK_URL} realm: ${KEYCLOAK_REALM} diff --git a/server/application-server/src/main/resources/application.yml b/server/application-server/src/main/resources/application.yml index d2762ea85..84740bd34 100644 --- a/server/application-server/src/main/resources/application.yml +++ b/server/application-server/src/main/resources/application.yml @@ -34,10 +34,10 @@ spring: suffix: .html mail: - host: ${POSTFIX_HOST:localhost} - port: ${POSTFIX_PORT:25} - username: ${POSTFIX_USERNAME:} - password: ${POSTFIX_PASSWORD:} + host: smtp.gmail.com + port: 587 + username: ${POSTFIX_USERNAME:} # gmail email address e.g hephaestus@gmail.com + password: ${POSTFIX_PASSWORD:} # app code password from gmail. how to: https://support.google.com/mail/answer/185833?hl=en properties: mail: transport: @@ -45,6 +45,7 @@ spring: smtp: starttls: enable: true + debug: true springdoc: default-produces-media-type: application/json @@ -73,8 +74,8 @@ hephaestus: # Eviction rate in milliseconds (1 hour) evict-rate: 3600000 mail: - enabled: ${MAIL_ENABLED:true} - sender: ${MAIL_SENDER:test@hephaestus.ase.cit.tum.de} + enabled: false + sender: ${MAIL_SENDER:} signature: ${MAIL_SIGNATURE:} keycloak: