diff --git a/dcompose-stack/radar-cp-hadoop-stack/README.md b/dcompose-stack/radar-cp-hadoop-stack/README.md index c28a88ff9..ef79a74b9 100644 --- a/dcompose-stack/radar-cp-hadoop-stack/README.md +++ b/dcompose-stack/radar-cp-hadoop-stack/README.md @@ -2,10 +2,13 @@ ## Configuration -First move `etc/env.template` file to `./.env` and check and modify all its variables. To have a valid HTTPS connection for a public host, set `SELF_SIGNED_CERT=no`. +First move `etc/env.template` file to `./.env` and check and modify all its variables. To have a valid HTTPS connection for a public host, set `SELF_SIGNED_CERT=no`. You need to provide a public valid DNS name as `SERVER_NAME` for SSL certificate to work. IP addresses will not work. Modify `etc/smtp.env.template` to set a SMTP host to send emails with, and move it to `etc/smtp.env`. The configuration settings are passed to a [namshi/smtp](https://hub.docker.com/r/namshi/smtp/) Docker container. This container supports a.o. regular SMTP and GMail. +Modify the `etc/redcap-integration/radar.yml.template` to configure the properties of Redcap instance and the management portal, and move it to `etc/redcap-integration/radar.yml`. For reference on cofiguration of this file look at the Readme file here - https://github.com/RADAR-CNS/RADAR-RedcapIntegration#configuration +In the REDcap portal under Project Setup, define the Data Trigger as `https:///redcapint/trigger` + Finally, move `etc/radar.yml.template` to `etc/radar.yml` and edit it, especially concerning the monitor email address configuration. ## Usage diff --git a/dcompose-stack/radar-cp-hadoop-stack/docker-compose.yml b/dcompose-stack/radar-cp-hadoop-stack/docker-compose.yml index 7be33f4b1..031a2f8ed 100644 --- a/dcompose-stack/radar-cp-hadoop-stack/docker-compose.yml +++ b/dcompose-stack/radar-cp-hadoop-stack/docker-compose.yml @@ -22,6 +22,9 @@ networks: hotstorage: driver: bridge internal: true + redcap: + driver: bridge + internal: true volumes: kafka-1-data: {} @@ -205,6 +208,26 @@ services: timeout: 5s retries: 3 + + #---------------------------------------------------------------------------# + # RADAR REDCap Integration # + #---------------------------------------------------------------------------# + radar-integration: + image: radarcns/radar-redcapintegration:latest + networks: + - redcap + - default + #depends_on: + #- hotstorage + restart: always + volumes: + - "./etc/redcap-integration:/usr/local/tomcat/conf/radar" + healthcheck: + test: ["CMD", "curl", "-IX", "POST", "http://localhost:8080/redcap/trigger"] + interval: 1m + timeout: 5s + retries: 3 + #---------------------------------------------------------------------------# # RADAR Dashboard # #---------------------------------------------------------------------------# @@ -410,7 +433,7 @@ services: restart: always environment: KAFKA_REST_PROXY: http://rest-proxy-1:8082 - TOPIC_LIST: ${RADAR_TOPIC_LIST} + TOPIC_LIST: ${RADAR_TOPIC_LIST} #---------------------------------------------------------------------------# # Docker Monitoring # @@ -445,6 +468,7 @@ services: restart: always networks: - api + - redcap - monitor - default depends_on: @@ -454,6 +478,7 @@ services: - schema-registry-1 - rest-proxy-1 - dashboard + - radar-integration ports: - "80:80" - "443:443" diff --git a/dcompose-stack/radar-cp-hadoop-stack/etc/nginx.conf.template b/dcompose-stack/radar-cp-hadoop-stack/etc/nginx.conf.template index 047f1f82f..cca6a8a98 100644 --- a/dcompose-stack/radar-cp-hadoop-stack/etc/nginx.conf.template +++ b/dcompose-stack/radar-cp-hadoop-stack/etc/nginx.conf.template @@ -90,6 +90,10 @@ http { proxy_pass http://rest-api:8080/radar/api/; proxy_set_header Host $host; } + location /redcapint/ { + proxy_pass http://radar-integration:8080/redcap/; + proxy_set_header Host $host; + } location /frontend/config/ { proxy_pass http://rest-api:8080/radar/frontend/; proxy_set_header Host $host; diff --git a/dcompose-stack/radar-cp-hadoop-stack/etc/redcap-integration/radar.yml.template b/dcompose-stack/radar-cp-hadoop-stack/etc/redcap-integration/radar.yml.template new file mode 100644 index 000000000..78e083ffe --- /dev/null +++ b/dcompose-stack/radar-cp-hadoop-stack/etc/redcap-integration/radar.yml.template @@ -0,0 +1,21 @@ +version: 0.1-alpha +released: 2017-08-29 + +# ManagementPortal configuration +oauth_client_id: #OAuth2 clientId used by the webApp for making requests +oauth_client_secret: #OAuth2 client secrete +management_portal_url: #URL pointing Management Portal +token_endpoint: #URL managing tokens +project_endpoint: #URL managing project function +subject_endpoint: #URL managing subject functions + +# Set of supported projects +projects: + - redcap_info: + url: #URL pointing REDCap instance + project_id: #REDCap project identifier + enrolment_event: #Unique identifier for the enrolment event + integration_form: #Name of integration REDCap form + token: #REDCap API Token used to identify the REDCap user against the REDCap instance + mp_info: + project_id: #Management Portal project identifier diff --git a/dcompose-stack/radar-cp-hadoop-stack/install-radar-stack.sh b/dcompose-stack/radar-cp-hadoop-stack/install-radar-stack.sh index a7e76f5ec..10636bc54 100755 --- a/dcompose-stack/radar-cp-hadoop-stack/install-radar-stack.sh +++ b/dcompose-stack/radar-cp-hadoop-stack/install-radar-stack.sh @@ -40,6 +40,9 @@ echo "==> Configuring REST-API" copy_template_if_absent etc/rest-api/radar.yml copy_template_if_absent etc/rest-api/device-catalog.yml +echo "==> Configuring REDCap-Integration" +copy_template_if_absent etc/redcap-integration/radar.yml + # Set MongoDb credential inline_variable 'usr:[[:space:]]' $HOTSTORAGE_USERNAME etc/rest-api/radar.yml inline_variable 'pwd:[[:space:]]' $HOTSTORAGE_PASSWORD etc/rest-api/radar.yml