Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add smtp configuration options in env file #2503

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,16 @@ SHANOIR_URL_HOST=shanoir-ng-nginx
SHANOIR_VIEWER_OHIF_URL_SCHEME=https
SHANOIR_VIEWER_OHIF_URL_HOST=viewer

# SMTP relay used by shanoir for all outgoing mail
# SMTP infos used by shanoir for all outgoing mail
SHANOIR_SMTP_HOST=localhost
SHANOIR_SMTP_PORT=25
SHANOIR_SMTP_AUTH=false
SHANOIR_SMTP_USERNAME=none
SHANOIR_SMTP_PASSWORD=none
SHANOIR_SMTP_STARTTLS_ENABLE=false
SHANOIR_SMTP_STARTTLS_REQUIRED=false
[email protected]


# Name and e-mail address of the administrator (for signing outgoing e-mails)
[email protected]
Expand Down
11 changes: 9 additions & 2 deletions docker-compose/common/entrypoint_common
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,16 @@ require()
SHANOIR_INSTANCE_NAME) match "$name" '^[^"\\]*$' ;;
SHANOIR_INSTANCE_COLOR) match "$name" '^([A-Za-z]*|#[0-9a-fA-F]{3,6})$' ;;
SHANOIR_KEYCLOAK_ADAPTER_MODE) match "$name" '^(login-required|check-sso)$' ;;
SHANOIR_ADMIN_EMAIL) ;;
SHANOIR_ADMIN_EMAIL) ;;
SHANOIR_ADMIN_NAME) ;;
SHANOIR_SMTP_HOST) ;;
SHANOIR_SMTP_HOST) ;;
SHANOIR_SMTP_PORT) ;;
SHANOIR_SMTP_AUTH) match "$name" '^(true|false)$' ;;
SHANOIR_SMTP_USERNAME) ;;
SHANOIR_SMTP_PASSWORD) ;;
SHANOIR_SMTP_STARTTLS_ENABLE) match "$name" '^(true|false)$' ;;
SHANOIR_SMTP_STARTTLS_REQUIRED) match "$name" '^(true|false)$' ;;
SHANOIR_SMTP_FROM) ;;
SHANOIR_CERTIFICATE_PEM_CRT) ;;
SHANOIR_CERTIFICATE_PEM_KEY) ;;
VIP_URL_SCHEME) match "$name" '^(http|https)$' ;;
Expand Down
8 changes: 6 additions & 2 deletions docker-compose/keycloak/cfg/shanoir-ng-realm.json
Original file line number Diff line number Diff line change
Expand Up @@ -1816,9 +1816,13 @@
},
"smtpServer": {
"host": "SHANOIR_SMTP_HOST",
"auth": "SHANOIR_SMTP_AUTH",
"starttls": "SHANOIR_SMTP_STARTTLS_ENABLE",
"password": "SHANOIR_SMTP_PASSWORD",
"user": "SHANOIR_SMTP_USERNAME",
"from": "SHANOIR_ADMIN_EMAIL",
"fromDisplayName": "SHANOIR_ADMIN_NAME",
"port": "25"
"fromDisplayName": "SHANOIR_SMTP_FROM",
"port": "SHANOIR_SMTP_PORT"
},
"loginTheme": "shanoir-theme",
"eventsEnabled": false,
Expand Down
12 changes: 12 additions & 0 deletions docker-compose/keycloak/entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ require SHANOIR_ADMIN_EMAIL
require SHANOIR_ADMIN_NAME
optional SHANOIR_PREFIX
require SHANOIR_SMTP_HOST
require SHANOIR_SMTP_PORT
require SHANOIR_SMTP_AUTH
require SHANOIR_SMTP_USERNAME
require SHANOIR_SMTP_PASSWORD
require SHANOIR_SMTP_STARTTLS_ENABLE
require SHANOIR_SMTP_FROM
require SHANOIR_URL_SCHEME
require SHANOIR_URL_HOST
require SHANOIR_VIEWER_OHIF_URL_SCHEME
Expand All @@ -17,6 +23,12 @@ mkdir -p /tmp/import
sed " s/SHANOIR_ADMIN_NAME/$SHANOIR_ADMIN_NAME/g
s/SHANOIR_ADMIN_EMAIL/$SHANOIR_ADMIN_EMAIL/g
s/SHANOIR_SMTP_HOST/$SHANOIR_SMTP_HOST/g
s/SHANOIR_SMTP_PORT/$SHANOIR_SMTP_PORT/g
s/SHANOIR_SMTP_AUTH/$SHANOIR_SMTP_AUTH/g
s/SHANOIR_SMTP_USERNAME/$SHANOIR_SMTP_USERNAME/g
s/SHANOIR_SMTP_PASSWORD/$SHANOIR_SMTP_PASSWORD/g
s/SHANOIR_SMTP_STARTTLS_ENABLE/$SHANOIR_SMTP_STARTTLS_ENABLE/g
s/SHANOIR_SMTP_FROM/$SHANOIR_SMTP_FROM/g
s/SHANOIR_URL_SCHEME/$SHANOIR_URL_SCHEME/g
s/SHANOIR_URL_HOST/$SHANOIR_URL_HOST/g
s/SHANOIR_VIEWER_OHIF_URL_SCHEME/$SHANOIR_VIEWER_OHIF_URL_SCHEME/g
Expand Down
22 changes: 13 additions & 9 deletions shanoir-ng-users/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Shanoir NG - Import, manage and share neuroimaging data
# Copyright (C) 2009-2019 Inria - https://www.inria.fr/
# Contact us on https://project.inria.fr/shanoir/
#
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see https://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -67,17 +67,23 @@ spring:
store-type: none
mail:
host: ${SHANOIR_SMTP_HOST}
port: 25
port: ${SHANOIR_SMTP_PORT}
username: ${SHANOIR_SMTP_USERNAME}
password: ${SHANOIR_SMTP_PASSWORD}
properties:
mail.smtp.from: [email protected]
mail.smtp.from: ${SHANOIR_SMTP_FROM}
mail.smtp.auth: ${SHANOIR_SMTP_AUTH}
mail.smtp.port: ${SHANOIR_SMTP_PORT}
mail.smtp.starttls.enable: ${SHANOIR_SMTP_STARTTLS_ENABLE}
mail.smtp.starttls.required: ${SHANOIR_SMTP_STARTTLS_REQUIRED}
security:
oauth2:
resourceserver:
jwt:
issuer-uri: ${SHANOIR_URL_SCHEME}://${SHANOIR_URL_HOST}/auth/realms/shanoir-ng
springdoc:
api-docs:
path: '/api-docs'
path: "/api-docs"
enabled: true
swagger-ui:
url: /shanoir-ng/users/api-docs
Expand Down Expand Up @@ -111,7 +117,6 @@ service-account:
name: service-account-service-account
email: ${VIP_SERVICE_EMAIL}


---
######################################
# DO NOT COMMIT VALUES MODIFICATIONS #
Expand Down Expand Up @@ -146,14 +151,13 @@ spring:
# logging configuration
logging:
pattern:
file: '%d{yyyy-MM-dd_HH:mm:ss.SSS} %-5level [%mdc{username}] %logger{35} - %msg%n'
file: "%d{yyyy-MM-dd_HH:mm:ss.SSS} %-5level [%mdc{username}] %logger{35} - %msg%n"
file:
name: /var/log/shanoir-ng-logs/shanoir-ng-users.log
level:
org.springframework.web: DEBUG
org.hibernate: ERROR



---
spring:
config.activate.on-profile: test
Expand Down
Loading