From b9076d1e0eef3ab64115dc629cba059bbeb6c3ce Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Thu, 16 Nov 2017 19:27:55 -0500 Subject: [PATCH] Env vars tweaks --- .env | 2 +- start.sh | 9 ++++----- webodm.sh | 9 ++++----- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.env b/.env index 267b2443..3c532618 100644 --- a/.env +++ b/.env @@ -1,3 +1,3 @@ -HOST=webodm.localhost +HOST=localhost PORT=8000 APP_MEDIA_DIR=appmedia diff --git a/start.sh b/start.sh index b467ce59..6498bf77 100755 --- a/start.sh +++ b/start.sh @@ -58,6 +58,9 @@ if [[ "$1" = "--create-default-pnode" ]]; then echo "from nodeodm.models import ProcessingNode; ProcessingNode.objects.update_or_create(hostname='node-odm-1', defaults={'hostname': 'node-odm-1', 'port': 3000})" | python manage.py shell fi +export HOST="${HOST:=localhost}" +export PORT="${PORT:=8000}" + (sleep 5; echo echo -e "\033[92m" echo "Congratulations! └@(・◡・)@┐" @@ -65,7 +68,7 @@ echo ========================== echo -e "\033[39m" echo "If there are no errors, WebODM should be up and running!" echo -e "\033[93m" -echo Open a web browser and navigate to http://localhost:8000 +echo Open a web browser and navigate to http://$HOST:$PORT echo -e "\033[39m" echo -e "\033[91mNOTE:\033[39m Windows users using docker should replace localhost with the IP of their docker machine's IP. To find what that is, run: docker-machine ip") & @@ -76,10 +79,6 @@ else echo -e "\033[91mWARN:\033[39m /webodm/build/static does not exist, CSS, JS and other files might not be available." fi - # If this is invoked outside docker, we need to make sure - # envsubst returns a valid config file... - export HOST="${HOST:=webodm.localhost}" - echo "Generating nginx configurations from templates..." for templ in nginx/*.template do diff --git a/webodm.sh b/webodm.sh index e3a20ae0..8f48a44d 100755 --- a/webodm.sh +++ b/webodm.sh @@ -18,7 +18,7 @@ fi # Set default ENV variables export PORT="${WEBODM_PORT:=8000}" -export HOST="${WEBODM_HOST:=webodm.localhost}" +export HOST="${WEBODM_HOST:=localhost}" export MEDIA_DIR="${WEBODM_MEDIA_DIR:=appmedia}" usage(){ @@ -127,10 +127,9 @@ if [[ $1 = "start" ]]; then environment_check echo "Starting WebODM..." - - echo -e "Host: \033[92m\033[1m$PORT\033[0m\033[39m" - echo -e "Port: \033[92m\033[1m$HOST\033[0m\033[39m" - echo -e "Media dir: \033[92m\033[1m$HOST\033[0m\033[39m" + echo "Host: $PORT" + echo "Port: $HOST" + echo "Media dir: $MEDIA_DIR" start elif [[ $1 = "stop" ]]; then