Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
80302a0f
Commit
80302a0f
authored
Dec 03, 2013
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Limit the number of results in gitlab:ldap:check
parent
376cfc6a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
config/gitlab.yml.example
config/gitlab.yml.example
+2
-1
lib/tasks/gitlab/check.rake
lib/tasks/gitlab/check.rake
+6
-5
No files found.
config/gitlab.yml.example
View file @
80302a0f
...
...
@@ -114,7 +114,8 @@ production: &base
# ==========================
## LDAP settings
# You can check your LDAP settings by running `bundle exec rake gitlab:ldap:check RAILS_ENV=production`
# You can inspect the first 100 LDAP users with login access by running:
# bundle exec rake gitlab:ldap:check[100] RAILS_ENV=production
ldap:
enabled: false
host: '_your_ldap_server'
...
...
lib/tasks/gitlab/check.rake
View file @
80302a0f
...
...
@@ -681,12 +681,13 @@ namespace :gitlab do
end
namespace
:ldap
do
task
check: :environment
do
task
:check
,
[
:limit
]
=>
:environment
do
|
t
,
args
|
args
.
with_defaults
(
limit:
100
)
warn_user_is_not_gitlab
start_checking
"LDAP"
if
ldap_config
.
enabled
print_users
print_users
(
args
.
limit
)
else
puts
'LDAP is disabled in config/gitlab.yml'
end
...
...
@@ -694,9 +695,9 @@ namespace :gitlab do
finished_checking
"LDAP"
end
def
print_users
puts
'The following LDAP users can log in to your GitLab server:'
ldap
.
search
(
attributes:
attributes
,
filter:
filter
,
return_result:
false
)
do
|
entry
|
def
print_users
(
limit
)
puts
"LDAP users with access to your GitLab server (limit:
#{
limit
}
):"
ldap
.
search
(
attributes:
attributes
,
filter:
filter
,
size:
limit
,
return_result:
false
)
do
|
entry
|
puts
"DN:
#{
entry
.
dn
}
\t
#{
ldap_config
.
uid
}
:
#{
entry
[
ldap_config
.
uid
]
}
"
end
end
...
...
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