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
e69b5f19
Commit
e69b5f19
authored
Oct 31, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Place the settings that are valid for all ldap servers in a correct place.
parent
8a92a1bb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
9 deletions
+11
-9
app/workers/ldap_sync_worker.rb
app/workers/ldap_sync_worker.rb
+2
-2
config/gitlab.yml.example
config/gitlab.yml.example
+7
-5
config/initializers/1_settings.rb
config/initializers/1_settings.rb
+2
-2
No files found.
app/workers/ldap_sync_worker.rb
View file @
e69b5f19
...
...
@@ -3,8 +3,8 @@ class LdapSyncWorker
include
Sidetiq
::
Schedulable
if
Gitlab
.
config
.
ldap
.
enabled
HOUR
=
Gitlab
.
config
.
ldap
.
s
ervers
.
values
.
first
[
'schedule_sync_hour'
]
MINUTE
=
Gitlab
.
config
.
ldap
.
s
ervers
.
values
.
first
[
'schedule_sync_minute'
]
HOUR
=
Gitlab
.
config
.
ldap
.
s
chedule_sync_hour
MINUTE
=
Gitlab
.
config
.
ldap
.
s
chedule_sync_minute
recurrence
{
daily
.
hour_of_day
(
HOUR
).
minute_of_hour
(
MINUTE
)
}
end
...
...
config/gitlab.yml.example
View file @
e69b5f19
...
...
@@ -135,6 +135,13 @@ production: &base
# bundle exec rake gitlab:ldap:check RAILS_ENV=production
ldap:
enabled: false
# GitLab EE only.
# GitLab will refresh LDAP user membership once a day.
# Default time of the day when this will happen is at 1:30am server time.
schedule_sync_hour: 1 # Hour of the day. Value from 0-23.
schedule_sync_minute: 30 # Minute of the hour. Value from 0-59.
servers:
main: # 'main' is the GitLab 'provider ID' of this LDAP server
## label
...
...
@@ -210,11 +217,6 @@ production: &base
#
sync_ssh_keys: false
# GitLab will refresh LDAP user membership once a day.
# Default time of the day when this will happen is at 1:30am server time.
schedule_sync_hour: 1 # Hour of the day. Value from 0-23.
schedule_sync_minute: 30 # Minute of the hour. Value from 0-59.
# GitLab EE only: add more LDAP servers
# Choose an ID made of a-z and 0-9 . This ID will be stored in the database
# so that GitLab can remember which LDAP server a user belongs to.
...
...
config/initializers/1_settings.rb
View file @
e69b5f19
...
...
@@ -56,6 +56,8 @@ end
Settings
[
'ldap'
]
||=
Settingslogic
.
new
({})
Settings
.
ldap
[
'enabled'
]
=
false
if
Settings
.
ldap
[
'enabled'
].
nil?
Settings
.
ldap
[
'sync_time'
]
=
3600
if
Settings
.
ldap
[
'sync_time'
].
nil?
Settings
.
ldap
[
'schedule_sync_hour'
]
=
1
if
Settings
.
ldap
[
'schedule_sync_hour'
].
nil?
Settings
.
ldap
[
'schedule_sync_minute'
]
=
30
if
Settings
.
ldap
[
'schedule_sync_minute'
].
nil?
# backwards compatibility, we only have one host
if
Settings
.
ldap
[
'enabled'
]
||
Rails
.
env
.
test?
...
...
@@ -77,8 +79,6 @@ if Settings.ldap['enabled'] || Rails.env.test?
server
[
'provider_name'
]
||=
"ldap
#{
key
}
"
.
downcase
server
[
'sync_time'
]
=
3600
if
server
[
'sync_time'
].
nil?
server
[
'provider_class'
]
=
OmniAuth
::
Utils
.
camelize
(
server
[
'provider_name'
])
server
[
'schedule_sync_hour'
]
=
1
if
server
[
'schedule_sync_hour'
].
nil?
server
[
'schedule_sync_minute'
]
=
30
if
server
[
'schedule_sync_minute'
].
nil?
Settings
.
ldap
[
'servers'
][
key
]
=
server
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