From 427a1a39d81a7a43922a96e7db7185f71cc0f65c Mon Sep 17 00:00:00 2001 From: corneliouzbett Date: Mon, 29 Jan 2024 08:33:07 +0300 Subject: [PATCH 1/3] Align eip-demo-service with the upgraded eip-client --- demo/docker-compose.yml | 6 +- demo/eip/config/application.properties | 136 +------------------ demo/eip/routes/generate-demo-data-route.xml | 2 +- 3 files changed, 7 insertions(+), 137 deletions(-) diff --git a/demo/docker-compose.yml b/demo/docker-compose.yml index a2fce2f..af5592d 100644 --- a/demo/docker-compose.yml +++ b/demo/docker-compose.yml @@ -10,12 +10,12 @@ services: - EIP_DB_USER=${EIP_DB_USER_DEMO} - EIP_DB_PASSWORD=${EIP_DB_PASSWORD_DEMO} volumes: - - "./eip/config:/config" - - "./eip/routes:/routes" + - "./eip/config:/eip-client/config" + - "./eip/routes:/eip-client/routes" networks: ozone: networks: ozone: web: - external: true \ No newline at end of file + external: true diff --git a/demo/eip/config/application.properties b/demo/eip/config/application.properties index 5455d46..476cd78 100644 --- a/demo/eip/config/application.properties +++ b/demo/eip/config/application.properties @@ -1,23 +1,5 @@ -# Number of demo patients used to generate demo data, defaults to 0 -number.of.demo.patients=${NUMBER_OF_DEMO_PATIENTS} - -camel.springboot.xml-routes=classpath*:camel/*.xml,file:routes/*.xml,file:routes/*/*.xml,file:routes/*/*/*.xml - -openmrs.db.host=${OPENMRS_DB_HOST} - -# The OpenMRS MySQL database port -openmrs.db.port=${OPENMRS_DB_PORT} - -# The OpenMRS MySQL database name -openmrs.db.name=${OPENMRS_DB_NAME} -# *********************** General EIP sender properties **************************************************************** +# *********************** OAuth2 Configuration **************************************************************** # - -# Maximum size of each batch of source records to be read by debezium from the binlog files, maps to the -## debezium MySQL connector property named max.batch.size -#https://debezium.io/documentation/reference/1.6/connectors/mysql.html#mysql-property-max-batch-size -debezium.reader.maxBatchSize=2048 - #Enabled Oauth when set to true oauth.enabled=${OAUTH_ENABLED} @@ -31,48 +13,8 @@ oauth.client.id=${OAUTH_CLIENT_ID} oauth.client.secret=${OAUTH_CLIENT_SECRET} #Authentication scope, can be multiple values separated by commas oauth.client.scope=email - -eip.home=/eip-home - -# A comma separated list of database tables names to watch for changes -eip.watchedTables= - -db-event.destinations=no-destination-routes - -# ---------------------------------------------------------------------------------------------------------------------- - - -# *********************** Logging Configuration ************************************************************************ -# -# Uncomment this to use console logging otherwise defaults to the logback.xml file located on the classpath which is -# configured to log to ${eip.home}/logs/openmrs-eip.log -logging.config=classpath:logback-console.xml - -# Logging level for the application loggers (all built-in routes and classes) -openmrs.eip.log.level=INFO - -# Logging level for ONLY application class loggers -logging.level.org.openmrs.eip=${openmrs.eip.log.level} -# ---------------------------------------------------------------------------------------------------------------------- - - -# *********************** Tomcat Configuration ************************************************************************* -# -# Server HTTP port. -server.port=8083 -# ---------------------------------------------------------------------------------------------------------------------- - - -# *********************** H2 configuration ***************************************************************************** -# -# Whether to enable the console -#spring.h2.console.enabled=false - -# Path at which the console is available, defaults to /h2-console -# spring.h2.console.path= # ---------------------------------------------------------------------------------------------------------------------- - # *********************** Configuration of the OpenMRS Web App ********************************************************* # # OpenMRS user credentials @@ -82,78 +24,6 @@ openmrs.password=${OPENMRS_PASSWORD} # OpenMRS base url openmrs.baseUrl=${OPENMRS_URL}/openmrs -# *********************** OpenMRS Datasource config ******************************************************************** -# -# Driver class of the openMRS datasource (should not be changed in a usual use) -spring.openmrs-datasource.driverClassName=com.mysql.jdbc.Driver -# -# Dialect of the openMRS datasource (should not be changed in a usual use) -spring.openmrs-datasource.dialect=org.hibernate.dialect.MySQLDialect - -# Url of the openMRS datasource, you don't have to change this value as long you've set the placeholder property values -spring.openmrs-datasource.jdbcUrl=jdbc:mysql://${openmrs.db.host}:${openmrs.db.port}/${openmrs.db.name} - -# User name of the openMRS datasource -spring.openmrs-datasource.username=${OPENMRS_DB_USER} - -# Password of the openMRS datasource -spring.openmrs-datasource.password=${OPENMRS_DB_PASSWORD} -# ---------------------------------------------------------------------------------------------------------------------- - - -# *********************** Configuration of the Management database ***************************************************** -# -# Driver class of the management datasource (should not be changed in a usual use) -spring.mngt-datasource.driverClassName=org.h2.Driver - -# Dialect of the management datasource (should not be changed in a usual use) -spring.mngt-datasource.dialect=org.hibernate.dialect.H2Dialect - -# Url of the management datasource -spring.mngt-datasource.jdbcUrl=jdbc:h2:mem:${EIP_DB_NAME};DB_CLOSE_DELAY=30;LOCK_TIMEOUT=10000 - -# User name of the management datasource -spring.mngt-datasource.username=${EIP_DB_USER} - -# Password of the management datasource -spring.mngt-datasource.password=${EIP_DB_PASSWORD} -# ---------------------------------------------------------------------------------------------------------------------- - - -# *********************** Debezium Config ****************************************************************************** -# -# For details explanations of this properties, please refer to -# https://debezium.io/documentation/reference/connectors/mysql.html#mysql-connector-properties -# Maps to the connect property named database.server.id, MUST match the server-id value in your my.cnf file when you -# enabled mysql binlog, DO NOT change after setting it -debezium.db.serverId=3 - -# Unique logical name of the MySQL database server, maps to the debezium MySQL connector property named -# database.server.name, DO NOT change after setting it -debezium.db.serverName=${openmrs.db.name} - -# Database username for debezium user account you created to access the MySQL binlog, maps to the debezium MySQL -# connector property named database.user, it's highly recommended to create separate user account as described at -# https://debezium.io/documentation/reference/connectors/mysql.html#setting-up-mysql -debezium.db.user=${MYSQL_ADMIN_USER} - -# Database password for debezium user account you created to access the MySQL binlog, maps to the debezium MySQL -# connector property named database.password -debezium.db.password=${MYSQL_ADMIN_USER_PASSWORD} - -# Specifies the criteria for running a snapshot when the connector starts, DO NOT change after setting it, maps to the -# debezium MySQL connector property named snapshot.mode -debezium.snapshotMode=schema_only - -# The 2 properties below are debezium engine specific and are documented at -# https://debezium.io/documentation/reference/development/engine.html#engine-properties -# -# Path to file where offsets are to be stored, maps to property named offset.storage.file.filename, DO NOT change after -# setting it -debezium.offsetFilename=offsets.txt - -# Path to file where offsets are to be stored, maps to property named database.history.file.filename, DO NOT change -# after setting it -debezium.historyFilename=dbhistory.txt +# Number of demo patients used to generate demo data, defaults to 0 +number.of.demo.patients=${NUMBER_OF_DEMO_PATIENTS} # ---------------------------------------------------------------------------------------------------------------------- -debezium.snapshotLockingMode=extended \ No newline at end of file diff --git a/demo/eip/routes/generate-demo-data-route.xml b/demo/eip/routes/generate-demo-data-route.xml index 0545fbf..c658758 100644 --- a/demo/eip/routes/generate-demo-data-route.xml +++ b/demo/eip/routes/generate-demo-data-route.xml @@ -3,7 +3,7 @@ - + From 5fc4065a96f68977ade030ffd10414e45d348b33 Mon Sep 17 00:00:00 2001 From: corneliouzbett Date: Mon, 29 Jan 2024 08:50:28 +0300 Subject: [PATCH 2/3] Remove eip environment variables --- demo/docker-compose.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/demo/docker-compose.yml b/demo/docker-compose.yml index af5592d..3a63cdd 100644 --- a/demo/docker-compose.yml +++ b/demo/docker-compose.yml @@ -6,9 +6,6 @@ services: env_file: ../eip.env environment: - NUMBER_OF_DEMO_PATIENTS=${NUMBER_OF_DEMO_PATIENTS} - - EIP_DB_NAME=${EIP_DB_NAME_DEMO} - - EIP_DB_USER=${EIP_DB_USER_DEMO} - - EIP_DB_PASSWORD=${EIP_DB_PASSWORD_DEMO} volumes: - "./eip/config:/eip-client/config" - "./eip/routes:/eip-client/routes" From 04ab99ec15d1892ec795ee6aba6e0ff24c8bf12f Mon Sep 17 00:00:00 2001 From: corneliouzbett Date: Tue, 30 Jan 2024 11:26:57 +0300 Subject: [PATCH 3/3] Remove support for Oauth2 authentication --- demo/docker-compose.yml | 2 ++ demo/eip/config/application.properties | 19 +------------------ .../routes/authenticate-to-openmrs-route.xml | 17 ----------------- 3 files changed, 3 insertions(+), 35 deletions(-) diff --git a/demo/docker-compose.yml b/demo/docker-compose.yml index 3a63cdd..eeae8eb 100644 --- a/demo/docker-compose.yml +++ b/demo/docker-compose.yml @@ -6,6 +6,8 @@ services: env_file: ../eip.env environment: - NUMBER_OF_DEMO_PATIENTS=${NUMBER_OF_DEMO_PATIENTS} + - EIP_PROFILE=prod + - OPENMRS_URL=http://openmrs:8080/openmrs volumes: - "./eip/config:/eip-client/config" - "./eip/routes:/eip-client/routes" diff --git a/demo/eip/config/application.properties b/demo/eip/config/application.properties index 476cd78..89ba16a 100644 --- a/demo/eip/config/application.properties +++ b/demo/eip/config/application.properties @@ -1,20 +1,3 @@ -# *********************** OAuth2 Configuration **************************************************************** -# -#Enabled Oauth when set to true -oauth.enabled=${OAUTH_ENABLED} - -#The client Id of the account -oauth.access.token.uri=${OAUTH_ACCESS_TOKEN_URI} - -#The client Id of the account to use to authenticate -oauth.client.id=${OAUTH_CLIENT_ID} - -#The client secret of the account to use to authenticate -oauth.client.secret=${OAUTH_CLIENT_SECRET} -#Authentication scope, can be multiple values separated by commas -oauth.client.scope=email -# ---------------------------------------------------------------------------------------------------------------------- - # *********************** Configuration of the OpenMRS Web App ********************************************************* # # OpenMRS user credentials @@ -22,7 +5,7 @@ openmrs.username=${OPENMRS_USER} openmrs.password=${OPENMRS_PASSWORD} # OpenMRS base url -openmrs.baseUrl=${OPENMRS_URL}/openmrs +openmrs.baseUrl=${OPENMRS_URL} # Number of demo patients used to generate demo data, defaults to 0 number.of.demo.patients=${NUMBER_OF_DEMO_PATIENTS} diff --git a/demo/eip/routes/authenticate-to-openmrs-route.xml b/demo/eip/routes/authenticate-to-openmrs-route.xml index 164fdcd..2130cd3 100644 --- a/demo/eip/routes/authenticate-to-openmrs-route.xml +++ b/demo/eip/routes/authenticate-to-openmrs-route.xml @@ -25,22 +25,5 @@ ${exchangeProperty.basic-openmrs-authentication} - - - - - - - - ${body} != null && ${body} != "" - - ${body} - - - - - - ${exchangeProperty.body} -