summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorthemaze75 <maze@novisoft.com>2015-06-05 17:16:32 +0000
committerEric Maziade <eric@maziade.com>2015-06-10 22:10:00 -0400
commit1d080f57454fda46eb60700a8693cb968e6d557f (patch)
treef94ed33eccf48632ee52f9095ff7745b56c47cb3 /config
parent84a414fe534ebb60c8e7396c245486be521e2a11 (diff)
downloadgitlab-ce-1d080f57454fda46eb60700a8693cb968e6d557f.tar.gz
session_expire_seconds => session_expire_delay
delay is in seconds more legible code in session_store Added `GitLab restart required` help block to session_expire_delay
Diffstat (limited to 'config')
-rw-r--r--config/initializers/1_settings.rb2
-rw-r--r--config/initializers/session_store.rb8
2 files changed, 7 insertions, 3 deletions
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb
index 9b39dff046e..f050a7ea1a5 100644
--- a/config/initializers/1_settings.rb
+++ b/config/initializers/1_settings.rb
@@ -128,7 +128,7 @@ Settings.gitlab['issue_closing_pattern'] = '((?:[Cc]los(?:e[sd]?|ing)|[Ff]ix(?:e
Settings.gitlab['default_projects_features'] ||= {}
Settings.gitlab['webhook_timeout'] ||= 10
Settings.gitlab['max_attachment_size'] ||= 10
-Settings.gitlab['session_expire_seconds'] ||= 604800
+Settings.gitlab['session_expire_delay'] ||= 10080
Settings.gitlab.default_projects_features['issues'] = true if Settings.gitlab.default_projects_features['issues'].nil?
Settings.gitlab.default_projects_features['merge_requests'] = true if Settings.gitlab.default_projects_features['merge_requests'].nil?
Settings.gitlab.default_projects_features['wiki'] = true if Settings.gitlab.default_projects_features['wiki'].nil?
diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb
index 1603f7561cd..43077fb575e 100644
--- a/config/initializers/session_store.rb
+++ b/config/initializers/session_store.rb
@@ -1,11 +1,15 @@
# Be sure to restart your server when you modify this file.
+if ActiveRecord::Base.connection.active? && ActiveRecord::Base.connection.table_exists?('application_settings')
+ Settings.gitlab['session_expire_delay'] = ApplicationSetting.current.session_expire_delay
+end
+
Gitlab::Application.config.session_store(
:redis_store, # Using the cookie_store would enable session replay attacks.
servers: Gitlab::Application.config.cache_store[1].merge(namespace: 'session:gitlab'), # re-use the Redis config from the Rails cache store
key: '_gitlab_session',
secure: Gitlab.config.gitlab.https,
httponly: true,
- expire_after: ActiveRecord::Base.connected? && ActiveRecord::Base.connection.table_exists?('application_settings') ? ApplicationSetting.current.session_expire_seconds : Settings.gitlab['session_expire_seconds'],
+ expire_after: Settings.gitlab['session_expire_delay'] * 60,
path: (Rails.application.config.relative_url_root.nil?) ? '/' : Rails.application.config.relative_url_root
-)
+) \ No newline at end of file