diff --git a/.env.traefik.remote b/.env.traefik.remote index ca1131aa..1fda00c9 100644 --- a/.env.traefik.remote +++ b/.env.traefik.remote @@ -26,28 +26,33 @@ JS_REPORT_PACKAGE_PATH= # KAFKA_TOPICS=2xx,reprocess,3xx,metrics:3:1 KAFKA_TOPICS=2xx,2xx-async,reprocess,3xx,metrics:3:3,patient,observation -OPENHIM_CORE_MEDIATOR_HOSTNAME=c9a4-41-90-68-240.ngrok-free.app +OPENHIM_CORE_MEDIATOR_HOSTNAME= OPENHIM_MEDIATOR_API_PORT=443/openhimcomms # Reverse Proxy - Nginx REVERSE_PROXY_INSTANCES=1 -DOMAIN_NAME=c9a4-41-90-68-240.ngrok-free.app -SUBDOMAINS=openhimcomms.,openhimcore.,openhimconsole.,kibana.,reports.,santewww.,santempi.,superset.,keycloak.,grafana.,minio.,jempi-web.,jempi-api. +DOMAIN_NAME_HOST_TRAEFIK= STAGING=false INSECURE=false # Identity Access Manager - Keycloak -KC_FRONTEND_URL=https://keycloak.c9a4-41-90-68-240.ngrok-free.app +KC_FRONTEND_URL=https://keycloak. KC_GRAFANA_ROOT_URL=https://grafana. KC_JEMPI_ROOT_URL=https://jempi-web. KC_SUPERSET_ROOT_URL=https://superset. -KC_OPENHIM_ROOT_URL=https://c9a4-41-90-68-240.ngrok-free.app +KC_OPENHIM_ROOT_URL=https:// GF_SERVER_DOMAIN=grafana. REACT_APP_JEMPI_BASE_API_HOST=https://jempi-api. REACT_APP_JEMPI_BASE_API_PORT=443 -OPENHIM_CONSOLE_BASE_URL=https://c9a4-41-90-68-240.ngrok-free.app -OPENHIM_API_HOST=https://c9a4-41-90-68-240.ngrok-free.app/openhimcomms +OPENHIM_CONSOLE_BASE_URL=https:// +OPENHIM_API_HOST=https:///openhimcomms OPENHIM_API_PORT=443/openhimcomms -OPENHIM_HOST_NAME=c9a4-41-90-68-240.ngrok-free.app +OPENHIM_HOST_NAME= CERT_RESOLVER=le +CA_SERVER=https://acme-v02.api.letsencrypt.org/directory +OPENHIM_CORE_IMAGE=jembi/openhim-core:prerelease +OPENHIM_CONSOLE_IMAGE=jembi/openhim-console:poc-microfrontend-prelease +GF_SERVER_ROOT_URL=https:///grafana +GF_SERVER_DOMAIN= +MINIO_BROWSER_REDIRECT_URL=https:///minio diff --git a/client-registry-jempi/docker-compose.api.yml b/client-registry-jempi/docker-compose.api.yml index e216624a..363e4cd5 100644 --- a/client-registry-jempi/docker-compose.api.yml +++ b/client-registry-jempi/docker-compose.api.yml @@ -43,6 +43,7 @@ services: jempi: postgres: + jempi-api-kc: image: jembi/jempi-api-kc:${JEMPI_API_KC_IMAGE_TAG} environment: @@ -89,9 +90,11 @@ services: jempi: postgres: + volumes: jempi-shared-data: + networks: reverse-proxy: name: reverse-proxy_public diff --git a/client-registry-jempi/docker-compose.web.yml b/client-registry-jempi/docker-compose.web.yml index 130d57ef..59a6aada 100644 --- a/client-registry-jempi/docker-compose.web.yml +++ b/client-registry-jempi/docker-compose.web.yml @@ -34,6 +34,7 @@ services: keycloak: default: + networks: reverse-proxy: name: reverse-proxy_public diff --git a/client-registry-jempi/package-metadata.json b/client-registry-jempi/package-metadata.json index 2589a198..0a4bf193 100644 --- a/client-registry-jempi/package-metadata.json +++ b/client-registry-jempi/package-metadata.json @@ -80,7 +80,7 @@ "POSTGRESQL_PASSWORD": "instant101", "JEMPI_SESSION_SECURE": false, "JEMPI_SESSION_DOMAIN_NAME": "localhost", - "DOMAIN_NAME": "", + "DOMAIN_NAME": "localhost", "KAFKA_APPLICATION_ID_API": "api-app-id", "DGRAPH_HOSTS": "jempi-alpha-01,jempi-alpha-02,jempi-alpha-03", "DGRAPH_PORTS": "9080,9081,9082", diff --git a/client-registry-santempi/docker-compose.yml b/client-registry-santempi/docker-compose.yml index f8ef36ea..5d438974 100644 --- a/client-registry-santempi/docker-compose.yml +++ b/client-registry-santempi/docker-compose.yml @@ -47,10 +47,11 @@ services: reverse-proxy: traefik: -# Sante's Match configuration is stored in the container. This will prevent the matching rules of the client registry from being lost. A docker config cannot be used for this case as the settings can be changed on Sante's UI. + # Sante's Match configuration is stored in the container. This will prevent the matching rules of the client registry from being lost. A docker config cannot be used for this case as the settings can be changed on Sante's UI. volumes: santedb-data: + networks: mpi: name: mpi_public diff --git a/dashboard-visualiser-jsreport/docker-compose.yml b/dashboard-visualiser-jsreport/docker-compose.yml index 2ce709b8..f9f1c731 100644 --- a/dashboard-visualiser-jsreport/docker-compose.yml +++ b/dashboard-visualiser-jsreport/docker-compose.yml @@ -49,9 +49,11 @@ services: elastic: default: + volumes: jsreport-data: + networks: reverse-proxy: name: reverse-proxy_public diff --git a/dashboard-visualiser-kibana/docker-compose.yml b/dashboard-visualiser-kibana/docker-compose.yml index c4d3691d..5719f3e2 100644 --- a/dashboard-visualiser-kibana/docker-compose.yml +++ b/dashboard-visualiser-kibana/docker-compose.yml @@ -33,6 +33,7 @@ services: elastic: default: + configs: kibana-kibana.yml: file: ./kibana.yml diff --git a/dashboard-visualiser-superset/docker-compose.yml b/dashboard-visualiser-superset/docker-compose.yml index 36c35097..f2aa2558 100644 --- a/dashboard-visualiser-superset/docker-compose.yml +++ b/dashboard-visualiser-superset/docker-compose.yml @@ -46,6 +46,7 @@ services: postgres: default: + configs: superset_config.py: file: ./config/superset_config.py @@ -71,6 +72,7 @@ configs: volumes: superset_home: + networks: clickhouse: name: clickhouse_public diff --git a/fhir-ig-importer/docker-compose.yml b/fhir-ig-importer/docker-compose.yml index c1bca48c..7c87cced 100644 --- a/fhir-ig-importer/docker-compose.yml +++ b/fhir-ig-importer/docker-compose.yml @@ -21,6 +21,8 @@ services: reverse-proxy: environment: FHIR_IG_IMPORTER_CORE_URL: ${FHIR_IG_IMPORTER_CORE_URL} + OPENHIM_API_USERNAME: ${OPENHIM_USERNAME} + OPENHIM_API_PASSWORD: ${OPENHIM_PASSWORD} networks: hapi-fhir: diff --git a/fhir-ig-importer/importer/docker-compose.config.yml b/fhir-ig-importer/importer/docker-compose.config.yml index 0d11921a..3447da3b 100644 --- a/fhir-ig-importer/importer/docker-compose.config.yml +++ b/fhir-ig-importer/importer/docker-compose.config.yml @@ -12,6 +12,7 @@ services: OPENHIM_API_PASSWORD: ${OPENHIM_PASSWORD} # Reject unauthorised is only needed if the OpenHIM's SSL is not setup NODE_TLS_REJECT_UNAUTHORIZED: 0 + OPENHIM_CONSOLE_BASE_URL: ${OPENHIM_CONSOLE_BASE_URL} command: sh -c "node openhimConfig.js" configs: - source: fhir-ig-importer-config-importer-openhimConfig.js diff --git a/fhir-ig-importer/importer/volume/ig-importer-app.json b/fhir-ig-importer/importer/volume/ig-importer-app.json index 4517c9b8..b4336fba 100644 --- a/fhir-ig-importer/importer/volume/ig-importer-app.json +++ b/fhir-ig-importer/importer/volume/ig-importer-app.json @@ -3,7 +3,7 @@ "description": "FHIR IG microfrontend app", "category": "HIE Configuration", "type": "esmodule", - "url": "https://openhimconsole./fhir-ig-importer", + "url": "/fhir-ig-importer", "showInPortal": true, "showInSideBar": true, "access_roles": ["admin"], diff --git a/fhir-ig-importer/importer/volume/openhimConfig.js b/fhir-ig-importer/importer/volume/openhimConfig.js index cae7a270..4a9b2ceb 100644 --- a/fhir-ig-importer/importer/volume/openhimConfig.js +++ b/fhir-ig-importer/importer/volume/openhimConfig.js @@ -43,6 +43,18 @@ const appJsonData = JSON.parse( fs.readFileSync(path.resolve(__dirname, "ig-importer-app.json")) ); +//Substitute the url with environ variable + +let url = appJsonData.url; +if (!process.env.OPENHIM_CONSOLE_BASE_URL) { + throw new Error("Environment variable OPENHIM_CONSOLE_BASE_URL is not set"); +} +let newUrl = url.replace( + "", + process.env.OPENHIM_CONSOLE_BASE_URL +); + +appJsonData.url = newUrl; const data = JSON.stringify(jsonData); const appData = JSON.stringify(appJsonData); diff --git a/fhir-ig-importer/package-metadata.json b/fhir-ig-importer/package-metadata.json index 1bc5473f..bed49d43 100644 --- a/fhir-ig-importer/package-metadata.json +++ b/fhir-ig-importer/package-metadata.json @@ -15,6 +15,9 @@ "FHIR_IG_IMPORTER_CORE_HOST": "0.0.0.0", "FHIR_IG_IMPORTER_CORE_URL": "http://0.0.0.0:3001/fhir/ig/v1.0", "FHIR_IG_IMPORTER_UI_VERSION": "latest", - "FHIR_IG_IMPORTER_CORE_VERSION": "latest" + "FHIR_IG_IMPORTER_CORE_VERSION": "latest", + "OPENHIM_CONSOLE_BASE_URL": "http://localhost:9000", + "OPENHIM_API_USERNAME": "root@openhim.org", + "OPENHIM_API_PASSWORD": "instant101" } } diff --git a/identity-access-manager-keycloak/docker-compose.yml b/identity-access-manager-keycloak/docker-compose.yml index 3c1fbc69..b3d99f88 100644 --- a/identity-access-manager-keycloak/docker-compose.yml +++ b/identity-access-manager-keycloak/docker-compose.yml @@ -8,7 +8,7 @@ services: "start", "--proxy=edge", "--hostname-url=${KC_FRONTEND_URL}", - "--import-realm", + "--import-realm" ] hostname: identity-access-manager-keycloak healthcheck: @@ -49,10 +49,12 @@ services: - traefik.enable=true - traefik.docker.network=reverse-proxy-traefik_public - traefik.http.routers.identity-access-manager-keycloak.service=identity-access-manager-keycloak + - traefik.http.services.identity-access-manager-keycloak.loadbalancer.server.scheme=http - traefik.http.services.identity-access-manager-keycloak.loadbalancer.server.port=8080 - traefik.http.routers.identity-access-manager-keycloak.rule=Host(`${KC_TRAEFIK_SUBDOMAIN}.${DOMAIN_NAME_HOST_TRAEFIK}`) - traefik.http.routers.identity-access-manager-keycloak.tls=true - traefik.http.routers.identity-access-manager-keycloak.tls.certresolver=${CERT_RESOLVER} + - traefik.http.routers.identity-access-manager-keycloak.entrypoints=websecure networks: reverse-proxy: public: @@ -60,6 +62,7 @@ services: default: postgres: + configs: realm.json: file: ./config/realm.json diff --git a/interoperability-layer-openhim/docker-compose.yml b/interoperability-layer-openhim/docker-compose.yml index 59a1d95e..a8101577 100644 --- a/interoperability-layer-openhim/docker-compose.yml +++ b/interoperability-layer-openhim/docker-compose.yml @@ -63,9 +63,6 @@ services: - traefik.http.routers.openhimcore.middlewares=openhimcore-stripprefix - traefik.http.routers.openhimcore.tls.certresolver=le - - - openhim-console: image: ${OPENHIM_CONSOLE_IMAGE} environment: @@ -95,7 +92,7 @@ services: - traefik.http.routers.openhim-console.service=openhim-console - traefik.http.routers.openhim-console.entrypoints=websecure - traefik.http.routers.openhim-console.tls=true - - traefik.http.routers.openhim-console.rule=Host(`${DOMAIN_NAME}`) + - traefik.http.routers.openhim-console.rule=Host(`${DOMAIN_NAME_HOST_TRAEFIK}`) - traefik.http.services.openhim-console.loadbalancer.server.port=80 placement: max_replicas_per_node: ${OPENHIM_CONSOLE_MAX_REPLICAS_PER_NODE} diff --git a/interoperability-layer-openhim/importer/volume/openhimConfig.js b/interoperability-layer-openhim/importer/volume/openhimConfig.js index a83b6865..49408e01 100644 --- a/interoperability-layer-openhim/importer/volume/openhimConfig.js +++ b/interoperability-layer-openhim/importer/volume/openhimConfig.js @@ -1,54 +1,54 @@ -'use strict' +"use strict"; -const fs = require('fs') -const https = require('https') -const path = require('path') +const fs = require("fs"); +const https = require("https"); +const path = require("path"); -const OPENHIM_CORE_SERVICE_NAME = 'openhim-core' -const OPENHIM_MEDIATOR_API_PORT = 8080 +const OPENHIM_CORE_SERVICE_NAME = "openhim-core"; +const OPENHIM_MEDIATOR_API_PORT = 8080; const OPENHIM_API_PASSWORD = - process.env.OPENHIM_API_PASSWORD || 'openhim-password' + process.env.OPENHIM_DEFAULT_PASSWORD || "openhim-password"; const OPENHIM_API_USERNAME = - process.env.OPENHIM_API_USERNAME || 'root@openhim.org' + process.env.OPENHIM_API_USERNAME || "root@openhim.org"; const authHeader = new Buffer.from( `${OPENHIM_API_USERNAME}:${OPENHIM_API_PASSWORD}` -).toString('base64') +).toString("base64"); const jsonData = JSON.parse( - fs.readFileSync(path.resolve(__dirname, 'openhim-import.json')) -) + fs.readFileSync(path.resolve(__dirname, "openhim-import.json")) +); -const data = JSON.stringify(jsonData) +const data = JSON.stringify(jsonData); const options = { - protocol: 'https:', + protocol: "https:", hostname: OPENHIM_CORE_SERVICE_NAME, port: OPENHIM_MEDIATOR_API_PORT, - path: '/metadata', - method: 'POST', + path: "/metadata", + method: "POST", headers: { - 'Content-Type': 'application/json', - 'Content-Length': data.length, - Authorization: `Basic ${authHeader}` - } -} + "Content-Type": "application/json", + "Content-Length": data.length, + Authorization: `Basic ${authHeader}`, + }, +}; -const req = https.request(options, res => { +const req = https.request(options, (res) => { if (res.statusCode == 401) { - throw new Error(`Incorrect OpenHIM API credentials`) + throw new Error(`Incorrect OpenHIM API credentials`); } if (res.statusCode != 201) { - throw new Error(`Failed to import OpenHIM config: ${res.statusCode}`) + throw new Error(`Failed to import OpenHIM config: ${res.statusCode}`); } - console.log('Successfully Imported OpenHIM Config') -}) + console.log("Successfully Imported OpenHIM Config"); +}); -req.on('error', error => { - console.error('Failed to import OpenHIM config: ', error) -}) +req.on("error", (error) => { + console.error("Failed to import OpenHIM config: ", error); +}); -req.write(data) -req.end() +req.write(data); +req.end(); diff --git a/interoperability-layer-openhim/package-metadata.json b/interoperability-layer-openhim/package-metadata.json index fb92768a..8a307267 100644 --- a/interoperability-layer-openhim/package-metadata.json +++ b/interoperability-layer-openhim/package-metadata.json @@ -43,7 +43,7 @@ "KC_OPENHIM_CLIENT_SECRET": "tZKfEbWf0Ka5HBNZwFrdSyQH2xT1sNMR", "KC_OPENHIM_ROOT_URL": "http://localhost:9000", "KC_API_URL": "http://identity-access-manager-keycloak:8080", - "OPENHIM_CONSOLE_BASE_URL": "https://localhost:9000", + "OPENHIM_CONSOLE_BASE_URL": "http://localhost:9000", "OPENHIM_API_HOST": "localhost", "OPENHIM_API_PORT": "5001" } diff --git a/kafka-mapper-consumer/consumer-ui-app.json b/kafka-mapper-consumer/consumer-ui-app.json index b6ac02d7..42d47345 100644 --- a/kafka-mapper-consumer/consumer-ui-app.json +++ b/kafka-mapper-consumer/consumer-ui-app.json @@ -3,7 +3,7 @@ "description": "Kafka mapper consumer microfrontends app", "category": "HIE Configuration", "type": "esmodule", - "url": "http://localhost:8091/jembi-kafka-mapper-consumer-ui.js", + "url": "/kafka-mapper-consumer-ui", "showInPortal": true, "showInSideBar": false, "access_roles": ["admin"], diff --git a/kafka-mapper-consumer/docker-compose.config.yml b/kafka-mapper-consumer/docker-compose.config.yml index 2e1b4db5..dd13d684 100644 --- a/kafka-mapper-consumer/docker-compose.config.yml +++ b/kafka-mapper-consumer/docker-compose.config.yml @@ -12,6 +12,7 @@ services: OPENHIM_API_PASSWORD: ${OPENHIM_PASSWORD} # Reject unauthorised is only needed if the OpenHIM's SSL is not setup NODE_TLS_REJECT_UNAUTHORIZED: 0 + OPENHIM_CONSOLE_BASE_URL: ${OPENHIM_CONSOLE_BASE_URL} command: sh -c "node openhimConfig.js" configs: - source: kafka-mapper-consumer-openhimConfig.js diff --git a/kafka-mapper-consumer/openhimConfig.js b/kafka-mapper-consumer/openhimConfig.js index a7868cde..c56379df 100644 --- a/kafka-mapper-consumer/openhimConfig.js +++ b/kafka-mapper-consumer/openhimConfig.js @@ -37,6 +37,20 @@ function makeRequest(options, data) { const appJsonData = JSON.parse( fs.readFileSync(path.resolve(__dirname, "consumer-ui-app.json")) ); +//Substitute the url with environ variable + +let url = appJsonData.url; + +if (!process.env.OPENHIM_CONSOLE_BASE_URL) { + throw new Error("Environment variable OPENHIM_CONSOLE_BASE_URL is not set"); +} + +let newUrl = url.replace( + "", + process.env.OPENHIM_CONSOLE_BASE_URL +); + +appJsonData.url = newUrl; const appData = JSON.stringify(appJsonData); const options = { diff --git a/kafka-mapper-consumer/package-metadata.json b/kafka-mapper-consumer/package-metadata.json index 0c0b17a9..9fa23ea9 100644 --- a/kafka-mapper-consumer/package-metadata.json +++ b/kafka-mapper-consumer/package-metadata.json @@ -17,7 +17,8 @@ "REGISTER_MEDIATOR": "true", "CLICKHOUSE_HOST": "analytics-datastore-clickhouse", "CLICKHOUSE_PORT": "8123", - "KAFKA_CONSUMER_MAPPER_MEDIATOR_VERSION": "jembi/kafka-mapper-consumer:v0.0.1", - "KAFKA_CONSUMER_MAPPER_UI_VERSION": "jembi/kafka-mapper-consumer-ui:v0.0.1" + "KAFKA_CONSUMER_MAPPER_MEDIATOR_VERSION": "jembi/kafka-mapper-consumer:latest", + "KAFKA_CONSUMER_MAPPER_UI_VERSION": "jembi/kafka-mapper-consumer-ui:latest", + "OPENHIM_CONSOLE_BASE_URL": "http://localhost:9000" } } diff --git a/monitoring/docker-compose.yml b/monitoring/docker-compose.yml index 917bafb6..661068f2 100644 --- a/monitoring/docker-compose.yml +++ b/monitoring/docker-compose.yml @@ -11,11 +11,13 @@ services: - traefik.docker.network=reverse-proxy-traefik_public - traefik.http.routers.grafana.service=grafana - traefik.http.services.grafana.loadbalancer.server.port=3000 - - traefik.http.routers.grafana.rule=Host(${DOMAIN_NAME} && PathPrefix(`/grafana`) + - traefik.http.routers.grafana.rule=Host(`${DOMAIN_NAME_HOST_TRAEFIK}`) && PathPrefix(`/grafana`) + - traefik.http.routers.grafana.tls=true + - traefik.http.services.grafana.loadbalancer.server.scheme=http + - traefik.http.routers.grafana.entrypoints=websecure + - traefik.http.routers.grafana.tls.certresolver=le - traefik.http.middlewares.grafana-stripprefix.stripprefix.prefixes=/grafana - traefik.http.routers.grafana.middlewares=grafana-stripprefix - - traefik.http.routers.openhim-console.tls=true - - traefik.http.services.openhim-console.loadbalancer.server.scheme=http environment: GF_SECURITY_ADMIN_USER: ${GF_SECURITY_ADMIN_USER} GF_SECURITY_ADMIN_PASSWORD: ${GF_SECURITY_ADMIN_PASSWORD} @@ -41,8 +43,8 @@ services: GF_AUTH_GENERIC_OAUTH_TOKEN_URL: "${KC_API_URL}/realms/${KC_REALM_NAME}/protocol/openid-connect/token" GF_AUTH_GENERIC_OAUTH_API_URL: "${KC_API_URL}/realms/${KC_REALM_NAME}/protocol/openid-connect/userinfo" GF_AUTH_GENERIC_OAUTH_ROLE_ATTRIBUTE_PATH: "contains(roles[*], 'admin') && 'Admin' || contains(roles[*], 'editor') && 'Editor' || 'Viewer'" - GF_SERVER_DOMAIN: ${GF_SERVER_DOMAIN} - GF_SERVER_ROOT_URL: ${KC_GRAFANA_ROOT_URL} + GF_SERVER_DOMAIN: ${DOMAIN_NAME_HOST_TRAEFIK} + GF_SERVER_ROOT_URL: ${DOMAIN_NAME_HOST_TRAEFIK} GF_SERVER_SERVE_FROM_SUB_PATH: ${GF_SERVER_SERVE_FROM_SUB_PATH} GF_AUTH_SIGNOUT_REDIRECT_URL: "${KC_FRONTEND_URL}/realms/${KC_REALM_NAME}/protocol/openid-connect/logout?client_id=${KC_GRAFANA_CLIENT_ID}&post_logout_redirect_uri=${KC_GRAFANA_ROOT_URL}/login" configs: @@ -177,8 +179,13 @@ services: labels: - traefik.enable=true - traefik.docker.network=reverse-proxy-traefik_public - - traefik.http.routers.minio.rule=${DOMAIN_NAME_HOST_TRAEFIK} && PathPrefix(`/minio`) + - traefik.http.routers.minio.service=minio + - traefik.http.routers.minio.rule=Host(`${DOMAIN_NAME_HOST_TRAEFIK}`) && PathPrefix(`/minio`) - traefik.http.services.minio.loadbalancer.server.port=9001 + - traefik.http.routers.minio.tls=true + - traefik.http.services.minio.loadbalancer.server.scheme=http + - traefik.http.routers.minio.entrypoints=websecure + - traefik.http.routers.minio.tls.certresolver=le - traefik.http.middlewares.minio-stripprefix.stripprefix.prefixes=/minio - traefik.http.routers.minio.middlewares=minio-stripprefix networks: diff --git a/reprocess-mediator/docker-compose.config.yml b/reprocess-mediator/docker-compose.config.yml index 1135b51e..6ed5fbb8 100644 --- a/reprocess-mediator/docker-compose.config.yml +++ b/reprocess-mediator/docker-compose.config.yml @@ -12,6 +12,7 @@ services: OPENHIM_API_PASSWORD: ${OPENHIM_PASSWORD} # Reject unauthorised is only needed if the OpenHIM's SSL is not setup NODE_TLS_REJECT_UNAUTHORIZED: 0 + OPENHIM_CONSOLE_BASE_URL: ${OPENHIM_CONSOLE_BASE_URL} command: sh -c "node openhimConfig.js" configs: - source: reprocess-openhimConfig.js diff --git a/reprocess-mediator/openhimConfig.js b/reprocess-mediator/openhimConfig.js index e5268dd9..d645c501 100644 --- a/reprocess-mediator/openhimConfig.js +++ b/reprocess-mediator/openhimConfig.js @@ -37,6 +37,19 @@ function makeRequest(options, data) { const appJsonData = JSON.parse( fs.readFileSync(path.resolve(__dirname, "reprocess-ui-app.json")) ); +//Substitute the url with environ variable + +let url = appJsonData.url; + +if (!process.env.OPENHIM_CONSOLE_BASE_URL) { + throw new Error("Environment variable OPENHIM_CONSOLE_BASE_URL is not set"); +} +let newUrl = url.replace( + "", + process.env.OPENHIM_CONSOLE_BASE_URL +); + +appJsonData.url = newUrl; const appData = JSON.stringify(appJsonData); const options = { diff --git a/reprocess-mediator/package-metadata.json b/reprocess-mediator/package-metadata.json index fa8c999d..049d2e32 100644 --- a/reprocess-mediator/package-metadata.json +++ b/reprocess-mediator/package-metadata.json @@ -12,10 +12,10 @@ "OPENHIM_PASSWORD": "instant101", "REGISTER_MEDIATOR": "true", "REPROCESSOR_API_BASE_URL": "http://reprocess-mediator:3000", - "REPROCESS_MEDIATOR_VERSION": "jembi/reprocess-mediator:v0.1.0", - "REPROCESS_MEDIATOR_UI_VERSION": "jembi/reprocess-mediator-ui:v0.1.0", + "REPROCESS_MEDIATOR_VERSION": "jembi/reprocess-mediator:latest", + "REPROCESS_MEDIATOR_UI_VERSION": "jembi/reprocess-mediator-ui:latest", "MONGODB_CONNECTION_STRING": "mongodb://mongo-1:27017/openhim", - "MONGODB_DIRECT_CONNECTION": false - + "MONGODB_DIRECT_CONNECTION": false, + "OPENHIM_CONSOLE_BASE_URL": "http://localhost:9000" } } diff --git a/reprocess-mediator/reprocess-ui-app.json b/reprocess-mediator/reprocess-ui-app.json index 840b037b..f89da247 100644 --- a/reprocess-mediator/reprocess-ui-app.json +++ b/reprocess-mediator/reprocess-ui-app.json @@ -3,7 +3,7 @@ "description": "Reprocess microfrontends app", "category": "HIE Configuration", "type": "esmodule", - "url": "http://localhost:3030/jembi-reprocessor-mediator-microfrontend.js", + "url": "/reprocess-mediator-ui", "showInPortal": true, "showInSideBar": false, "access_roles": ["admin"], diff --git a/reverse-proxy-traefik/docker-compose.yml b/reverse-proxy-traefik/docker-compose.yml index 6fae1279..7d32d50b 100644 --- a/reverse-proxy-traefik/docker-compose.yml +++ b/reverse-proxy-traefik/docker-compose.yml @@ -37,7 +37,7 @@ services: - traefik.http.routers.to-https.entrypoints=http - traefik.http.routers.to-https.middlewares=to-https - - traefik.http.routers.traefik.rule=Host(`${DOMAIN_NAME}`) && PathPrefix(`/dashboard`) + - traefik.http.routers.traefik.rule=Host(`${DOMAIN_NAME_HOST_TRAEFIK}`) && PathPrefix(`/dashboard`) - traefik.http.routers.traefik.entrypoints=http - traefik.http.routers.traefik.middlewares=auth - traefik.http.routers.traefik.service=api@internal