From 63c2e2a5bd5411acab87d9da58609ee4ff00bf65 Mon Sep 17 00:00:00 2001 From: William Welling Date: Wed, 15 Aug 2018 07:52:11 -0500 Subject: [PATCH] switch to application yaml --- src/main/resources/application.properties | 120 --------------------- src/main/resources/application.yaml | 126 ++++++++++++++++++++++ src/test/resources/application.properties | 115 -------------------- src/test/resources/application.yaml | 122 +++++++++++++++++++++ 4 files changed, 248 insertions(+), 235 deletions(-) delete mode 100644 src/main/resources/application.properties create mode 100644 src/main/resources/application.yaml delete mode 100644 src/test/resources/application.properties create mode 100644 src/test/resources/application.yaml diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties deleted file mode 100644 index a3b4bf5c..00000000 --- a/src/main/resources/application.properties +++ /dev/null @@ -1,120 +0,0 @@ -server.port: 9001 - -server.contextPath: - -security.basic.enabled: false - -spring.profiles.active: production - -spring.datasource.username: spring -spring.datasource.password: spring - -# H2 -spring.datasource.platform: h2 -spring.datasource.url: jdbc:h2:mem:AZ;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE -spring.datasource.driverClassName: org.h2.Driver -spring.jpa.database-platform: org.hibernate.dialect.H2Dialect - -# PostgrSQL -#spring.datasource.platform: postgresql -#spring.datasource.url: jdbc:postgresql://localhost:5432/project_management_service -#spring.datasource.driverClassName: org.postgresql.Driver -#spring.jpa.database-platform: org.hibernate.dialect.PostgreSQLDialect - -spring.datasource.validation-query: select version(); -spring.jpa.show_sql: false -spring.jpa.hibernate.ddl-auto: create-drop - - -# logging -logging.level.edu.tamu: INFO -logging.level.org.springframework: INFO - -logging.file: logs/project-management-service.log - -app.sugar.email: helpdesk@library.tamu.edu - -app.whitelist: 127.0.0.1 - -# default delay before first cache update, 5 seconds in milliseconds -app.cache.default.delay: 5000 -# default interval between cache updates, 1 minute in milliseconds -app.cache.default.interval: 60000 - -# 2 seconds in milliseconds -app.cache.active-sprints.delay: 2000 -# 15 minutes in milliseconds -app.cache.active-sprints.interval: 900000 - -# 2 seconds in milliseconds -app.cache.remote-projects.delay: 2000 -# 1 hour in milliseconds -app.cache.remote-projects.interval: 3600000 - -# 2 minutes in milliseconds -# the projects stats cache is create from the remote projects cache -# this delay should be greater than the remote projects delay -# and an estimate on how long the remote projects cache takes to populate -app.cache.projects-stats.delay: 120000 -# 1 hour in milliseconds -app.cache.projects-stats.interval: 3600000 - - -################################################################ -# edu.tamu.weaver.auth.service.UserCredentialsService -app.authority.admins: 123456789, 990000081, 523008230, 512004707, 613001223, 402001311 -################################################################ - -################################################################ -# edu.tamu.weaver.token.provider.controller.TokenController -shib.keys: netid,uin,lastName,firstName,email - -shib.subject: email - -shib.netid: edupersonprincipalnameunscoped -shib.uin: tamuuin -shib.lastName: tdl-sn -shib.firstName: tdl-givenname -shib.email: tdl-mail - -auth.path: /auth -################################################################ - -################################################################ -# edu.tamu.weaver.token.service.TokenService -auth.security.jwt.secret: verysecretsecret -auth.security.jwt.issuer: localhost -auth.security.jwt.duration: 1 -################################################################ - -################################################################ -# edu.tamu.weaver.auth.service.CryptoService -app.security.secret: verysecretsecret -################################################################ - -################################################################ -# edu.tamu.weaver.filter.CorsFilter -app.security.allow-access: http://localhost,http://localhost:8080,http://laddusaw.tamu.edu,http://janus.evans.tamu.edu -################################################################ - -################################################################ -# edu.tamu.weaver.email.config.WeaverEmailConfig -app.email.host: relay.tamu.edu -app.email.from: noreply@library.tamu.edu -app.email.replyTo: helpdesk@library.tamu.edu -################################################################ - -################################################################ -# edu.tamu.weaver.reporting.controller.ReportingController -app.reporting.address: helpdesk@library.tamu.edu -################################################################ - -################################################################ -# edu.tamu.weaver.validation.controller.ValidationsController -app.model.packages: edu.tamu.app.model -################################################################ - -################################################################ -# edu.tamu.weaver.utility.HttpUtility -app.http.timeout: 10000 -################################################################ diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml new file mode 100644 index 00000000..f06885f1 --- /dev/null +++ b/src/main/resources/application.yaml @@ -0,0 +1,126 @@ +server: + port: 9001 + contextPath: + +--- +logging: + level: + edu.tamu: INFO + org.springframework: INFO + file: logs/project-management-service.log + +--- +security.basic.enabled: false + +--- +spring: + profiles.active: production + + datasource: + platform: h2 + driverClassName: org.h2.Driver + url: jdbc:h2:mem:AZ;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE + # platform: postgres + # driverClassName: org.postgresql.Driver + # url: jdbc:postgresql://localhost:5432/project_management_service + + username: spring + password: spring + + max-active: 100 + max-idle: 8 + min-idle: 8 + initial-size: 10 + test-on-borrow: true + test-on-return: false + test-while-idle: true + defaultAutoCommit: false + validation-query: select version(); + + jpa: + database-platform: org.hibernate.dialect.H2Dialect + # database-platform: org.hibernate.dialect.PostgreSQLDialect + + show-sql: false + hibernate.ddl-auto: create-drop + +--- +app: + cache: + default: + # default delay before first cache update, 5 seconds in milliseconds + delay: 5000 + # default interval between cache updates, 1 minute in milliseconds + interval: 60000 + active-sprints: + # 2 seconds in milliseconds + delay: 2000 + # 15 minutes in milliseconds + interval: 900000 + remote-projects: + # 2 seconds in milliseconds + delay: 2000 + # 1 hour in milliseconds + interval: 3600000 + projects-stats: + # 2 minutes in milliseconds + # the projects stats cache is create from the remote projects cache + # this delay should be greater than the remote projects delay + # and an estimate on how long the remote projects cache takes to populate + delay: 120000 + # 1 hour in milliseconds + interval: 3600000 + + sugar.email: helpdesk@library.tamu.edu + + whitelist: 127.0.0.1 + + ############################ + # Framework app properties # + ############################ + # edu.tamu.weaver.auth.service.UserCredentialsService + authority.admins: 402001311,613001223,102001721,222004429,709005486,523008230,724001395,123456789 + security: + # edu.tamu.weaver.auth.service.CryptoService + secret: verysecretsecret + # edu.tamu.weaver.filter.CorsFilter + allow-access: http://localhost,http://localhost:8080,http://machuff.tamu.edu,http://janus.evans.tamu.edu,http://savell.evans.tamu.edu,http://jmicah.tamu.edu + # edu.tamu.weaver.email.config.WeaverEmailConfig + email: + host: relay.tamu.edu + from: noreply@library.tamu.edu + replyTo: helpdesk@library.tamu.edu + # edu.tamu.weaver.reporting.controller.ReportingController + reporting.address: helpdesk@library.tamu.edu + # edu.tamu.weaver.validation.controller.ValidationsController + model.packages: edu.tamu.app.model + # edu.tamu.weaver.utility.HttpUtility + http.timeout: 10000 + +--- +############################# +# Framework auth properties # +############################# +# edu.tamu.weaver.token.service.TokenService +auth: + security: + jwt: + secret: verysecretsecret + issuer: localhost + duration: 1 + # edu.tamu.weaver.token.provider.controller.TokenController + path: /auth + +--- +############################# +# Framework shib properties # +############################# +# edu.tamu.weaver.token.provider.controller.TokenController +shib: + keys: netid,uin,lastName,firstName,email + subject: email + netid: edupersonprincipalnameunscoped + uin: tamuuin + lastName: tdl-sn + firstName: tdl-givenname + email: tdl-mail \ No newline at end of file diff --git a/src/test/resources/application.properties b/src/test/resources/application.properties deleted file mode 100644 index 08b89312..00000000 --- a/src/test/resources/application.properties +++ /dev/null @@ -1,115 +0,0 @@ -server.port: 9101 - -server.contextPath: - -security.basic.enabled: false - -spring.profiles.active: test - -spring.datasource.username: spring -spring.datasource.password: spring - -# H2 -spring.datasource.platform: h2 -spring.datasource.url: jdbc:h2:mem:AZ;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE -spring.datasource.driverClassName: org.h2.Driver -spring.jpa.database-platform: org.hibernate.dialect.H2Dialect - -spring.datasource.validation-query: select version(); -spring.jpa.show_sql: false -spring.jpa.hibernate.ddl-auto: create-drop - - -# logging -logging.level.edu.tamu: INFO -logging.level.org.springframework: INFO - -logging.file: logs/project-management-service.log - - -app.sugar.email: helpdesk@library.tamu.edu - -app.whitelist: 127.0.0.1 - -# default delay before first cache update, 15 minutes in milliseconds -app.cache.default.delay: 900000 -# default interval between cache updates, 1 minute in milliseconds -app.cache.default.interval: 60000 - -# 15 minutes in milliseconds -app.cache.active-sprints.delay: 900000 -# 15 minutes in milliseconds -app.cache.active-sprints.interval: 900000 - -# 15 minutes in milliseconds -app.cache.remote-projects.delay: 900000 -# 1 hour in milliseconds -app.cache.remote-projects.interval: 3600000 - -# 30 minutes in milliseconds -# the projects stats cache is create from the remote projects cache -# this delay should be greater than the remote projects delay -# and an estimate on how long the remote projects cache takes to populate -app.cache.projects-stats.delay: 1800000 -# 1 hour in milliseconds -app.cache.projects-stats.interval: 3600000 - - -################################################################ -# edu.tamu.weaver.auth.service.UserCredentialsService -app.authority.admins: 123456789, 990000081, 523008230, 512004707, 613001223, 402001311 -################################################################ - -################################################################ -# edu.tamu.weaver.token.provider.controller.TokenController -shib.keys: netid,uin,lastName,firstName,email - -shib.subject: email - -shib.netid: edupersonprincipalnameunscoped -shib.uin: tamuuin -shib.lastName: tdl-sn -shib.firstName: tdl-givenname -shib.email: tdl-mail - -auth.path: /auth -################################################################ - -################################################################ -# edu.tamu.weaver.token.service.TokenService -auth.security.jwt.secret: verysecretsecret -auth.security.jwt.issuer: localhost -auth.security.jwt.duration: 1 -################################################################ - -################################################################ -# edu.tamu.weaver.auth.service.CryptoService -app.security.secret: verysecretsecret -################################################################ - -################################################################ -# edu.tamu.weaver.filter.CorsFilter -app.security.allow-access: http://localhost,http://localhost:8080,http://laddusaw.tamu.edu,http://janus.evans.tamu.edu -################################################################ - -################################################################ -# edu.tamu.weaver.email.config.WeaverEmailConfig -app.email.host: relay.tamu.edu -app.email.from: noreply@library.tamu.edu -app.email.replyTo: helpdesk@library.tamu.edu -################################################################ - -################################################################ -# edu.tamu.weaver.reporting.controller.ReportingController -app.reporting.address: helpdesk@library.tamu.edu -################################################################ - -################################################################ -# edu.tamu.weaver.validation.controller.ValidationsController -app.model.packages: edu.tamu.app.model -################################################################ - -################################################################ -# edu.tamu.weaver.utility.HttpUtility -app.http.timeout: 10000 -################################################################ diff --git a/src/test/resources/application.yaml b/src/test/resources/application.yaml new file mode 100644 index 00000000..80e2913c --- /dev/null +++ b/src/test/resources/application.yaml @@ -0,0 +1,122 @@ +server: + port: 9101 + contextPath: + +--- +logging: + level: + edu.tamu: INFO + org.springframework: INFO + file: logs/project-management-service.log + +--- +security.basic.enabled: false + +--- +spring: + profiles.active: test + + datasource: + platform: h2 + driverClassName: org.h2.Driver + url: jdbc:h2:mem:AZ;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE + + username: spring + password: spring + + max-active: 100 + max-idle: 8 + min-idle: 8 + initial-size: 10 + test-on-borrow: true + test-on-return: false + test-while-idle: true + defaultAutoCommit: false + validation-query: select version(); + + jpa: + database-platform: org.hibernate.dialect.H2Dialect + + show-sql: false + hibernate.ddl-auto: create-drop + +--- +app: + cache: + default: + # default delay before first cache update, 15 minutes in milliseconds + delay: 900000 + # default interval between cache updates, 1 minute in milliseconds + interval: 60000 + active-sprints: + # 15 minutes in milliseconds + delay: 900000 + # 15 minutes in milliseconds + interval: 900000 + remote-projects: + # 15 minutes in milliseconds + delay: 900000 + # 1 hour in milliseconds + interval: 3600000 + projects-stats: + # 30 minutes in milliseconds + # the projects stats cache is create from the remote projects cache + # this delay should be greater than the remote projects delay + # and an estimate on how long the remote projects cache takes to populate + delay: 1800000 + # 1 hour in milliseconds + interval: 3600000 + + sugar.email: helpdesk@library.tamu.edu + + whitelist: 127.0.0.1 + + ############################ + # Framework app properties # + ############################ + # edu.tamu.weaver.auth.service.UserCredentialsService + authority.admins: 402001311,613001223,102001721,222004429,709005486,523008230,724001395,123456789 + security: + # edu.tamu.weaver.auth.service.CryptoService + secret: verysecretsecret + # edu.tamu.weaver.filter.CorsFilter + allow-access: http://localhost,http://localhost:8080,http://machuff.tamu.edu,http://janus.evans.tamu.edu,http://savell.evans.tamu.edu,http://jmicah.tamu.edu + # edu.tamu.weaver.email.config.WeaverEmailConfig + email: + host: relay.tamu.edu + from: noreply@library.tamu.edu + replyTo: helpdesk@library.tamu.edu + # edu.tamu.weaver.reporting.controller.ReportingController + reporting.address: helpdesk@library.tamu.edu + # edu.tamu.weaver.validation.controller.ValidationsController + model.packages: edu.tamu.app.model + # edu.tamu.weaver.utility.HttpUtility + http.timeout: 10000 + +--- +############################# +# Framework auth properties # +############################# +# edu.tamu.weaver.token.service.TokenService +auth: + security: + jwt: + secret: verysecretsecret + issuer: localhost + duration: 1 + # edu.tamu.weaver.token.provider.controller.TokenController + path: /auth + +--- +############################# +# Framework shib properties # +############################# +# edu.tamu.weaver.token.provider.controller.TokenController +shib: + keys: netid,uin,lastName,firstName,email + subject: email + netid: edupersonprincipalnameunscoped + uin: tamuuin + lastName: tdl-sn + firstName: tdl-givenname + email: tdl-mail \ No newline at end of file