Skip to content

Unification of the HOCON configuration files #6

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

Open
wants to merge 8 commits into
base: main
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
112 changes: 80 additions & 32 deletions adverse-events/src/main/resources/application.conf
Original file line number Diff line number Diff line change
@@ -1,57 +1,88 @@
include "adverse-events-core.conf"
#include "substances-core.conf"

# need to reconsider this a bit
substanceAPI.BaseUrl="http://localhost:8080/"

server.port=8086
ix.home="ginas.ix"
##################################################################
# MAIN CONFIGURATION ##
##################################################################

spring.application.name="adverse-events"
server.servlet.context-path="/"${spring.application.name}
ix.home=${spring.application.name}".ix"

application.host="http://localhost:8080"
application.host=${?APPLICATION_HOST}

# Secure session off for dev, but if using HTTPS it's better to have it on
gsrs.sessions.sessionSecure=false

#this is what it registers under eureka
eureka.instance.hostname="adverse-events"
# Since this currently extends substances, we must turn off molwitch
# or else need to implement it
gsrs.substances.molwitch.enabled=false

# PUT YOUR PERSONAL EXTENSIONS AND ADDITIONS HERE
#debug=true
spring.main.allow-bean-definition-overriding=true

##################################################################
# SPRING BOOT ACTUATOR SETTINGS FOR MICROSERVICE HEALTH CHECKS ##
##################################################################

# turn off rabbit mq check for now since we don't use it otherwise it wil say we ar down
management.health.rabbit.enabled: false

# PUT YOUR PERSONAL EXTENSIONS AND ADDITIONS HERE
#debug=true
spring.main.allow-bean-definition-overriding=true
##################################################################
# EUREKA SETTINGS ##
##################################################################

eureka.instance.hostname=${spring.application.name}
eureka.client.serviceUrl.defaultZone="http://localhost:8761/eureka"
eureka.client.serviceUrl.defaultZone=${?EUREKA_SERVICE_URL}
#turn off eureka for now
eureka.client.enabled=false
eureka.client.enabled=${?EUREKA_CLIENT_ENABLED}

ix.h2 {
base = ./${ix.home}/h2
}
##################################################################
# SUBSTANCES DATABASE CONNECTION ##
##################################################################

spring.datasource.url="jdbc:h2:file:substances.ix/h2/sprinxight;MODE=Oracle;AUTO_SERVER=TRUE"
spring.datasource.url=${?DB_URL_SUBSTANCES}
spring.datasource.username=${?DB_USERNAME}
spring.datasource.password=${?DB_PASSWORD}
spring.datasource.connectionTimeout=120000
spring.datasource.connectionTimeout=${?DB_CONNECTION_TIMEOUT}
spring.datasource.maximumPoolSize=${?DB_MAXIMUM_POOL_SIZE}
spring.jpa.database-platform=${?DB_DIALECT}
spring.jpa.hibernate.ddl-auto=none
spring.jpa.hibernate.use-new-id-generator-mappings=${?DB_USE_NEW_ID_GENERATOR_MAPPINGS}
spring.hibernate.show-sql=false

##################################################################
# DATABASE CONNECTION ##
##################################################################

# H2 Database Connection
spring.datasource.url="jdbc:h2:file:../substances/ginas.ix/h2/sprinxight;MODE=Oracle;AUTO_SERVER=TRUE"
spring.datasource.driverClassName=org.h2.Driver
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
# Should be "none" when not testing locally with H2
spring.jpa.hibernate.ddl-auto=update
ix.h2 {
base = ./${ix.home}/h2
}

adverseevent.datasource.url="jdbc:h2:"${ix.h2.base}"/appinxight;MODE=Oracle;AUTO_SERVER=TRUE"
adverseevent.datasource.driverClassName=org.h2.Driver
adverseevent.jpa.database-platform=org.hibernate.dialect.H2Dialect
# Should be "none" when not testing locally with H2
adverseevent.datasource.url=${?DB_URL_ADVERSE_EVENTS}
adverseevent.datasource.username=${?DB_USERNAME}
adverseevent.datasource.password=${?DB_PASSWORD}
adverseevent.datasource.connectionTimeout=120000
adverseevent.datasource.connectionTimeout=${?DB_CONNECTION_TIMEOUT}
adverseevent.datasource.maximumPoolSize=${?DB_MAXIMUM_POOL_SIZE}
adverseevent.jpa.database-platform=${?DB_DIALECT}
adverseevent.jpa.hibernate.ddl-auto=update
adverseevent.jpa.hibernate.ddl-auto=${?DB_DDL_AUTO}
adverseevent.jpa.hibernate.use-new-id-generator-mappings=${?DB_USE_NEW_ID_GENERATOR_MAPPINGS}
adverseevent.hibernate.show-sql=false

##################################################################
# API SETTINGS ##
##################################################################

# !!!!! IMPORTANT, KEEP TO "none" for non-memory databases such as ORACLE, MYSQL, etc.
# Otherwise all the tables can be dropped or deleted
# Uncomment when NOT testing locally
# spring.jpa.hibernate.ddl-auto=none
# adverseevent.jpa.hibernate.ddl-auto=none
substanceAPI.BaseUrl="http://localhost:8080/"
substanceAPI.BaseUrl=${?API_URL}

##################################################################
# CONFIGURATIONS VALIDATORS, PROCESSORS, EXPORT, etc ##
Expand All @@ -60,11 +91,11 @@ adverseevent.jpa.hibernate.ddl-auto=update
gsrs.entityProcessors = [
{
"entityClassName" = "gov.hhs.gsrs.adverseevents.adverseeventpt.models.AdverseEventPt",
"processor" = "gov.hhs.gsrs.adverseevents.adverseeventpt.processors.AdverseEventPtProcessor"
"processor" = "gov.hhs.gsrs.adverseevents.adverseeventpt.processors.AdverseEventPtProcessor"
},
{
"entityClassName" = "gov.hhs.gsrs.adverseevents.adverseeventdme.models.AdverseEventDme",
"processor" = "gov.hhs.gsrs.adverseevents.adverseeventdme.processors.AdverseEventDmeProcessor"
"processor" = "gov.hhs.gsrs.adverseevents.adverseeventdme.processors.AdverseEventDmeProcessor"
},
{
"entityClassName" = "gov.hhs.gsrs.adverseevents.adverseeventcvm.models.AdverseEventCvm",
Expand Down Expand Up @@ -103,5 +134,22 @@ gsrs.indexers.list=[
}
]

# Secure session off for dev, but if using HTTPS it's better to have it on
gsrs.sessions.sessionSecure=false
##################################################################
# LEGACY AUTHENTICATION ##
##################################################################

ix.authentication.allownonauthenticated = ${?AUTH_ALLOW_NONAUTH}
ix.authentication.autoregister = ${?AUTH_AUTOREGISTER}
ix.authentication.autoregisteractive = ${?AUTH_AUTOREGISTERACTIVE}
ix.authentication.sysadmin-email = ${?AUTH_SYSADMIN_EMAIL}
ix.authentication.trustheader = ${?AUTH_TRUST_HEADER}
ix.authentication.usernameheader = ${?AUTH_USERNAME_HEADER}
ix.authentication.useremailheader = ${?AUTH_EMAIL_HEADER}
ix.authentication.userrolesheader = ${?AUTH_ROLES_HEADER}

##################################################################
# CUSTOM CONFIGURATION ##
##################################################################

include "conf/adverse-events.conf"
include "adverse-events.conf"
6 changes: 6 additions & 0 deletions adverse-events/src/main/webapp/META-INF/context.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Context docBase="adverse-events">
<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="${gateway.allow.pattern:-\d+\.\d+\.\d+\.\d+}"/>
<Resources allowLinking="true" className="org.apache.catalina.webresources.StandardRoot">
<PreResources className="org.apache.catalina.webresources.DirResourceSet" base="${user.dir}/conf" internalPath="/" webAppMount="/WEB-INF/classes" />
</Resources>
</Context>
124 changes: 83 additions & 41 deletions applications/src/main/resources/application.conf
Original file line number Diff line number Diff line change
@@ -1,62 +1,88 @@
include "applications-core.conf"

# Since this currently extends substances, we must turn off molwitch
# or else need to implement it
gsrs.substances.molwitch.enabled=false
##################################################################
# MAIN CONFIGURATION ##
##################################################################

# need to reconsider this a bit
substanceAPI.BaseUrl="http://localhost:8080/"
spring.application.name="applications"
server.servlet.context-path="/"${spring.application.name}
ix.home=${spring.application.name}".ix"

server.port=8083
ix.home="ginas.ix"
application.host= "http://localhost:8081"
application.host="http://localhost:8080"
application.host=${?APPLICATION_HOST}

spring.application.name="applications"
#this is what it registers under eureka
eureka.instance.hostname="applications"
# Secure session off for dev, but if using HTTPS it's better to have it on
gsrs.sessions.sessionSecure=false

#turn off eureka for now
eureka.client.enabled=false
# Since this currently extends substances, we must turn off molwitch
# or else need to implement it
gsrs.substances.molwitch.enabled=false

# PUT YOUR PERSONAL EXTENSIONS AND ADDITIONS HERE
#debug=true
spring.main.allow-bean-definition-overriding=true

##################################################################
# SPRING BOOT ACTUATOR SETTINGS FOR MICROSERVICE HEALTH CHECKS ##
##################################################################

# turn off rabbit mq check for now since we don't use it otherwise it wil say we ar down
management.health.rabbit.enabled: false

# PUT YOUR PERSONAL EXTENSIONS AND ADDITIONS HERE
#debug=true
spring.main.allow-bean-definition-overriding=true
##################################################################
# EUREKA SETTINGS ##
##################################################################

#this is how HOCON does default values
eureka.client.serviceUrl.defaultZone= "http://localhost:8761/eureka"
eureka.instance.hostname=${spring.application.name}
eureka.client.serviceUrl.defaultZone="http://localhost:8761/eureka"
eureka.client.serviceUrl.defaultZone=${?EUREKA_SERVICE_URL}
#turn off eureka for now
eureka.client.enabled=false
eureka.client.enabled=${?EUREKA_CLIENT_ENABLED}

ix.h2 {
base = ./${ix.home}/h2
}
##################################################################
# SUBSTANCES DATABASE CONNECTION ##
##################################################################

spring.datasource.url="jdbc:h2:file:substances.ix/h2/sprinxight;MODE=Oracle;AUTO_SERVER=TRUE"
spring.datasource.url=${?DB_URL_SUBSTANCES}
spring.datasource.username=${?DB_USERNAME}
spring.datasource.password=${?DB_PASSWORD}
spring.datasource.connectionTimeout=120000
spring.datasource.connectionTimeout=${?DB_CONNECTION_TIMEOUT}
spring.datasource.maximumPoolSize=${?DB_MAXIMUM_POOL_SIZE}
spring.jpa.database-platform=${?DB_DIALECT}
spring.jpa.hibernate.ddl-auto=none
spring.jpa.hibernate.use-new-id-generator-mappings=${?DB_USE_NEW_ID_GENERATOR_MAPPINGS}
spring.hibernate.show-sql=false

##################################################################
# DATABASE CONNECTION ##
##################################################################

# H2 Database Connection
spring.datasource.url="jdbc:h2:file:../substances/ginas.ix/h2/sprinxight;MODE=Oracle;AUTO_SERVER=TRUE"
spring.datasource.driverClassName=org.h2.Driver
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
# Should be "none" when not testing locally with H2
spring.jpa.hibernate.ddl-auto=update
ix.h2 {
base = ./${ix.home}/h2
}

application.datasource.url="jdbc:h2:"${ix.h2.base}"/appinxight;MODE=Oracle;AUTO_SERVER=TRUE"
application.datasource.driverClassName=org.h2.Driver
application.jpa.database-platform=org.hibernate.dialect.H2Dialect
# Should be "none" when not testing locally with H2
application.datasource.url=${?DB_URL_APPLICATIONS}
application.datasource.username=${?DB_USERNAME}
application.datasource.password=${?DB_PASSWORD}
application.datasource.connectionTimeout=120000
application.datasource.connectionTimeout=${?DB_CONNECTION_TIMEOUT}
application.datasource.maximumPoolSize=${?DB_MAXIMUM_POOL_SIZE}
application.jpa.database-platform=${?DB_DIALECT}
application.jpa.hibernate.ddl-auto=update
application.jpa.hibernate.ddl-auto=${?DB_DDL_AUTO}
application.jpa.hibernate.use-new-id-generator-mappings=${?DB_USE_NEW_ID_GENERATOR_MAPPINGS}
application.hibernate.show-sql=false

# !!!!! IMPORTANT, KEEP TO "none" for non-memory databases such as ORACLE, MYSQL, etc.
# Otherwise all the tables can be dropped or deleted
# Uncomment when NOT testing locally
# spring.jpa.hibernate.ddl-auto=none
# application.jpa.hibernate.ddl-auto=none
##################################################################
# API SETTINGS ##
##################################################################

substanceAPI.BaseUrl="http://localhost:8080/"
substanceAPI.BaseUrl=${?API_URL}

##################################################################
# CONFIGURATIONS VALIDATORS, PROCESSORS, EXPORT, etc ##
Expand All @@ -73,11 +99,11 @@ gsrs.validators.applications = [
gsrs.entityProcessors = [
{
"class" = "gov.hhs.gsrs.application.application.models.Application",
"processor" = "gov.hhs.gsrs.application.application.processors.ApplicationProcessor"
"processor" = "gov.hhs.gsrs.application.application.processors.ApplicationProcessor"
},
{
"class" = "gov.hhs.gsrs.application.applicationall.models.ApplicationAll",
"processor" = "gov.hhs.gsrs.application.applicationall.processors.ApplicationAllProcessor"
"processor" = "gov.hhs.gsrs.application.applicationall.processors.ApplicationAllProcessor"
},
{
"class" = "gov.hhs.gsrs.application.applicationdarrts.models.ApplicationDarrts",
Expand All @@ -87,11 +113,11 @@ gsrs.entityProcessors = [


ix.ginas.export.factories.applications = [
"gov.hhs.gsrs.application.application.exporters.ApplicationExporterFactory"
"gov.hhs.gsrs.application.application.exporters.ApplicationExporterFactory"
]

ix.ginas.export.factories.applicationsall = [
"gov.hhs.gsrs.application.applicationall.exporters.ApplicationAllExporterFactory"
"gov.hhs.gsrs.application.applicationall.exporters.ApplicationAllExporterFactory"
]

gsrs.indexers.list=[
Expand All @@ -109,6 +135,22 @@ gsrs.indexers.list=[
}
]

##################################################################
# LEGACY AUTHENTICATION ##
##################################################################

# Secure session off for dev, but if using HTTPS it's better to have it on
gsrs.sessions.sessionSecure=false
ix.authentication.allownonauthenticated = ${?AUTH_ALLOW_NONAUTH}
ix.authentication.autoregister = ${?AUTH_AUTOREGISTER}
ix.authentication.autoregisteractive = ${?AUTH_AUTOREGISTERACTIVE}
ix.authentication.sysadmin-email = ${?AUTH_SYSADMIN_EMAIL}
ix.authentication.trustheader = ${?AUTH_TRUST_HEADER}
ix.authentication.usernameheader = ${?AUTH_USERNAME_HEADER}
ix.authentication.useremailheader = ${?AUTH_EMAIL_HEADER}
ix.authentication.userrolesheader = ${?AUTH_ROLES_HEADER}

##################################################################
# CUSTOM CONFIGURATION ##
##################################################################

include "conf/applications.conf"
include "applications.conf"
6 changes: 6 additions & 0 deletions applications/src/main/webapp/META-INF/context.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Context docBase="applications">
<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="${gateway.allow.pattern:-\d+\.\d+\.\d+\.\d+}"/>
<Resources allowLinking="true" className="org.apache.catalina.webresources.StandardRoot">
<PreResources className="org.apache.catalina.webresources.DirResourceSet" base="${user.dir}/conf" internalPath="/" webAppMount="/WEB-INF/classes" />
</Resources>
</Context>
Loading