diff --git a/Dockerfile b/Dockerfile index 6183c5c742388122c38995a3389804d642303509..bec301af411448fba522ac3394990a6534282ca7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -76,7 +76,7 @@ ENV INSTANCE_ID="view-server_core" \ GDAL_PAM_ENABLED="NO" \ OWS_WCS_MAXSIZE="4096" \ EOXS_LAYER_SUFFIX_SEPARATOR="__" \ - DEV="false" \ + DEVELOPMENT="false" \ ENABLE_HTTP_ACCESS="false" COPY . . diff --git a/configure.sh b/configure.sh index 4ec51716d5d037cba3034ea14ff8982be6ea3006..f4c30e8ac7c7c968d9aed57962241a3bc30df4bf 100755 --- a/configure.sh +++ b/configure.sh @@ -60,12 +60,11 @@ echo "ALLOWED_HOSTS = ['*']" >> pvs_instance/settings.py echo "USE_X_FORWARDED_HOST = True" >> pvs_instance/settings.py echo "SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')" >> pvs_instance/settings.py - if $DEV ; then + if $DEVELOPMENT ; then # activate django cors plugin for dev environment to remove need for browser cors plugin sed -i "s/ 'django.contrib.auth',/ 'corsheaders', 'django.contrib.auth',/g" pvs_instance/settings.py sed -i "s/ 'django.contrib.sessions.middleware.SessionMiddleware',/ 'corsheaders.middleware.CorsMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware',/g" pvs_instance/settings.py echo 'CORS_ORIGIN_ALLOW_ALL = True' >> pvs_instance/settings.py - sed -e 's/DEBUG = False/DEBUG = True/' -i pvs_instance/settings.py fi @@ -86,11 +85,13 @@ if [[ "$EOXS_OPENSEARCH_GETCOVERAGE_HTML_EXCEPTION" = true ]] ; then echo "EOXS_OPENSEARCH_GETCOVERAGE_HTML_EXCEPTION = True" >> pvs_instance/settings.py fi - if [[ "$DEBUG" = true ]] ; then - echo "DEBUG ON Setting functions" - echo "MIDDLEWARE.append('pyinstrument.middleware.ProfilerMiddleware')" >> pvs_instance/settings.py sed -e 's/DEBUG = False/DEBUG = True/' -i pvs_instance/settings.py + fi + + if [[ "$DEVELOPMENT" = true ]] ; then + echo "DEVELOPMENT ON Setting functions" + echo "MIDDLEWARE.append('pyinstrument.middleware.ProfilerMiddleware')" >> pvs_instance/settings.py var="import os import sys diff --git a/entrypoint.sh b/entrypoint.sh index a259be0a511114003279b5683651d0f6d866d316..9b366c3f45fca2774d5c49cad5f1134db38379e6 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -4,7 +4,6 @@ shopt -s nullglob SERVICES=${WAIT_SERVICES:=''} TIMEOUT=${WAIT_TIMEOUT:='15'} -DEBUG=${DEVELOPMENT:="false"} if [[ ! -z $SERVICES ]] ; then for service in $SERVICES ; do diff --git a/registrar/cli.py b/registrar/cli.py index cbe38f799005776cee898568271b161eceb979a2..645ec9a8c24d3d2c469ef63b1a55db1145ee537d 100644 --- a/registrar/cli.py +++ b/registrar/cli.py @@ -65,7 +65,7 @@ def setup_logging(debug=False): @click.option("--validate", is_flag=True) @click.option("--host", type=str) @click.option("--port", type=int) -@click.option("--debug", is_flag=True) +@click.option("--debug/--no-debug", is_flag=True) @click.pass_context def cli( ctx, config_file=None, validate=False, host=None, port=None, debug=False @@ -121,7 +121,7 @@ def daemon(ctx, replace=False): @cli.command(help="Run a single, one-off registration") @click.argument("route_name", type=str) @click.argument("item", type=str) -@click.option("--replace", is_flag=True) +@click.option("--replace/--no-replace", is_flag=True) @click.pass_context def register(ctx, route_name, item, replace): """ Registers a single item.