Skip to content

Commit e06f8d6

Browse files
committed
chore(passport): use strtobool
1 parent c9ad184 commit e06f8d6

2 files changed

Lines changed: 11 additions & 8 deletions

File tree

charts/passport/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ admin_username: "admin"
4646
admin_password: "admin"
4747
admin_email: "admin@email.com"
4848

49+
redis:
50+
replicas: 1
51+
4952
global:
5053
# Set the location of Workflow's grafana instance
5154
#

rootfs/api/settings/production.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,22 @@
99
import os.path
1010
import ldap
1111
import dj_database_url
12-
12+
from distutils.util import strtobool
1313
from django_auth_ldap.config import LDAPSearch, GroupOfNamesType
1414

1515
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
1616
# SECURITY WARNING: don't run with debug turned on in production!
17-
DEBUG = os.environ.get('DRYCC_DEBUG', 'false').lower() != 'false'
17+
DEBUG = bool(strtobool(os.environ.get('DRYCC_DEBUG', 'false')))
1818

1919
# If set to True, Django's normal exception handling of view functions
2020
# will be suppressed, and exceptions will propagate upwards
2121
# https://docs.djangoproject.com/en/2.2/ref/settings/#debug-propagate-exceptions
2222
DEBUG_PROPAGATE_EXCEPTIONS = True
2323
# Enable Django admin
24-
ADMIN_ENABLED = os.environ.get('ADMIN_ENABLED', 'false') != 'false'
24+
ADMIN_ENABLED = bool(strtobool(os.environ.get('ADMIN_ENABLED', 'false')))
2525
# Enable Registration
2626
# If this function is enabled, please set Django email related parameters
27-
REGISTRATION_ENABLED = os.environ.get('REGISTRATION_ENABLED', 'false') != 'false'
27+
REGISTRATION_ENABLED = bool(strtobool(os.environ.get('REGISTRATION_ENABLED', 'false')))
2828
# Silence two security messages around SSL as router takes care of them
2929
# https://docs.djangoproject.com/en/2.2/ref/checks/#security
3030
SILENCED_SYSTEM_CHECKS = [
@@ -159,8 +159,8 @@
159159
CSRF_COOKIE_SAMESITE = None
160160
SECURE_CONTENT_TYPE_NOSNIFF = True
161161
SECURE_BROWSER_XSS_FILTER = True
162-
CSRF_COOKIE_SECURE = os.environ.get('CSRF_COOKIE_SECURE', 'true').lower() != 'false'
163-
SESSION_COOKIE_SECURE = os.environ.get('SESSION_COOKIE_SECURE', 'false').lower() != 'false'
162+
CSRF_COOKIE_SECURE = bool(strtobool(os.environ.get('CSRF_COOKIE_SECURE', 'true')))
163+
SESSION_COOKIE_SECURE = bool(strtobool(os.environ.get('SESSION_COOKIE_SECURE', 'false')))
164164

165165
# Honor HTTPS from a trusted proxy
166166
# see https://docs.djangoproject.com/en/2.2/ref/settings/#secure-proxy-ssl-header
@@ -383,5 +383,5 @@
383383
DEFAULT_FROM_EMAIL = os.environ.get('DEFAULT_FROM_EMAIL', '')
384384
EMAIL_HOST_USER = os.environ.get('EMAIL_HOST_USER', '')
385385
EMAIL_HOST_PASSWORD = os.environ.get('EMAIL_HOST_PASSWORD', '')
386-
EMAIL_USE_TLS = os.environ.get('EMAIL_USE_TLS', 'false').lower() != 'false'
387-
EMAIL_USE_SSL = os.environ.get('EMAIL_USE_SSL', 'false').lower() != 'false'
386+
EMAIL_USE_TLS = bool(strtobool(os.environ.get('EMAIL_USE_TLS', 'false')))
387+
EMAIL_USE_SSL = bool(strtobool(os.environ.get('EMAIL_USE_SSL', 'false')))

0 commit comments

Comments
 (0)