Skip to content

Commit

Permalink
Hardcoded webhost
Browse files Browse the repository at this point in the history
Changes to set the webhost to 0.0.0.0 at all times
  • Loading branch information
nataliejschultz committed May 16, 2024
1 parent 8f05955 commit 912bd34
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 23 deletions.
9 changes: 0 additions & 9 deletions .docker/docker_start_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,6 @@ if [ -z ${DB_HOST} ] ; then
fi
cat conf/storage/db.conf

#set Web Server host using environment variable
echo ${WEB_SERVER_HOST}
if [ -z ${WEB_SERVER_HOST} ] ; then
local_host=`hostname -i`
export WEB_SERVER_HOST=$local_host
echo "Setting webserver host environment variable to localhost"
fi
cat conf/net/api/webserver.conf

if [ -z ${LIVERELOAD_SRC} ] ; then
echo "Live reload disabled, "
else
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ RUN bash -c "./.docker/setup_config.sh"

# #declare environment variables
ENV DB_HOST=''
ENV WEB_SERVER_HOST=''
ENV WEB_SERVER_HOST=0.0.0.0

ENV LIVERELOAD_SRC=''
ENV STUDY_CONFIG=''
Expand Down
13 changes: 0 additions & 13 deletions emission/net/api/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,12 @@ def get_config_data_from_env():
}
return config_data_env

def check_unset_env_vars():
config_data_env = {
"static_path": os.getenv('WEB_SERVER_STATIC_PATH'),
"server_host": os.getenv('WEB_SERVER_HOST'),
"server_port": os.getenv('WEB_SERVER_PORT'),
"socket_timeout": os.getenv('WEB_SERVER_TIMEOUT'),
"auth_method": os.getenv('WEB_SERVER_AUTH'),
"aggregate_call_auth": os.getenv('WEB_SERVER_AGGREGATE_CALL_AUTH'),
"not_found_redirect": os.getenv('WEB_SERVER_REDIRECT_URL')
}
return not any(config_data_env.values())

def get_config_data():
try:
config_file = open('conf/net/api/webserver.conf')
ret_val = json.load(config_file)
config_file.close()
except:
# Check if all Webserver environment variables are not set
# if check_unset_env_vars():
logging.debug("webserver not configured, falling back to sample, default configuration")
ret_val = get_config_data_from_env()
Expand Down
2 changes: 2 additions & 0 deletions setup/tests/start_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ if [ -z ${DB_HOST} ] ; then
export DB_HOST=$local_host
echo "Setting db host environment variable to localhost"
fi

export WEB_SERVER_HOST=0.0.0.0
cat conf/storage/db.conf

echo "Setting up conda..."
Expand Down

0 comments on commit 912bd34

Please sign in to comment.