-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into format-once
- Loading branch information
Showing
57 changed files
with
12,812 additions
and
2,855 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
name: New instance request | ||
about: Details for new instance | ||
title: New User Managament Tool instance for $PARTNERS_NAME | ||
|
||
|
||
--- | ||
|
||
**Partner Name**: _$PARTNERS_NAME_ | ||
**Proposed URL**: users-chis-_$COUNTRY_-cht-user-management | ||
**Config Name**: users-chis-$COUNTRY | ||
|
||
|
||
|
||
**Action Items** | ||
- [ ] verify URL: https://users-chis-$COUNTRY.app.medicmobile.org | ||
- [ ] ensure repo has [config](https://github.com/medic/cht-user-management/tree/main/src/config) for $COUNTRY. Directory and config name needs to match URL | ||
- [ ] create DNS entry: `CNAME` of `users-chis-$COUNTRY.app.medicmobile.org` -> `k8s-prodchtalb-dcc00345ac-1792311525.eu-west-2.elb.amazonaws.com` | ||
- [ ] create helm values file in [correct location](https://github.com/medic/cht-user-management/tree/main/scripts/deploy/values) | ||
- [ ] `helm install` chart so the instance is live at above URL [per docs](https://github.com/medic/cht-user-management/blob/main/scripts/deploy/medic-deploy.md) | ||
- [ ] update docs to have new instance in the `Known cofigurations` section |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ node_modules | |
dist | ||
.env* | ||
src/package.json | ||
.eslintcache | ||
.eslintcache | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
FROM node:20-alpine | ||
|
||
ENV EXTERNAL_PORT 3000 | ||
ENV PORT 3000 | ||
ENV EXTERNAL_PORT 3500 | ||
ENV PORT 3500 | ||
ENV NODE_ENV production | ||
|
||
WORKDIR /app | ||
|
||
HEALTHCHECK --interval=30s --timeout=3s \ | ||
CMD wget --spider http://localhost:${PORT}/_healthz || exit 1 | ||
CMD wget --spider http://127.0.0.1:${PORT}/_healthz || exit 1 | ||
|
||
COPY package*.json . | ||
COPY package*.json ./ | ||
RUN apk add git | ||
RUN npm ci --omit=dev | ||
|
||
COPY src ./src | ||
COPY tsconfig.json . | ||
COPY tsconfig.json ./ | ||
RUN npm run build | ||
|
||
CMD npm start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM node:20-alpine | ||
|
||
WORKDIR /app | ||
|
||
COPY package*.json ./ | ||
RUN apk add git | ||
RUN npm ci --omit=dev | ||
|
||
COPY src ./src | ||
COPY tsconfig.json ./ | ||
RUN npm run build | ||
|
||
CMD npm run start:worker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
services: | ||
redis: | ||
image: redis:6.2-alpine | ||
restart: always | ||
volumes: | ||
- redis-data:/data | ||
ports: | ||
- 6379:6379 | ||
|
||
|
||
volumes: | ||
redis-data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,40 @@ | ||
version: '3.7' | ||
|
||
services: | ||
redis: | ||
image: redis:6.2-alpine | ||
restart: always | ||
volumes: | ||
- redis-data:/data | ||
|
||
cht-user-management: | ||
image: public.ecr.aws/medic/cht-user-management:latest | ||
image: ${CHT_USER_MANAGEMENT_IMAGE:-public.ecr.aws/medic/cht-user-management:latest} | ||
environment: | ||
- EXTERNAL_PORT=${EXTERNAL_PORT:-3000} | ||
- NODE_ENV=${NODE_ENV:-production} | ||
- EXTERNAL_PORT=${EXTERNAL_PORT:-3500} | ||
- COOKIE_PRIVATE_KEY=${COOKIE_PRIVATE_KEY} | ||
- WORKER_PRIVATE_KEY=${WORKER_PRIVATE_KEY} | ||
- CONFIG_NAME=${CONFIG_NAME} | ||
- CHT_DEV_HTTP=${CHT_DEV_HTTP} | ||
- CHT_DEV_URL_PORT=${CHT_DEV_URL_PORT} | ||
- REDIS_HOST=${REDIS_HOST:-redis} | ||
- REDIS_PORT=${REDIS_PORT:-6379} | ||
ports: | ||
- '${EXTERNAL_PORT-3000}:${PORT:-3000}' | ||
- '${EXTERNAL_PORT-3500}:${PORT:-3500}' | ||
restart: always | ||
command: npm start | ||
depends_on: | ||
- redis | ||
|
||
cht-user-management-worker: | ||
image: ${CHT_USER_MANAGEMENT_WORKER_IMAGE:-public.ecr.aws/medic/cht-user-management-worker:latest} | ||
restart: always | ||
command: npm run start:worker | ||
environment: | ||
- NODE_ENV=${NODE_ENV:-production} | ||
- REDIS_HOST=${REDIS_HOST:-redis} | ||
- REDIS_PORT=${REDIS_PORT:-6379} | ||
- WORKER_PRIVATE_KEY=${WORKER_PRIVATE_KEY} | ||
depends_on: | ||
- redis | ||
|
||
volumes: | ||
redis-data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
#!/bin/bash | ||
set -e | ||
|
||
if [ ! -f ".env" ]; then | ||
echo "Please create a .env file first. Copy the env.example and edit the new file" | ||
exit 1 | ||
fi | ||
. .env | ||
|
||
if [[ -n $1 ]] && [[ $1 == "build" ]]; then | ||
docker build -f Dockerfile -t cht-user-management:local . | ||
docker build -f Dockerfile.worker -t cht-user-management-worker:local . | ||
elif [[ -z "$(docker images -q cht-user-management:local 2> /dev/null)" ]] || [[ -z "$(docker images -q cht-user-management-worker:local 2> /dev/null)" ]]; then | ||
echo;echo "Docker images not found - please call | ||
./docker-local-setup.sh build | ||
to build missing images";echo; | ||
exit 1 | ||
fi | ||
|
||
echo;echo "Starting Docker Compose...";echo | ||
CHT_USER_MANAGEMENT_IMAGE=cht-user-management:local CHT_USER_MANAGEMENT_WORKER_IMAGE=cht-user-management-worker:local docker compose up -d | ||
|
||
echo;echo "Server is now running at http://127.0.0.1:$EXTERNAL_PORT/login";echo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,17 @@ | ||
COOKIE_PRIVATE_KEY= | ||
CONFIG_NAME=chis-ke | ||
PORT=3000 # for development environment | ||
EXTERNAL_PORT=3000 # for docker | ||
INTERFACE=0.0.0.0 # Leave as '0.0.0.0' for prod, suggest '127.0.0.1' for development | ||
CHT_DEV_URL_PORT=localhost:5984 # where your dev CHT instance is, hostname:port | ||
CHT_DEV_HTTP=true # 'false' for http 'true' for https | ||
NODE_ENV= # set to "dev" to use CHT_DEV_URL_PORT below, leave empty for production | ||
COOKIE_PRIVATE_KEY= # unique random key, use uuidgen to populate | ||
WORKER_PRIVATE_KEY= # unique random key, use uuidgen to populate. different from COOKIE_PRIVATE_KEY | ||
CONFIG_NAME=chis-ke # Name of the configuration | ||
INTERFACE=0.0.0.0 # Leave as '0.0.0.0' for prod, suggest '127.0.0.1' for development | ||
CHT_DEV_HTTP=true # 'true' for http 'false' for https | ||
CHT_DEV_URL_PORT=localhost:5984 # where your dev CHT instance is, hostname:port | ||
|
||
# uncomment for local development ( `npm run dev`) | ||
#REDIS_HOST=localhost # Redis server hostname | ||
#REDIS_PORT=6379 # Redis server port | ||
|
||
# normally leave these commented out unless you know what you're doing: | ||
#PORT=3500 # for development environment container | ||
#EXTERNAL_PORT=3500 # for docker | ||
#CHT_USER_MANAGEMENT_IMAGE=cht-user-management:local # docker image for cht-user-management service - uncomment to use with local development | ||
#CHT_USER_MANAGEMENT_WORKER_IMAGE=cht-user-management-worker:local # docker image for worker service - uncomment to use with local development |
Oops, something went wrong.