Skip to content

Commit

Permalink
Add smtp environment variables for user and password
Browse files Browse the repository at this point in the history
  • Loading branch information
dersmon committed Jun 11, 2024
1 parent 263a179 commit 6a668f0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ ARACHNE_BACKEND_IMAGE_VERSION=latest
DB_ROOT_PASSWORD=
DB_PASSWORD=

SMTP_USER_NAME=
SMTP_USER_PASSWORD=

SERVER_ADDRESS=

ARCHAEOCLOUD_PATH=/mnt/cephfs/archaeocloud/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ public class MailService {
public MailService(final @Value("${mailSMTPServer}") String smtpServer
, final @Value("${mailSender}") String sender) {

String smtpUserName = System.getenv("SMTP_USER_NAME");
String smtpUserPassword = System.getenv("SMTP_USER_PASSWORD");

mailSender.setHost(smtpServer);
mailSender.setUsername(smtpUserName);
mailSender.setPassword(smtpUserPassword);
this.sender = sender;
}

Expand Down
4 changes: 2 additions & 2 deletions backend/src/main/resources/config/application.properties.dev
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ imageResolutionHIGH=0
imageCacheDir=/tmp/arachne4ImageCache/

# MailService
mailSMTPServer=smtp.uni-koeln.de
[email protected]
mailSender=idai.objects@dainst.de
mailSMTPServer=mail.dainst

# transl8
transl8Url=https://arachne.dainst.org/transl8/translation/json?application=arachne4_backend
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ services:
- "DB_SERVER=${SERVER_ADDRESS}:3306"
- "DB_PASSWORD=${DB_PASSWORD}"
- "SERVER_ADDRESS=${SERVER_ADDRESS}"
- "SMTP_USER_NAME=${SMTP_USER_NAME}"
- "SMTP_USER_PASSWORD=${SMTP_USER_PASSWORD}"
- "IIPIMAGE_SERVER=frontend"
- "ELASTICSEARCH_SERVER=elasticsearch"
volumes:
Expand Down

0 comments on commit 6a668f0

Please sign in to comment.