Add timezone configuration to gitlab.yml
This commit is contained in:
parent
ee068e76f3
commit
593a287c8d
5 changed files with 11 additions and 0 deletions
|
@ -1,3 +1,6 @@
|
||||||
|
v 7.5.0
|
||||||
|
- Add time zone configuration on gitlab.yml (Sullivan Senechal)
|
||||||
|
|
||||||
v 7.4.0
|
v 7.4.0
|
||||||
- Refactored membership logic
|
- Refactored membership logic
|
||||||
- Improve error reporting on users API (Julien Bianchi)
|
- Improve error reporting on users API (Julien Bianchi)
|
||||||
|
|
|
@ -25,6 +25,7 @@ module Gitlab
|
||||||
|
|
||||||
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
||||||
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
||||||
|
# NOTE: Please prefer set time zone on config/gitlab.yml configuration file.
|
||||||
# config.time_zone = 'Central Time (US & Canada)'
|
# config.time_zone = 'Central Time (US & Canada)'
|
||||||
|
|
||||||
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
||||||
|
|
|
@ -33,6 +33,11 @@ production: &base
|
||||||
# Uncomment and customize if you can't use the default user to run GitLab (default: 'git')
|
# Uncomment and customize if you can't use the default user to run GitLab (default: 'git')
|
||||||
# user: git
|
# user: git
|
||||||
|
|
||||||
|
## Date & Time settings
|
||||||
|
# Uncomment and customize if you want to change the default time zone of GitLab application.
|
||||||
|
# To see all available zones, run `bundle exec rake time:zones:all`
|
||||||
|
# time_zone: 'UTC'
|
||||||
|
|
||||||
## Email settings
|
## Email settings
|
||||||
# Email address used in the "From" field in mails sent by GitLab
|
# Email address used in the "From" field in mails sent by GitLab
|
||||||
email_from: example@example.com
|
email_from: example@example.com
|
||||||
|
|
|
@ -103,6 +103,7 @@ Settings.gitlab['user_home'] ||= begin
|
||||||
rescue ArgumentError # no user configured
|
rescue ArgumentError # no user configured
|
||||||
'/home/' + Settings.gitlab['user']
|
'/home/' + Settings.gitlab['user']
|
||||||
end
|
end
|
||||||
|
Settings.gitlab['time_zone'] ||= nil
|
||||||
Settings.gitlab['signup_enabled'] ||= false
|
Settings.gitlab['signup_enabled'] ||= false
|
||||||
Settings.gitlab['signin_enabled'] ||= true if Settings.gitlab['signin_enabled'].nil?
|
Settings.gitlab['signin_enabled'] ||= true if Settings.gitlab['signin_enabled'].nil?
|
||||||
Settings.gitlab['restricted_visibility_levels'] = Settings.send(:verify_constant_array, Gitlab::VisibilityLevel, Settings.gitlab['restricted_visibility_levels'], [])
|
Settings.gitlab['restricted_visibility_levels'] = Settings.send(:verify_constant_array, Gitlab::VisibilityLevel, Settings.gitlab['restricted_visibility_levels'], [])
|
||||||
|
|
1
config/initializers/time_zone.rb
Normal file
1
config/initializers/time_zone.rb
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Time.zone = Gitlab.config.gitlab.time_zone || Time.zone
|
Loading…
Reference in a new issue