Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
l y
Jumpserver
Commits
91601cce
Commit
91601cce
authored
7 years ago
by
ibuler
Browse files
Options
Download
Email Patches
Plain Diff
[Feature] Support multiple ou search
parent
a4fa15a7
dev
ccrc
dependabot/pip/requirements/ansible-4.2.0
feat_acl_muiltistrategy
feat_pam
feat_proxyterminal
feat_rbac
fix@dev@filter_meta
jms_dev
lagacy-0.4.0
master
pam
pr@dev@chore_pylint
pr@dev@escape_route
pr@dev@feat_csp
pr@dev@feat_custom_platform_auth_change
pr@dev@feat_custom_watermark
pr@dev@feat_ftp_log_file
pr@dev@feat_rdp_chinese_username
pr@dev@feat_support_sqlserver_change_password
pr@dev@feat_ticket_serial
pr@dev@feat_user_view
pr@dev@fix_actions
pr@dev@fix_dingding
pr@dev@fix_sms
pr@dev@fix_tcp_syslog
pr@dev@k8s
pr@dev@perf_base_model
pr@dev@refactor_notification_event
pr@dev@share_session_link
pr@dev@sms_setting
pr@dev@ticket
pr@dev@ticket_flow_assignes
pr@dev@vault_secret
prr@dev@fix_ldapimport
rbac
refactor_asset_user_v2
remote_app
repr@dev_v2.14_v2.15@2d6610b133512a3@fix_db_connection_not_close
repr@v2.14_dev@da2dea50032@ticket
v1.5
v2.0
v2.1
v2.10
v2.11
v2.12
v2.13
v2.14
v2.15
v2.16
v2.17
v2.18
v2.19
v2.2
v2.20
v2.21
v2.22
v2.3
v2.4
v2.5
v2.6
v2.7
v2.8
v2.9
2.0.1
2.0.0
1.5.9
1.5.8
1.5.7
1.5.6
1.5.5
1.5.4
1.5.3
1.5.2
1.5.1
1.5.0
1.4.10
1.4.9
1.4.8
1.4.7
1.4.6
1.4.5
1.4.4
1.4.3
1.4.2
1.4.1
1.4.0
1.3.3
1.3.2
1.3.1
1.3.0
1.2.1
1.2.0
1.1.1
1.1.0
1.0.0
v2.22.0
v2.21.4
v2.21.3
v2.21.2
v2.21.1
v2.21.0
v2.20.3
v2.20.2
v2.20.1
v2.20.0
v2.19.2
v2.19.1
v2.19.0
v2.18.3
v2.18.2
v2.18.1
v2.18.0
v2.17.5
v2.17.4
v2.17.3
v2.17.2
v2.17.1
v2.17.0
v2.16.3
v2.16.2
v2.16.1
v2.16.0
v2.15.5
v2.15.4
v2.15.3
v2.15.2
v2.15.1
v2.15.0
v2.14.2
v2.14.1
v2.14.0
v2.13.2
v2.13.1
v2.13.0
v2.12.2
v2.12.1
v2.12.0
v2.11.4
v2.11.3
v2.11.2
v2.11.1
v2.11.0
v2.10.5
v2.10.4
v2.10.3
v2.10.2
v2.10.1
v2.10.0
v2.9.2
v2.9.1
v2.9.0
v2.8.4
v2.8.3
v2.8.2
v2.8.1
v2.8.0
v2.7.3
v2.7.2
v2.7.1
v2.7.0
v2.6.2
v2.6.1
v2.6.0
v2.5.4
v2.5.3
v2.5.2
v2.5.1
v2.5.0
v2.4.5
v2.4.4
v2.4.3
v2.4.2
v2.4.1
v2.4.0
v2.3.3
v2.3.2
v2.3.1
v2.3.0
v2.2.3
v2.2.2
v2.2.1
v2.2.0
v2.1.2
v2.1.1
v2.1.0
v2.0.2
v1.4.10
v1.4.7
v1.4.4
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
apps/jumpserver/settings.py
+11
-3
apps/jumpserver/settings.py
config_example.py
+2
-1
config_example.py
with
13 additions
and
4 deletions
+13
-4
apps/jumpserver/settings.py
+
11
-
3
View file @
91601cce
...
...
@@ -13,8 +13,12 @@ https://docs.djangoproject.com/en/1.10/ref/settings/
import
os
import
sys
import
ldap
from
django_auth_ldap.config
import
LDAPSearch
from
django.urls
import
reverse_lazy
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)))
PROJECT_DIR
=
os
.
path
.
dirname
(
BASE_DIR
)
...
...
@@ -232,14 +236,13 @@ LOGGING = {
},
'django_auth_ldap'
:
{
'handlers'
:
[
'console'
,
'ansible_logs'
],
'level'
:
LOG_LEVEL
,
'level'
:
"INFO"
,
}
}
}
# Internationalization
# https://docs.djangoproject.com/en/1.10/topics/i18n/
LANGUAGE_CODE
=
'en-us'
TIME_ZONE
=
'Asia/Shanghai'
...
...
@@ -312,7 +315,12 @@ if CONFIG.AUTH_LDAP:
AUTH_LDAP_SERVER_URI
=
CONFIG
.
AUTH_LDAP_SERVER_URI
AUTH_LDAP_BIND_DN
=
CONFIG
.
AUTH_LDAP_BIND_DN
AUTH_LDAP_BIND_PASSWORD
=
CONFIG
.
AUTH_LDAP_BIND_PASSWORD
AUTH_LDAP_USER_DN_TEMPLATE
=
CONFIG
.
AUTH_LDAP_USER_DN_TEMPLATE
# AUTH_LDAP_USER_DN_TEMPLATE = CONFIG.AUTH_LDAP_USER_DN_TEMPLATE
AUTH_LDAP_USER_SEARCH
=
LDAPSearch
(
CONFIG
.
AUTH_LDAP_SEARCH_OU
,
ldap
.
SCOPE_SUBTREE
,
CONFIG
.
AUTH_LDAP_SEARCH_FILTER
)
AUTH_LDAP_START_TLS
=
CONFIG
.
AUTH_LDAP_START_TLS
AUTH_LDAP_USER_ATTR_MAP
=
CONFIG
.
AUTH_LDAP_USER_ATTR_MAP
...
...
This diff is collapsed.
Click to expand it.
config_example.py
+
2
-
1
View file @
91601cce
...
...
@@ -100,7 +100,8 @@ class Config:
AUTH_LDAP_SERVER_URI
=
'ldap://localhost:389'
AUTH_LDAP_BIND_DN
=
'cn=admin,dc=jumpserver,dc=org'
AUTH_LDAP_BIND_PASSWORD
=
''
AUTH_LDAP_USER_DN_TEMPLATE
=
"uid=%(user)s,ou=people,dc=jumpserver,dc=org"
AUTH_LDAP_SEARCH_OU
=
'ou=tech,dc=jumpserver,dc=org'
AUTH_LDAP_SEARCH_FILTER
=
'(cn=%(user)s)'
AUTH_LDAP_USER_ATTR_MAP
=
{
"username"
:
"cn"
,
"name"
:
"sn"
,
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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
Menu
Projects
Groups
Snippets
Help