Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
LOFAR
Commits
2bbd05d8
Commit
2bbd05d8
authored
5 years ago
by
Jorrit Schaap
Browse files
Options
Downloads
Patches
Plain Diff
TMSS-139
: minor tweaks
parent
0e6a32c7
No related branches found
No related tags found
1 merge request
!96
Resolve TMSS-139
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
SAS/TMSS/src/tmss/settings.py
+9
-5
9 additions, 5 deletions
SAS/TMSS/src/tmss/settings.py
with
9 additions
and
5 deletions
SAS/TMSS/src/tmss/settings.py
+
9
−
5
View file @
2bbd05d8
...
@@ -13,13 +13,17 @@ https://docs.djangoproject.com/en/2.0/ref/settings/
...
@@ -13,13 +13,17 @@ https://docs.djangoproject.com/en/2.0/ref/settings/
import
os
import
os
import
ldap
import
ldap
import
logging
import
logging
from
lofar.common
import
dbcredentials
from
lofar.common
import
dbcredentials
,
isDevelopmentEnvironment
# logger
# logger
logger
=
logging
.
getLogger
(
'
django_auth_ldap
'
)
logger
=
logging
.
getLogger
(
__name__
)
logger
.
addHandler
(
logging
.
StreamHandler
())
logger
.
setLevel
(
logging
.
INFO
)
# fix/setup django_auth_ldap logging
logging
.
getLogger
(
'
django_auth_ldap
'
).
addHandler
(
logging
.
StreamHandler
())
logging
.
getLogger
(
'
django_auth_ldap
'
).
setLevel
(
logging
.
INFO
)
# from pprint import pprint
# pprint(dict(os.environ))
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)))
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)))
...
@@ -159,7 +163,7 @@ AUTH_LDAP_CONNECTION_OPTIONS = { ldap.OPT_X_TLS_REQUIRE_CERT : ldap.OPT_X_TLS_NE
...
@@ -159,7 +163,7 @@ AUTH_LDAP_CONNECTION_OPTIONS = { ldap.OPT_X_TLS_REQUIRE_CERT : ldap.OPT_X_TLS_NE
# AUTH_LDAP_BIND_DN = '' # our LDAP is open
# AUTH_LDAP_BIND_DN = '' # our LDAP is open
# AUTH_LDAP_BIND_PASSWORD = '' # our LDAP is open
# AUTH_LDAP_BIND_PASSWORD = '' # our LDAP is open
protocol
=
'
ldaps://
'
protocol
=
'
ldaps://
'
if
'
test
'
in
ldap_creds_name
:
if
isDevelopmentEnvironment
()
:
logging
.
warning
(
'
Test ldap credentials detected, using insecure connection for ldap autenthication
'
)
# mock LDAP does not support ldaps://
logging
.
warning
(
'
Test ldap credentials detected, using insecure connection for ldap autenthication
'
)
# mock LDAP does not support ldaps://
protocol
=
'
ldap://
'
protocol
=
'
ldap://
'
AUTH_LDAP_SERVER_URI
=
"
%s%s:%s
"
%
(
protocol
,
django_ldap_credentials
.
host
,
django_ldap_credentials
.
port
)
AUTH_LDAP_SERVER_URI
=
"
%s%s:%s
"
%
(
protocol
,
django_ldap_credentials
.
host
,
django_ldap_credentials
.
port
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment