From fe232c3a7110cf306b7e102b951bcd0fe89475a4 Mon Sep 17 00:00:00 2001 From: veronikaslc Date: Wed, 27 Sep 2023 11:55:30 -0400 Subject: [PATCH 1/4] CARDS-2360: Display startup warning if the GOOGLE_APIKEY environment variable is not set --- README.md | 2 ++ environment.md | 1 + start_cards.sh | 14 ++++++++++++++ 3 files changed, 17 insertions(+) diff --git a/README.md b/README.md index f7859f6d2a..042b4173f3 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,8 @@ By default, the app will run with username `admin` and password `admin`. In order to use "Vocabularies" section and load vocabularies from BioPortal (bioontology.org) `BIOPORTAL_APIKEY` environment variable should be set to a valid BioPortal API key. You can [request a new account](https://bioportal.bioontology.org/accounts/new) if you don't already have one, and the API key can be found [in your profile](https://bioportal.bioontology.org/account). +A Google API key enables access to Google services such as address autocomplete. `GOOGLE_APIKEY` environment variable should be set to a valid Google API key. You can [can obtain an API key at]( https://developers.google.com/maps/documentation/javascript/get-api-key) if you don't already have one. Follow [these steps](https://help.stockist.co/article/43-verifying-your-google-maps-api-key) to ensure the necessary services such as Places service are enabled for your key. + ## Running with Docker If Docker is installed, then the build can also create a new image named `cards/cards:latest` if building with `mvn install -Pdocker`. diff --git a/environment.md b/environment.md index 9e0bb30595..82fd19a80c 100644 --- a/environment.md +++ b/environment.md @@ -21,6 +21,7 @@ The following environment variables are read by CARDS and thus can be used in bo | `SLACK_PERFORMANCE_URL` | The Slack incoming webhook URL which the performance logger (`io.uhndata.cards.patients.slacknotifications`) can write its performance update messages to | `https://hooks.slack.com/services/ery8974/342rUYEiue/KJHkggI8973130DddE3r` | | `SLACK_BACKUP_NOTIFICATIONS_URL` | The Slack incoming webhook URL which the Webhook backup task (`io.uhndata.cards.webhookbackup`) uses to log its backup task status (_started_/_completed_/_failed_) messages | `https://hooks.slack.com/services/ery8974/342rUYEiue/KJHkggI8973130DddE3r` | | `BIOPORTAL_APIKEY` | API key [for Bioportal vocabularies](https://data.bioontology.org/documentation) | | +| `GOOGLE_APIKEY` | API key [for Google Maps Place services](https://developers.google.com/maps/documentation/places/web-service/get-api-key) | | | `NIGHTLY_WEBHOOK_BACKUP_SCHEDULE` | Crontab-readable schedule (Quartz Job Scheduler) for performing Webhook backups of CARDS | `0 0 6 * * ? *` | | `BACKUP_WEBHOOK_URL` | Webhook URL to perform backups of CARDS to | `http://localhost:8012` | | `CLARITY_SQL_SERVER` | The MS-SQL server and port number to import clarity data from | `mssql:1433` | diff --git a/start_cards.sh b/start_cards.sh index 652ed0ae84..36557a954e 100755 --- a/start_cards.sh +++ b/start_cards.sh @@ -135,6 +135,14 @@ function message_bioportal_apikey_missing() { echo -e "${TERMINAL_RED}********************************************************************${TERMINAL_NOCOLOR}" } +function message_google_apikey_missing() { + echo -e "${TERMINAL_RED}*******************************${TERMINAL_NOCOLOR}" + echo -e "${TERMINAL_RED}* *${TERMINAL_NOCOLOR}" + echo -e "${TERMINAL_RED}* GOOGLE_APIKEY not specified *${TERMINAL_NOCOLOR}" + echo -e "${TERMINAL_RED}* *${TERMINAL_NOCOLOR}" + echo -e "${TERMINAL_RED}*******************************${TERMINAL_NOCOLOR}" +} + function message_hancestro_install_ok() { echo -e "${TERMINAL_GREEN}***********************${TERMINAL_NOCOLOR}" echo -e "${TERMINAL_GREEN}* *${TERMINAL_NOCOLOR}" @@ -520,6 +528,12 @@ then fi fi +#Check if a GOOGLE_APIKEY is present +if [ -z $BIOPORTAL_APIKEY ] +then + message_google_apikey_missing +fi + #Check if we are using the Cloud-IAM.com demo if [ $CLOUD_IAM_DEMO = true ] then From 9808209504b0733a8b2bf53fa9bb9c7176ceab95 Mon Sep 17 00:00:00 2001 From: Marta Girdea Date: Wed, 27 Sep 2023 12:32:04 -0400 Subject: [PATCH 2/4] CARDS-2360: Display startup warning if the GOOGLE_APIKEY environment variable is not set Fix copy/paste artifact --- start_cards.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/start_cards.sh b/start_cards.sh index 36557a954e..f5f90bd80b 100755 --- a/start_cards.sh +++ b/start_cards.sh @@ -529,7 +529,7 @@ then fi #Check if a GOOGLE_APIKEY is present -if [ -z $BIOPORTAL_APIKEY ] +if [ -z $GOOGLE_APIKEY ] then message_google_apikey_missing fi From f90cc852d5feb699e87cda2e46904818fae80d0f Mon Sep 17 00:00:00 2001 From: Marta Girdea Date: Wed, 27 Sep 2023 12:48:15 -0400 Subject: [PATCH 3/4] CARDS-2360: Display startup warning if the GOOGLE_APIKEY environment variable is not set Change message color from red (error) to yellow (warning) --- start_cards.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/start_cards.sh b/start_cards.sh index f5f90bd80b..d94b602828 100755 --- a/start_cards.sh +++ b/start_cards.sh @@ -136,11 +136,11 @@ function message_bioportal_apikey_missing() { } function message_google_apikey_missing() { - echo -e "${TERMINAL_RED}*******************************${TERMINAL_NOCOLOR}" - echo -e "${TERMINAL_RED}* *${TERMINAL_NOCOLOR}" - echo -e "${TERMINAL_RED}* GOOGLE_APIKEY not specified *${TERMINAL_NOCOLOR}" - echo -e "${TERMINAL_RED}* *${TERMINAL_NOCOLOR}" - echo -e "${TERMINAL_RED}*******************************${TERMINAL_NOCOLOR}" + echo -e "${TERMINAL_YELLOW}*******************************${TERMINAL_NOCOLOR}" + echo -e "${TERMINAL_YELLOW}* *${TERMINAL_NOCOLOR}" + echo -e "${TERMINAL_YELLOW}* GOOGLE_APIKEY not specified *${TERMINAL_NOCOLOR}" + echo -e "${TERMINAL_YELLOW}* *${TERMINAL_NOCOLOR}" + echo -e "${TERMINAL_YELLOW}*******************************${TERMINAL_NOCOLOR}" } function message_hancestro_install_ok() { From 41da579f8c7c51c3a0044cfd2c02f33114f104aa Mon Sep 17 00:00:00 2001 From: Sergiu Dumitriu Date: Fri, 29 Sep 2023 10:07:21 -0400 Subject: [PATCH 4/4] [misc] Typo fix --- environment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.md b/environment.md index 82fd19a80c..9c474d1171 100644 --- a/environment.md +++ b/environment.md @@ -21,7 +21,7 @@ The following environment variables are read by CARDS and thus can be used in bo | `SLACK_PERFORMANCE_URL` | The Slack incoming webhook URL which the performance logger (`io.uhndata.cards.patients.slacknotifications`) can write its performance update messages to | `https://hooks.slack.com/services/ery8974/342rUYEiue/KJHkggI8973130DddE3r` | | `SLACK_BACKUP_NOTIFICATIONS_URL` | The Slack incoming webhook URL which the Webhook backup task (`io.uhndata.cards.webhookbackup`) uses to log its backup task status (_started_/_completed_/_failed_) messages | `https://hooks.slack.com/services/ery8974/342rUYEiue/KJHkggI8973130DddE3r` | | `BIOPORTAL_APIKEY` | API key [for Bioportal vocabularies](https://data.bioontology.org/documentation) | | -| `GOOGLE_APIKEY` | API key [for Google Maps Place services](https://developers.google.com/maps/documentation/places/web-service/get-api-key) | | +| `GOOGLE_APIKEY` | API key [for Google Maps Places services](https://developers.google.com/maps/documentation/places/web-service/get-api-key) | | | `NIGHTLY_WEBHOOK_BACKUP_SCHEDULE` | Crontab-readable schedule (Quartz Job Scheduler) for performing Webhook backups of CARDS | `0 0 6 * * ? *` | | `BACKUP_WEBHOOK_URL` | Webhook URL to perform backups of CARDS to | `http://localhost:8012` | | `CLARITY_SQL_SERVER` | The MS-SQL server and port number to import clarity data from | `mssql:1433` |