Skip to content
Permalink
Browse files

Fix on/off values which should be True/False as expected by django

  • Loading branch information
Pascal Trovatelli
Pascal Trovatelli committed Oct 27, 2019
1 parent 0744c56 commit 47f3fc1c2d25c4eccf41c17dec04043f3c930894
@@ -105,6 +105,6 @@ ENV \
DD_INITIALIZE=true \
DD_UWSGI_MODE="socket" \
DD_UWSGI_ENDPOINT="0.0.0.0:3031" \
DD_DJANGO_ADMIN_ENABLED="on" \
DD_TRACK_MIGRATIONS="on"
DD_DJANGO_ADMIN_ENABLED="True" \
DD_TRACK_MIGRATIONS="True"
ENTRYPOINT ["/entrypoint-uwsgi.sh"]
@@ -6,7 +6,7 @@ services:
volumes:
- '.:/app:z'
environment:
DD_DEBUG: 'on'
DD_DEBUG: 'True'
celeryworker:
volumes:
- '.:/app:z'
@@ -6,7 +6,7 @@ services:
volumes:
- '.:/app:z'
environment:
DD_DEBUG: 'on'
DD_DEBUG: 'True'
ports:
- target: 3000
published: 3000
@@ -11,7 +11,7 @@ services:
volumes:
- '.:/app:z'
environment:
DD_DEBUG: 'on'
DD_DEBUG: 'True'
DD_TEST_DATABASE_NAME: ${DD_TEST_DATABASE_NAME:-test_defectdojo}
DD_DATABASE_NAME: ${DD_TEST_DATABASE_NAME:-test_defectdojo}
celerybeat:
@@ -22,7 +22,7 @@ services:
- mysql
entrypoint: ['/wait-for-it.sh', 'mysql:3306', '-t', '30', '--', '/entrypoint-uwsgi.sh']
environment:
DD_DEBUG: 'off'
DD_DEBUG: 'False'
DD_ALLOWED_HOSTS: ${DD_ALLOWED_HOSTS:-*}
DD_DATABASE_URL: ${DD_DATABASE_URL:-mysql://defectdojo:defectdojo@mysql:3306/defectdojo}
DD_CELERY_BROKER_USER: ${DD_CELERY_BROKER_USER:-guest}
@@ -1,8 +1,8 @@
# Django Debug, don't enable on production!
DD_DEBUG=off
DD_DEBUG=False

# Enables Django Admin
DD_DJANGO_ADMIN_ENABLED=on
DD_DJANGO_ADMIN_ENABLED=True

# A secret key for a particular Django installation.
DD_SECRET_KEY=#DD_SECRET_KEY#
@@ -19,7 +19,7 @@ DD_ALLOWED_HOSTS=#DD_ALLOWED_HOSTS#
# WhiteNoise allows your web app to serve its own static files,
# making it a self-contained unit that can be deployed anywhere without relying on nginx,
# if using nginx then disable Whitenoise
DD_WHITENOISE=on
DD_WHITENOISE=True

# -------------------------------------------------------
# Additional Settings / Override defaults in settings.py
@@ -46,7 +46,7 @@ def _check_ptvsd_port_not_in_use(port):


ptvsd_port = 3000
if os.environ.get("DD_DEBUG") == "on" and _check_ptvsd_port_not_in_use(ptvsd_port):
if os.environ.get("DD_DEBUG") == "True" and _check_ptvsd_port_not_in_use(ptvsd_port):
try:
# enable remote debugging
import ptvsd
@@ -72,24 +72,24 @@ DEV_ADMIN_PASS="admin"
ADMIN_EMAIL=${ADMIN_EMAIL:-"ed@example.com"}

# Django settings.py vars
DD_DEBUG=${DD_DEBUG:="off"} # Django Debug, defaults to off and should be for production. Can be off or on
DD_DJANGO_ADMIN_ENABLED=${DD_DJANGO_ADMIN_ENABLED:-"on"} # Enables Django Admin, defaults to on - either off or on
DD_DEBUG=${DD_DEBUG:="False"} # Django Debug, defaults to False and should be for production. Can be True or False
DD_DJANGO_ADMIN_ENABLED=${DD_DJANGO_ADMIN_ENABLED:-"True"} # Enables Django Admin, defaults to True - either False or True
DD_SECRET_KEY="GENERATED-DYNAMICALLY-AT-INSTALL-TIME" # A secret key for a particular Django installation.
DD_CREDENTIAL_AES_256_KEY="GENERATED-DYNAMICALLY-AT-INSTALL-TIME" # Key for encrypting credentials in the manager
DD_DATABASE_URL=${DD_DATABASE_URL:-"mysql://dojodbusr:vee0Thoanae1daePooz0ieka@localhost:3306/dojodb"} # Database URL, options: postgres://, mysql://, sqlite://, to use unsafe characters encode with urllib.parse.encode
DD_ALLOWED_HOSTS=${DD_ALLOWED_HOSTS:-"*"} # Hosts/domain names that are valid for this site - Separate accepted hosts with a comma for 2+ hostnames
# WhiteNoise allows your web app to serve its own static files,
# making it a self-contained unit that can be deployed anywhere without relying on nginx,
# if using nginx then disable Whitenoise
DD_WHITENOISE=${DD_WHITENOISE:-"on"} # Valid options: on, off
DD_WHITENOISE=${DD_WHITENOISE:-"True"} # Valid options: True, False
# Additional Settings / Override defaults in settings.py
DD_TIME_ZONE=${DD_TIME_ZONE:-"America/New_York"} # Timezone - default America/New_York
DD_TRACK_MIGRATIONS=${DD_TRACK_MIGRATIONS:-"on"} # Track migrations through source control rather than making migrations locally
DD_SESSION_COOKIE_HTTPONLY=${DD_SESSION_COOKIE_HTTPONLY:-"on"} # Whether to use HTTPOnly flag on the session cookie - either on or off
DD_CSRF_COOKIE_HTTPONLY=${DD_CSRF_COOKIE_HTTPONLY:-"on"} # Whether to use HttpOnly flag on the CSRF cookie - either on or off
DD_SECURE_SSL_REDIRECT=${DD_SECURE_SSL_REDIRECT:-"off"} # If True, the SecurityMiddleware redirects all non-HTTPS requests to HTTPS - either on or off
DD_CSRF_COOKIE_SECURE=${DD_CSRF_COOKIE_SECURE:-"off"} # Whether to use a secure cookie for the CSRF cookie - either on or off
DD_SECURE_BROWSER_XSS_FILTER=${DD_SECURE_BROWSER_XSS_FILTER:-"True"} # If True, the SecurityMiddleware sets the X-XSS-Protection: 1; - either on or off
DD_TRACK_MIGRATIONS=${DD_TRACK_MIGRATIONS:-"True"} # Track migrations through source control rather than making migrations locally
DD_SESSION_COOKIE_HTTPONLY=${DD_SESSION_COOKIE_HTTPONLY:-"True"} # Whether to use HTTPOnly flag on the session cookie - either True or False
DD_CSRF_COOKIE_HTTPONLY=${DD_CSRF_COOKIE_HTTPONLY:-"True"} # Whether to use HttpOnly flag on the CSRF cookie - either True or False
DD_SECURE_SSL_REDIRECT=${DD_SECURE_SSL_REDIRECT:-"False"} # If True, the SecurityMiddleware redirects all non-HTTPS requests to HTTPS - either True or False
DD_CSRF_COOKIE_SECURE=${DD_CSRF_COOKIE_SECURE:-"False"} # Whether to use a secure cookie for the CSRF cookie - either True or False
DD_SECURE_BROWSER_XSS_FILTER=${DD_SECURE_BROWSER_XSS_FILTER:-"True"} # If True, the SecurityMiddleware sets the X-XSS-Protection: 1; - either True or False
DD_SECURE_CONTENT_TYPE_NOSNIFF=${DD_SECURE_CONTENT_TYPE_NOSNIFF:-"True"} # If True, the SecurityMiddleware sets the X-Content-Type-Options: nosniff;
DD_LANG=${DD_LANG:-"en-us"} # Change the default language set
DD_WKHTMLTOPDF=${DD_WKHTMLTOPDF:-"/usr/local/bin/wkhtmltopdf"} # Path to PDF library
@@ -458,7 +458,7 @@ function prepare_settings_file() {
echo 'DD_ALLOWED_HOSTS="localhost"' >> ${ENV_SETTINGS_FILE}
fi

echo 'DD_DEBUG="on"' >> ${ENV_SETTINGS_FILE}
echo 'DD_DEBUG="True"' >> ${ENV_SETTINGS_FILE}
echo 'DD_SECRET_KEY="'${SECRET}'"' >> ${ENV_SETTINGS_FILE}
echo 'DD_CREDENTIAL_AES_256_KEY="'${AES_PASSPHRASE}'"' >> ${ENV_SETTINGS_FILE}
}
@@ -14,7 +14,7 @@ export DJANGO_SETTINGS_MODULE=dojo.settings.unittest
export DD_SECRET_KEY=`cat /dev/urandom | LC_CTYPE=C tr -dc "a-zA-Z0-9" | head -c 128`
export DD_CREDENTIAL_AES_256_KEY=`cat /dev/urandom | LC_CTYPE=C tr -dc "a-zA-Z0-9" | head -c 128`
export DD_DATABASE_URL="sqlite:///test.db"
export DD_DEBUG=on
export DD_DEBUG=True

python manage.py makemigrations dojo
python manage.py migrate
@@ -73,7 +73,7 @@ DEV_ADMIN_PASS="admin"
ADMIN_EMAIL=${ADMIN_EMAIL:-"ed@example.com"}

# Django settings.py vars
DD_DEBUG=${DD_DEBUG:="off"} # Django Debug, defaults to off and should be for production. Can be off or on
DD_DEBUG=${DD_DEBUG:="False"} # Django Debug, defaults to False and should be for production. Can be False or True
DD_DJANGO_ADMIN_ENABLED=${DD_DJANGO_ADMIN_ENABLED:-"on"} # Enables Django Admin, defaults to on - either off or on
DD_SECRET_KEY="GENERATED-DYNAMICALLY-AT-INSTALL-TIME" # A secret key for a particular Django installation.
DD_CREDENTIAL_AES_256_KEY="GENERATED-DYNAMICALLY-AT-INSTALL-TIME" # Key for encrypting credentials in the manager
@@ -82,15 +82,15 @@ DD_ALLOWED_HOSTS=${DD_ALLOWED_HOSTS:-"*"} # Hosts/domain names th
# WhiteNoise allows your web app to serve its own static files,
# making it a self-contained unit that can be deployed anywhere without relying on nginx,
# if using nginx then disable Whitenoise
DD_WHITENOISE=${DD_WHITENOISE:-"on"} # Valid options: on, off
DD_WHITENOISE=${DD_WHITENOISE:-"True"} # Valid options: True, False
# Additional Settings / Override defaults in settings.py
DD_TIME_ZONE=${DD_TIME_ZONE:-"America/New_York"} # Timezone - default America/New_York
DD_TRACK_MIGRATIONS=${DD_TRACK_MIGRATIONS:-"on"} # Track migrations through source control rather than making migrations locally
DD_SESSION_COOKIE_HTTPONLY=${DD_SESSION_COOKIE_HTTPONLY:-"on"} # Whether to use HTTPOnly flag on the session cookie - either on or off
DD_CSRF_COOKIE_HTTPONLY=${DD_CSRF_COOKIE_HTTPONLY:-"on"} # Whether to use HttpOnly flag on the CSRF cookie - either on or off
DD_SECURE_SSL_REDIRECT=${DD_SECURE_SSL_REDIRECT:-"off"} # If True, the SecurityMiddleware redirects all non-HTTPS requests to HTTPS - either on or off
DD_CSRF_COOKIE_SECURE=${DD_CSRF_COOKIE_SECURE:-"off"} # Whether to use a secure cookie for the CSRF cookie - either on or off
DD_SECURE_BROWSER_XSS_FILTER=${DD_SECURE_BROWSER_XSS_FILTER:-"True"} # If True, the SecurityMiddleware sets the X-XSS-Protection: 1; - either on or off
DD_TRACK_MIGRATIONS=${DD_TRACK_MIGRATIONS:-"True"} # Track migrations through source control rather than making migrations locally
DD_SESSION_COOKIE_HTTPONLY=${DD_SESSION_COOKIE_HTTPONLY:-"True"} # Whether to use HTTPOnly flag on the session cookie - either True or False
DD_CSRF_COOKIE_HTTPONLY=${DD_CSRF_COOKIE_HTTPONLY:-"True"} # Whether to use HttpOnly flag on the CSRF cookie - either True or False
DD_SECURE_SSL_REDIRECT=${DD_SECURE_SSL_REDIRECT:-"False"} # If True, the SecurityMiddleware redirects all non-HTTPS requests to HTTPS - either True or False
DD_CSRF_COOKIE_SECURE=${DD_CSRF_COOKIE_SECURE:-"False"} # Whether to use a secure cookie for the CSRF cookie - either True or False
DD_SECURE_BROWSER_XSS_FILTER=${DD_SECURE_BROWSER_XSS_FILTER:-"True"} # If True, the SecurityMiddleware sets the X-XSS-Protection: 1; - either True or False
DD_SECURE_CONTENT_TYPE_NOSNIFF=${DD_SECURE_CONTENT_TYPE_NOSNIFF:-"True"} # If True, the SecurityMiddleware sets the X-Content-Type-Options: nosniff;
DD_LANG=${DD_LANG:-"en-us"} # Change the default language set
DD_WKHTMLTOPDF=${DD_WKHTMLTOPDF:-"/usr/local/bin/wkhtmltopdf"} # Path to PDF library
@@ -620,5 +620,5 @@ function slim_defect_dojo_settings() {
# Copy settings file
ENV_SETTINGS_FILE=dojo/settings/.env.prod
cp dojo/settings/template-env ${ENV_SETTINGS_FILE}
sed -i'' "s&# DD_TRACK_MIGRATIONS=on&#DD_TRACK_MIGRATIONS=on&g" ${ENV_SETTINGS_FILE}
sed -i'' "s&# DD_TRACK_MIGRATIONS=True&#DD_TRACK_MIGRATIONS=True&g" ${ENV_SETTINGS_FILE}
}
@@ -16,7 +16,7 @@ export DJANGO_SETTINGS_MODULE=dojo.settings.unittest
export DD_SECRET_KEY=`cat /dev/urandom | LC_CTYPE=C tr -dc "a-zA-Z0-9" | head -c 128`
export DD_CREDENTIAL_AES_256_KEY=`cat /dev/urandom | LC_CTYPE=C tr -dc "a-zA-Z0-9" | head -c 128`
export DD_DATABASE_URL="sql"
export DD_DEBUG=on
export DD_DEBUG=True

python manage.py makemigrations dojo
python manage.py migrate

0 comments on commit 47f3fc1

Please sign in to comment.
You can’t perform that action at this time.