Merge branch 'redis_settings'
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> Conflicts: CHANGELOG
This commit is contained in:
commit
c1d2640b2e
4 changed files with 23 additions and 11 deletions
|
@ -7,6 +7,8 @@ v 7.3.0
|
||||||
- Better search with filtering, pagination etc
|
- Better search with filtering, pagination etc
|
||||||
- Added a checkbox to toggle line wrapping in diff (Yuriy Glukhov)
|
- Added a checkbox to toggle line wrapping in diff (Yuriy Glukhov)
|
||||||
- Prevent project stars duplication when fork project
|
- Prevent project stars duplication when fork project
|
||||||
|
- Support Unix domain sockets for Redis
|
||||||
|
- Store session Redis keys in 'session:gitlab:' namespace
|
||||||
|
|
||||||
v 7.2.0
|
v 7.2.0
|
||||||
- Explore page
|
- Explore page
|
||||||
|
|
|
@ -45,16 +45,6 @@ Gitlab::Application.configure do
|
||||||
# Use a different logger for distributed setups
|
# Use a different logger for distributed setups
|
||||||
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
||||||
|
|
||||||
# Use a different cache store in production
|
|
||||||
config_file = Rails.root.join('config', 'resque.yml')
|
|
||||||
|
|
||||||
resque_url = if File.exists?(config_file)
|
|
||||||
YAML.load_file(config_file)[Rails.env]
|
|
||||||
else
|
|
||||||
"redis://localhost:6379"
|
|
||||||
end
|
|
||||||
config.cache_store = :redis_store, resque_url, {namespace: 'cache:gitlab'}
|
|
||||||
|
|
||||||
# Enable serving of images, stylesheets, and JavaScripts from an asset server
|
# Enable serving of images, stylesheets, and JavaScripts from an asset server
|
||||||
# config.action_controller.asset_host = "http://assets.example.com"
|
# config.action_controller.asset_host = "http://assets.example.com"
|
||||||
|
|
||||||
|
|
20
config/initializers/7_cache_settings.rb
Normal file
20
config/initializers/7_cache_settings.rb
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
Gitlab::Application.configure do
|
||||||
|
redis_config_file = Rails.root.join('config', 'resque.yml')
|
||||||
|
|
||||||
|
redis_url_string = if File.exists?(redis_config_file)
|
||||||
|
YAML.load_file(redis_config_file)[Rails.env]
|
||||||
|
else
|
||||||
|
"redis://localhost:6379"
|
||||||
|
end
|
||||||
|
|
||||||
|
# Redis::Store does not handle Unix sockets well, so let's do it for them
|
||||||
|
redis_config_hash = Redis::Store::Factory.extract_host_options_from_uri(redis_url_string)
|
||||||
|
redis_uri = URI.parse(redis_url_string)
|
||||||
|
if redis_uri.scheme == 'unix'
|
||||||
|
redis_config_hash[:path] = redis_uri.path
|
||||||
|
end
|
||||||
|
|
||||||
|
redis_config_hash[:namespace] = 'cache:gitlab'
|
||||||
|
|
||||||
|
config.cache_store = :redis_store, redis_config_hash
|
||||||
|
end
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
Gitlab::Application.config.session_store(
|
Gitlab::Application.config.session_store(
|
||||||
:redis_store, # Using the cookie_store would enable session replay attacks.
|
:redis_store, # Using the cookie_store would enable session replay attacks.
|
||||||
servers: Gitlab::Application.config.cache_store[1], # re-use the Redis config from the Rails cache store
|
servers: Gitlab::Application.config.cache_store[1].merge(namespace: 'session:gitlab'), # re-use the Redis config from the Rails cache store
|
||||||
key: '_gitlab_session',
|
key: '_gitlab_session',
|
||||||
secure: Gitlab.config.gitlab.https,
|
secure: Gitlab.config.gitlab.https,
|
||||||
httponly: true,
|
httponly: true,
|
||||||
|
|
Loading…
Reference in a new issue