Skip to content

Commit

Permalink
OZ-572: Update O3 component URL(s) to use right scheme when Ozone is …
Browse files Browse the repository at this point in the history
…running locally (#113)
  • Loading branch information
corneliouzbett authored Oct 14, 2024
1 parent f712761 commit 613cdda
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 7 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#
# Host
#
SERVER_SCHEME=https
HOST_URL=http://172.17.0.1
TIMEZONE=UTC

Expand Down
2 changes: 1 addition & 1 deletion docker-compose-odoo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ services:

env-substitution:
environment:
- ODOO_PUBLIC_URL=https://${ODOO_HOSTNAME}
- ODOO_PUBLIC_URL=${SERVER_SCHEME}://${ODOO_HOSTNAME}

volumes:
eip-home-odoo: ~
Expand Down
2 changes: 1 addition & 1 deletion docker-compose-openmrs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ services:

env-substitution:
environment:
- OPENMRS_PUBLIC_URL=https://${O3_HOSTNAME}
- OPENMRS_PUBLIC_URL=${SERVER_SCHEME}://${O3_HOSTNAME}

volumes:
openmrs-core: ~
Expand Down
2 changes: 1 addition & 1 deletion docker-compose-senaite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ services:

env-substitution:
environment:
- SENAITE_PUBLIC_URL=https://${SENAITE_HOSTNAME}
- SENAITE_PUBLIC_URL=${SERVER_SCHEME}://${SENAITE_HOSTNAME}

volumes:
eip-home-senaite: ~
Expand Down
8 changes: 4 additions & 4 deletions scripts/ozone-urls-template.csv
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
HIS Component,URL,Username,Password,Service
-,-,-,-
OpenMRS 3,${O3_HOSTNAME}/openmrs/spa,admin,Admin123,openmrs
SENAITE,${SENAITE_HOSTNAME},admin,password,senaite
Odoo,${ODOO_HOSTNAME},admin,admin,odoo
ERPNext,${ERPNEXT_HOSTNAME},administrator,password,erpnext
OpenMRS 3,${SERVER_SCHEME}://${O3_HOSTNAME}/openmrs/spa,admin,Admin123,openmrs
SENAITE,${SERVER_SCHEME}://${SENAITE_HOSTNAME},admin,password,senaite
Odoo,${SERVER_SCHEME}://${ODOO_HOSTNAME},admin,admin,odoo
ERPNext,${SERVER_SCHEME}://${ERPNEXT_HOSTNAME},administrator,password,erpnext
4 changes: 4 additions & 0 deletions scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,14 @@ MINIMUM_REQUIRED_DOCKER_VERSION_REGEX="^((([2-9][1-9]|[3-9][0]|[0-9]{3,}).*)|(20
if [[ $INSTALLED_DOCKER_VERSION =~ $MINIMUM_REQUIRED_DOCKER_VERSION_REGEX ]]; then
if command -v gp version &> /dev/null; then
export GITPOD_ENV="true"
export USE_HTTPS="true"
else
export GITPOD_ENV="false"
fi

# Export the scheme
exportScheme

# Pull Ozone Docker images
echo "$INFO Pulling ${OZONE_LABEL:-Ozone FOSS} images..."
docker compose -p $PROJECT_NAME $dockerComposeOzoneCLIOptions pull
Expand Down
10 changes: 10 additions & 0 deletions scripts/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ function setTraefikIP {
function setTraefikHostnames {
echo "$INFO Exporting Traefik hostnames..."

export USE_HTTPS="true"
export O3_HOSTNAME=emr-"${IP_WITH_DASHES}.traefik.me"
export ODOO_HOSTNAME=erp-"${IP_WITH_DASHES}.traefik.me"
export SENAITE_HOSTNAME=lims-"${IP_WITH_DASHES}.traefik.me"
Expand All @@ -129,6 +130,15 @@ function setNginxHostnames {

}

function exportScheme() {
if [ "$USE_HTTPS" == "true" ]; then
export SERVER_SCHEME="https"
else
export SERVER_SCHEME="http"
fi
echo "$INFO Scheme set to: $SERVER_SCHEME"
}

function isOzoneRunning {
local projectName=$1
runningContainers=$(docker ps --filter "name=${projectName}" --format "{{.Names}}")
Expand Down

0 comments on commit 613cdda

Please sign in to comment.