Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
1097b111
Commit
1097b111
authored
May 28, 2019
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 修改ldap支持ssl
parent
20656921
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
settings.py
apps/jumpserver/settings.py
+7
-1
forms.py
apps/settings/forms.py
+3
-3
No files found.
apps/jumpserver/settings.py
View file @
1097b111
...
...
@@ -173,7 +173,7 @@ DATABASES = {
'OPTIONS'
:
DB_OPTIONS
}
}
DB_CA_PATH
=
os
.
path
.
join
(
PROJECT_DIR
,
'data'
,
'ca.pem'
)
DB_CA_PATH
=
os
.
path
.
join
(
PROJECT_DIR
,
'data'
,
'c
erts'
,
'db_c
a.pem'
)
if
CONFIG
.
DB_ENGINE
.
lower
()
==
'mysql'
:
DB_OPTIONS
[
'init_command'
]
=
"SET sql_mode='STRICT_TRANS_TABLES'"
if
os
.
path
.
isfile
(
DB_CA_PATH
):
...
...
@@ -426,6 +426,12 @@ AUTH_LDAP_SEARCH_OU = 'ou=tech,dc=jumpserver,dc=org'
AUTH_LDAP_SEARCH_FILTER
=
'(cn=
%(user)
s)'
AUTH_LDAP_START_TLS
=
False
AUTH_LDAP_USER_ATTR_MAP
=
{
"username"
:
"cn"
,
"name"
:
"sn"
,
"email"
:
"mail"
}
AUTH_LDAP_GLOBAL_OPTIONS
=
{
ldap
.
OPT_X_TLS_REQUIRE_CERT
:
ldap
.
OPT_X_TLS_NEVER
,
}
LDAP_CERT_FILE
=
os
.
path
.
join
(
PROJECT_DIR
,
"data"
,
"certs"
,
"ldap_ca.pem"
)
if
os
.
path
.
isfile
(
LDAP_CERT_FILE
):
AUTH_LDAP_GLOBAL_OPTIONS
[
ldap
.
OPT_X_TLS_CACERTFILE
]
=
LDAP_CERT_FILE
# AUTH_LDAP_GROUP_SEARCH_OU = CONFIG.AUTH_LDAP_GROUP_SEARCH_OU
# AUTH_LDAP_GROUP_SEARCH_FILTER = CONFIG.AUTH_LDAP_GROUP_SEARCH_FILTER
# AUTH_LDAP_GROUP_SEARCH = LDAPSearch(
...
...
apps/settings/forms.py
View file @
1097b111
...
...
@@ -121,9 +121,9 @@ class LDAPSettingForm(BaseForm):
)
# AUTH_LDAP_GROUP_SEARCH_OU = CONFIG.AUTH_LDAP_GROUP_SEARCH_OU
# AUTH_LDAP_GROUP_SEARCH_FILTER = CONFIG.AUTH_LDAP_GROUP_SEARCH_FILTER
AUTH_LDAP_START_TLS
=
forms
.
BooleanField
(
label
=
_
(
"Use SSL"
),
required
=
False
)
#
AUTH_LDAP_START_TLS = forms.BooleanField(
#
label=_("Use SSL"), required=False
#
)
AUTH_LDAP
=
forms
.
BooleanField
(
label
=
_
(
"Enable LDAP auth"
),
required
=
False
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment