From c00e2cb3c247e82c7be4c7ff4c4919164d0f217b Mon Sep 17 00:00:00 2001 From: s3curitybug Date: Thu, 29 Nov 2018 16:26:48 +0100 Subject: [PATCH] Fully externalized properties. Profiles removed. Dom4j updated to 2.1.1 --- config/dev-local.properties | 48 +++++++++++++++++++++++ config/guardedbox-config.properties | 48 +++++++++++++++++++++++ pom.xml | 29 ++++++-------- profiles/dev-local.properties | 35 ----------------- src/main/resources/application.properties | 41 ------------------- 5 files changed, 107 insertions(+), 94 deletions(-) create mode 100644 config/dev-local.properties create mode 100644 config/guardedbox-config.properties delete mode 100644 profiles/dev-local.properties delete mode 100644 src/main/resources/application.properties diff --git a/config/dev-local.properties b/config/dev-local.properties new file mode 100644 index 0000000..38e90ea --- /dev/null +++ b/config/dev-local.properties @@ -0,0 +1,48 @@ +#==================================================================================================== +# +# Application Configuration Properties for Profile dev-local. +# +#==================================================================================================== + + +# Internet. +internet.url = http://myserver:8080/ + +# Server. +server.port = 8443 +server.server-header = GuardedBox + +# Server SSL. +server.ssl.key-store = ./config/myserver.p12 +server.ssl.key-alias = myserver +server.ssl.key-store-type = PKCS12 +server.ssl.enabled-protocols = TLSv1.2 +server.ssl.ciphers = TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CCM,TLS_ECDHE_ECDSA_WITH_AES_256_CCM,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 + +# Server Session. +server.session.timeout = 1800 +server.session.cookie.name = SESSION-ID +server.session.cookie.secure = true + +# Spring. +spring.mvc.favicon.enabled = false + +# Spring DataSource. +spring.datasource.url = jdbc:mysql://127.0.0.1:3306/guardedbox?autoReconnect=true&useSSL=false&characterEncoding=UTF-8 +spring.datasource.username = guardedbox +spring.jpa.show-sql = false + +# Spring Email. +spring.mail.host = smtp.gmail.com +spring.mail.port = 587 +spring.mail.username = accounts@guardedbox.com +spring.mail.properties.mail.smtp.auth = true +spring.mail.properties.mail.smtp.starttls.enable = true +spring.mail.properties.mail.smtp.starttls.required = true + +# Logging. +logging.level = INFO +logging.pattern = %date{dd/MM/yyyy HH:mm:ss} | %-5level | %class{0}.%method.%line | %message%n + +# Captcha. +captcha.verification-url = https://www.google.com/recaptcha/api/siteverify?secret=%s&response=%s&remoteip=%s diff --git a/config/guardedbox-config.properties b/config/guardedbox-config.properties new file mode 100644 index 0000000..291ac1a --- /dev/null +++ b/config/guardedbox-config.properties @@ -0,0 +1,48 @@ +#==================================================================================================== +# +# Application Configuration Properties for Profile guardedbox.com. +# +#==================================================================================================== + + +# Internet. +internet.url = https://guardedbox.com/ + +# Server. +server.port = 8443 +server.server-header = GuardedBox + +# Server SSL. +server.ssl.key-store = /etc/cert/guardedbox.p12 +server.ssl.key-alias = guardedbox +server.ssl.key-store-type = PKCS12 +server.ssl.enabled-protocols = TLSv1.2 +server.ssl.ciphers = TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CCM,TLS_ECDHE_ECDSA_WITH_AES_256_CCM,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 + +# Server Session. +server.session.timeout = 1800 +server.session.cookie.name = SESSION-ID +server.session.cookie.secure = false + +# Spring. +spring.mvc.favicon.enabled = false + +# Spring DataSource. +spring.datasource.url = jdbc:mysql://127.0.0.1:3306/guardedbox?autoReconnect=true&useSSL=false&characterEncoding=UTF-8 +spring.datasource.username = guardedbox +spring.jpa.show-sql = false + +# Spring Email. +spring.mail.host = smtp.gmail.com +spring.mail.port = 587 +spring.mail.username = accounts@guardedbox.com +spring.mail.properties.mail.smtp.auth = true +spring.mail.properties.mail.smtp.starttls.enable = true +spring.mail.properties.mail.smtp.starttls.required = true + +# Logging. +logging.level = INFO +logging.pattern = %date{dd/MM/yyyy HH:mm:ss} | %-5level | %class{0}.%method.%line | %message%n + +# Captcha. +captcha.verification-url = https://www.google.com/recaptcha/api/siteverify?secret=%s&response=%s&remoteip=%s diff --git a/pom.xml b/pom.xml index ce433e7..b4a7d23 100644 --- a/pom.xml +++ b/pom.xml @@ -30,24 +30,6 @@ - - - - - - dev-local - - true - - - - profiles/dev-local.properties - - - - - - org.springframework.boot @@ -134,6 +116,17 @@ org.springframework.boot spring-boot-starter-data-jpa + + + dom4j + dom4j + + + + + org.dom4j + dom4j + 2.1.1 diff --git a/profiles/dev-local.properties b/profiles/dev-local.properties deleted file mode 100644 index ca0e574..0000000 --- a/profiles/dev-local.properties +++ /dev/null @@ -1,35 +0,0 @@ -#================================================== -# -# Application Properties for 'dev-local' Profile. -# -#================================================== - - -# Internet. -internet.url = http://127.0.0.1:8080/ - -# Server. -server.port = 8080 - -# Session. -server.session.timeout = 1800 -server.session.cookie.secure = false - -# Logging. -logging.level = INFO -logging.pattern = %date{dd/MM/yyyy HH:mm:ss} | %-5level | %class{0}.%method.%line | %message%n - -# DataSource. -spring.datasource.url = jdbc:mysql://localhost:3306/guardedbox?autoReconnect=true&useSSL=false&characterEncoding=UTF-8 -spring.datasource.username = guardedbox - -# Email. -spring.mail.host = smtp.gmail.com -spring.mail.port = 587 -spring.mail.username = s3curitybug@gmail.com - -# JPA. -spring.jpa.show-sql = false - -# Captcha. -captcha.verification-url = https://www.google.com/recaptcha/api/siteverify?secret=%s&response=%s&remoteip=%s diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties deleted file mode 100644 index acbf473..0000000 --- a/src/main/resources/application.properties +++ /dev/null @@ -1,41 +0,0 @@ -#================================================== -# -# Application Properties. -# -#================================================== - - -# Internet. -internet.url = @internet.url@ - -# Server. -server.port = @server.port@ -server.server-header = GuardedBox - -# Session. -server.session.timeout = @server.session.timeout@ -server.session.cookie.secure = @server.session.cookie.secure@ - -# Logging. -logging.level. = @logging.level@ -logging.pattern.console = @logging.pattern@ - -# DataSource and JPA. -spring.datasource.url = @spring.datasource.url@ -spring.datasource.username = @spring.datasource.username@ -spring.jpa.show-sql = @spring.jpa.show-sql@ - -# Email. -spring.mail.host = @spring.mail.host@ -spring.mail.port = @spring.mail.port@ -spring.mail.username = @spring.mail.username@ -spring.mail.properties.mail.smtp.auth = true -spring.mail.properties.mail.smtp.starttls.enable = true -spring.mail.properties.mail.smtp.starttls.required = true - -# Fingerprinting. -server.session.cookie.name = SESSION-ID -spring.mvc.favicon.enabled = false - -# Captcha. -captcha.verification-url = @captcha.verification-url@