Merge branch 'redis_settings'

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

Conflicts:
	CHANGELOG
This commit is contained in:
Dmitriy Zaporozhets 2014-08-28 15:03:22 +03:00
commit c1d2640b2e
No known key found for this signature in database
GPG key ID: 627C5F589F467F17
4 changed files with 23 additions and 11 deletions

View file

@ -7,6 +7,8 @@ v 7.3.0
- Better search with filtering, pagination etc
- Added a checkbox to toggle line wrapping in diff (Yuriy Glukhov)
- 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
- Explore page

View file

@ -45,16 +45,6 @@ Gitlab::Application.configure do
# Use a different logger for distributed setups
# 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
# config.action_controller.asset_host = "http://assets.example.com"

View 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

View file

@ -2,7 +2,7 @@
Gitlab::Application.config.session_store(
: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',
secure: Gitlab.config.gitlab.https,
httponly: true,