From 4ea99a765f4d0075e2a5f8755dfa04df42fe6c67 Mon Sep 17 00:00:00 2001 From: Daniel Volpato Date: Fri, 24 Sep 2021 11:16:04 -0300 Subject: [PATCH 1/4] docs(cluster): update README.md regarding Docker repository --- cluster/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cluster/README.md b/cluster/README.md index 66f8423..e1aee19 100644 --- a/cluster/README.md +++ b/cluster/README.md @@ -42,7 +42,7 @@ Or destroy the Docker images and all database data (which is stored in a Docker- ## Advanced Usage -By default, `start.sh` will pull the image [amcgee/dhis2-core:dev-alpine](https://hub.docker.com/r/amcgee/dhis2-core/tags/) from Docker Hub. You can specify a custom image tag (though not a custom image at this time) with the environment variable `DHIS2_CORE_TAG`, for example: +By default, `start.sh` will pull the [dhis2/core](https://hub.docker.com/r/dhis2/core/tags) image specified in [.env](.env) from Docker Hub. You can specify a custom image tag (though not a custom image at this time) with the environment variable `DHIS2_CORE_TAG`, for example: ```sh > DHIS2_CORE_TAG=2.31-rc1-alpine ./scripts/start.sh From dc153128dfdf8d5d673a105b9744ccaed5b0503d Mon Sep 17 00:00:00 2001 From: Daniel Volpato Date: Fri, 24 Sep 2021 11:21:40 -0300 Subject: [PATCH 2/4] feat: add scripts to get docker-compose logs --- app-hub/README.md | 6 ++++++ app-hub/scripts/logs.sh | 4 ++++ cluster/README.md | 6 +++++- cluster/scripts/logs.sh | 4 ++++ 4 files changed, 19 insertions(+), 1 deletion(-) create mode 100755 app-hub/scripts/logs.sh create mode 100755 cluster/scripts/logs.sh diff --git a/app-hub/README.md b/app-hub/README.md index e50af50..474c665 100644 --- a/app-hub/README.md +++ b/app-hub/README.md @@ -16,6 +16,12 @@ To start the PostgreSQL server and App Hub backend/frontend you can start everyt Once started, the services should automatically restart if Docker or the host machine are restarted. +You may check the logs by running: + +```bash +> ./scripts/logs.sh +``` + You can stop the services manually, this will also destroy the database as this is currently not in a separate volume: ```bash diff --git a/app-hub/scripts/logs.sh b/app-hub/scripts/logs.sh new file mode 100755 index 0000000..6608d15 --- /dev/null +++ b/app-hub/scripts/logs.sh @@ -0,0 +1,4 @@ +#!/bin/bash +set -e + +docker-compose logs --timestamps --follow \ No newline at end of file diff --git a/cluster/README.md b/cluster/README.md index e1aee19..9c21d02 100644 --- a/cluster/README.md +++ b/cluster/README.md @@ -24,7 +24,11 @@ Once the containers have been built and the database seeded you can start the cl > ./scripts/start.sh ``` -_(it may take a couple minutes for the Java server to initialize)_ +_It may take a couple minutes for the Java server to initialize_. You may check the logs by running: + +```bash +> ./scripts/logs.sh +``` Once started, the services should automatically restart if Docker or the host machine are restarted. diff --git a/cluster/scripts/logs.sh b/cluster/scripts/logs.sh new file mode 100755 index 0000000..6608d15 --- /dev/null +++ b/cluster/scripts/logs.sh @@ -0,0 +1,4 @@ +#!/bin/bash +set -e + +docker-compose logs --timestamps --follow \ No newline at end of file From c697c6e51042ec5a68fb45b3b18ec00a9123a202 Mon Sep 17 00:00:00 2001 From: Daniel Volpato Date: Fri, 24 Sep 2021 13:51:32 -0300 Subject: [PATCH 3/4] chore(cluster): update to latest 2.36 --- cluster/.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cluster/.env b/cluster/.env index 095b6da..930894d 100644 --- a/cluster/.env +++ b/cluster/.env @@ -1,4 +1,4 @@ -DHIS2_CORE_IMAGE=dhis2/core:2.35.3 +DHIS2_CORE_IMAGE=dhis2/core:2.36.3 DHIS2_CORE_PORT=8080 DHIS2_CORE_CONTEXT_PATH= DHIS2_CORE_CONFIG= From 6a76998a4df5538f9e17eda2acc4e5510aaebebd Mon Sep 17 00:00:00 2001 From: Daniel Volpato Date: Mon, 27 Sep 2021 17:57:24 -0300 Subject: [PATCH 4/4] fix(app-hub): add missing vars to app-hub .env This fixes the following error when starting the container: "expected env ${var} to be present. --- app-hub/.apphub.env | 52 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 47 insertions(+), 5 deletions(-) diff --git a/app-hub/.apphub.env b/app-hub/.apphub.env index 22d5f88..57c64af 100644 --- a/app-hub/.apphub.env +++ b/app-hub/.apphub.env @@ -1,14 +1,56 @@ +DEBUG=apphub* + +#this is the id for the first user being seeded when using seed or start-and-seed scripts. Change it accordingly to your needs +NO_AUTH_MAPPED_USER_ID=58262f57-4f38-45c5-a3c2-9e30ab3ba2da + +# Server config. HOST=0.0.0.0 PORT=3000 -DEBUG=apphub* +NODE_ENV= +# Database config. +# If using AWS EBS, these environmental variables will be injected automatically +# (i.e. no need to set them manually in EBS environments). In local/other +# environments configure these for the postgres database to use for the app hub +# backend. RDS_HOSTNAME=app-hub_db_1 -RDS_DB_NAME=app-hub RDS_USERNAME=app-hub RDS_PASSWORD=app-hub +RDS_DB_NAME=app-hub +RDS_DB_PORT= -AUTH_STRATEGY=none +# Authentication config. +# Set `NO_AUTH_MAPPED_USER_ID=true` if no auth is used (such as in development). +# `AUTH_STRATEGY` sets the auth strategy used by the backend -- to use auth0 set +# this to 'jwt' and fill in the other `AUTH0_` vars. If not set then +# `NO_AUTH_MAPPED_USER_ID` must be true. +AUTH_STRATEGY= +# The M2M API must use the same audience as the web app, specify the audience to use here. +AUTH0_AUDIENCE= +# Auth0 domain, usually {tenant}.{region}.auth0.com (no protocol!) +AUTH0_DOMAIN= +# Auth0 issuer, usually domain with prepended HTTP-protocol, eg https://{tenant}.{region}.auth0.com +AUTH0_ISSUER= +# Algorithm used for signing the jwt-tokens (e.g. RS256 or HS256) +AUTH0_ALG= +# URI to JWKS that contains the public key for verification of JWT, +# eg. https://{tenant}.{region}.auth0.com/.well-known/jwks.json +AUTH0_JWKS_URI= -#this is the id for the first user being seeded when using seed or start-and-seed scripts. Change it accordingly to your needs -NO_AUTH_MAPPED_USER_ID=58262f57-4f38-45c5-a3c2-9e30ab3ba2da +#Auth0 management-API config, most of these are found under Auth0 Dashboard -> Applications -> Auth0 Management API +# Management-secret used for M2M management API +AUTH0_MANAGEMENT_SECRET= +# Audience for Management API, usually http://{tenant}.auth0.com/api/v2/ +AUTH0_MANAGEMENT_AUDIENCE= +#Management client-ID for the Management Application +AUTH0_MANAGEMENT_CLIENT_ID= + +# Secret for internal (non-Auth0) JWTs +INTERNAL_JWT_SECRET= +# AWS S3 config (optional). +# Specifies where application files will be stored if using S3. +AWS_REGION= +AWS_ACCESS_KEY_ID= +AWS_SECRET_ACCESS_KEY= +AWS_BUCKET_NAME=