Skip to content
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

CARDS-2360: Display startup warning if the GOOGLE_APIKEY environment variable is not set #1605

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
1 change: 1 addition & 0 deletions environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) | |
sdumitriu marked this conversation as resolved.
Show resolved Hide resolved
| `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` |
Expand Down
14 changes: 14 additions & 0 deletions start_cards.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
marta- marked this conversation as resolved.
Show resolved Hide resolved
}

function message_hancestro_install_ok() {
echo -e "${TERMINAL_GREEN}***********************${TERMINAL_NOCOLOR}"
echo -e "${TERMINAL_GREEN}* *${TERMINAL_NOCOLOR}"
Expand Down Expand Up @@ -520,6 +528,12 @@ then
fi
fi

#Check if a GOOGLE_APIKEY is present
if [ -z $GOOGLE_APIKEY ]
then
message_google_apikey_missing
fi

#Check if we are using the Cloud-IAM.com demo
if [ $CLOUD_IAM_DEMO = true ]
then
Expand Down