#+
#    TITLE:          src/main/resources/application.properties
#    VERSION:        1-002
#    FACILITY:       Spring Bot configuration file
#    AUTHOR(S):      Dr Hlaszny, Edit | dr.hlaszny.edit@gmail.com | +36 311 6516
#    SUPERVISED BY:  -
#    CREATION DATE:  06-APR-2019
#    ENVIRONMENT:    Mac OS X 10.2,
#                    Safari 12.1
#                    Chrome 47.0.X
#                    Firefox 42.0
#    DESIGN ISSUES:
#        1) https://docs.spring.io/spring-boot/docs/  Reference Guide
#
#    PORTABILITY ISSUES:     see DESIGN ISSUES 2)
#    SUBSYSTEM:              none
#    MODIFICATION HISTORY:
#        date        modified by
#        06-APR-2010 HED    first draw
#        25-MAY-2019 HED    added mainMenuItem_X
#-

# Disabling the white label error page entirely -------------------------------
server.error.whitelabel.enabled=false
# -----------------------------------------------------------------------------

# Setting server port number --------------------------------------------------
server.port=8090
# -----------------------------------------------------------------------------

# MySQL DB Connection parameters:
#     DB-name,
#     user name,
#     password
#    (JDBC-driver name: default)
# MySQL DB Connection parameters: ---------------------------------------------
spring.datasource.url = jdbc:mysql://localhost:3306/login?useSSL=true
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.session.jdbc.initialize-schema=always
spring.datasource.username=XXXXXXXXXX
spring.datasource.password=XXXXXXXXXX
# -----------------------------------------------------------------------------

# Provides SessionRepository implementation backed by a  ----------------------
# relational database and configuration support -------------------------------
spring.session.store-type=jdbc
# -----------------------------------------------------------------------------

# Controlling H2 Console ------------------------------------------------------
spring.h2.console.enabled=true
# -----------------------------------------------------------------------------

# Keep the connection alive if idle for a long time (needed in production) ----
spring.datasource.testWhileIdle = true
# -----------------------------------------------------------------------------

# Setting autoreconnect -------------------------------------------------------
#     The use of this feature is not recommended, because it has side effects
#     related to session state and data consistency when applications don't
#     handle SQLExceptions properly, and is only designed to be used when you
#     are unable to configure your application to handle SQLExceptions resulting
#     from dead and stale connections properly.
spring.datasource.validationQuery = SELECT 1
# -----------------------------------------------------------------------------

# Show or not log for each sql query ------------------------------------------
spring.jpa.show-sql = true
# -----------------------------------------------------------------------------

# Hibernate ddl auto (create, create-drop, update) ----------------------------
spring.jpa.hibernate.ddl-auto = update
# -----------------------------------------------------------------------------

# The SQL dialect makes Hibernate generate better SQL for the chosen database -
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
# -----------------------------------------------------------------------------

# Spring Security / Queries for AuthenticationManagerBuilder ------------------
spring.queries.users-query=select email, password, active from user where email=?
spring.queries.roles-query=select u.email, r.role from user u inner join user_role ur on(u.user_id=ur.user_id) inner join role r on(ur.role_id=r.role_id) where u.email=?
# -----------------------------------------------------------------------------

# Initialize the database using data.sql script -------------------------------
spring.datasource.initialization-mode=always
# -----------------------------------------------------------------------------

# User role names in the DB table 'role' --------------------------------------
admin_role.name = ADMIN
user_role.name = USER
# -----------------------------------------------------------------------------

# SMTP Email ------------------------------------------------------------------
spring.mail.host = smtp.gmail.com
spring.mail.username = XXXXXXXXXXXXX
spring.mail.password = XXXXXXXXXXXXX
spring.mail.properties.mail.smtp.auth = true
spring.mail.properties.mail.smtp.socketFactory.port = 25
mail.smtp.port= 587
spring.mail.properties.mail.smtp.starttls.enable = true
spring.mail.properties.mail.smtp.starttls.required=false spring.mail.properties.mail.smtp.socketFactory.class = javax.net.ssl.SSLSocketFactory
spring.mail.properties.mail.smtp.socketFactory.fallback = false
# -----------------------------------------------------------------------------

# Setting Session Timeout -----------------------------------------------------
server.servlet.session.timeout=3m
# -----------------------------------------------------------------------------

# Main menu item names --------------------------------------------------------
mainMenuItem_1 = /home
mainMenuItem_2 = /usrMngmt
mainMenuItem_3 = /fileUpload
mainMenuItem_4 = /help
mainMenuItem_5 = /payment
mainMenuItem_6 = /usrMngmt/privacypolicy
mainMenuItem_7 = /usrMngmt/termsofuse
mainMenuItem_8 = /chgPw
# -----------------------------------------------------------------------------

# Setting filesize limits -----------------------------------------------------
spring.servlet.multipart.max-file-size=32MB
spring.servlet.multipart.max-request-size=32MB

# End of file src/main/resources/application.properties -----------------------
