Skip to content

Commit c56c7d3

Browse files
committed
Rename "tls" config-flag to "needs_tls"
1 parent d3075b8 commit c56c7d3

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

python/nav/django/settings.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,13 +259,13 @@
259259
# * https://docs.djangoproject.com/en/3.2/ref/clickjacking/
260260
# Example conf:
261261
# [security]
262-
# ssl = on
262+
# needs_ssl = yes
263263

264264
SECURE_BROWSER_XSS_FILTER = True # Does no harm
265265

266266
_websecurity_config = WebSecurityConfigParser()
267-
_tls_enabled = bool(_websecurity_config.getboolean('security', 'tls'))
268-
SESSION_COOKIE_SECURE = _tls_enabled
267+
_needs_tls = bool(_websecurity_config.getboolean('security', 'needs_tls'))
268+
SESSION_COOKIE_SECURE = _needs_tls
269269

270270
# Hack for hackers to use features like debug_toolbar etc.
271271
# https://code.djangoproject.com/wiki/SplitSettings (Rob Golding's method)

python/nav/etc/webfront/webfront.conf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,7 @@ enabled = no
132132
#post-logout-redirect-url=/magic/logout?nexthop=/
133133

134134
[security]
135-
# tls = off
135+
# Whether NAV must be run under TLS or not. Toggling this to `yes` toggles web
136+
# security features that are only available with TLS/SSL enabled. In
137+
# development mode this defaults to `no`.
138+
# needs_tls = no

python/nav/web/security.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ class WebSecurityConfigParser(NAVConfigParser):
77
DEFAULT_CONFIG_FILES = [str(Path('webfront') / 'webfront.conf')]
88
DEFAULT_CONFIG = u"""
99
[security]
10-
tls=off
10+
needs_tls=no
1111
"""

0 commit comments

Comments
 (0)