summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-07-26 11:10:27 +0100
committerPhil Hughes <me@iamphill.com>2016-07-26 11:10:27 +0100
commit2f5ee5ed202c3ba45d123616ded9a715380f5411 (patch)
tree872b46f6da752bf0bfc0f97b05bb03dc6eff3e09 /config
parent35ce7aae019462b5b39b89a4f900a0c100ff71bd (diff)
parent2e6a3b697c665006de87acc5777e6e332dee804a (diff)
downloadgitlab-ce-2f5ee5ed202c3ba45d123616ded9a715380f5411.tar.gz
Merge branch 'master' into diff-line-comment-vuejs
Diffstat (limited to 'config')
-rw-r--r--config/initializers/metrics.rb7
-rw-r--r--config/initializers/sidekiq.rb1
-rw-r--r--config/initializers/trusted_proxies.rb10
3 files changed, 16 insertions, 2 deletions
diff --git a/config/initializers/metrics.rb b/config/initializers/metrics.rb
index c4266ab8ba5..f3cddac5b36 100644
--- a/config/initializers/metrics.rb
+++ b/config/initializers/metrics.rb
@@ -136,6 +136,13 @@ if Gitlab::Metrics.enabled?
config.instrument_instance_methods(Rouge::Plugins::Redcarpet)
config.instrument_instance_methods(Rouge::Formatters::HTMLGitlab)
+ [:XML, :HTML].each do |namespace|
+ namespace_mod = Nokogiri.const_get(namespace)
+
+ config.instrument_methods(namespace_mod)
+ config.instrument_methods(namespace_mod::Document)
+ end
+
config.instrument_methods(Rinku)
end
diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb
index 5e839327e7a..cf49ec2194c 100644
--- a/config/initializers/sidekiq.rb
+++ b/config/initializers/sidekiq.rb
@@ -7,6 +7,7 @@ Sidekiq.configure_server do |config|
config.server_middleware do |chain|
chain.add Gitlab::SidekiqMiddleware::ArgumentsLogger if ENV['SIDEKIQ_LOG_ARGUMENTS']
chain.add Gitlab::SidekiqMiddleware::MemoryKiller if ENV['SIDEKIQ_MEMORY_KILLER_MAX_RSS']
+ chain.add Gitlab::SidekiqMiddleware::RequestStoreMiddleware unless ENV['SIDEKIQ_REQUEST_STORE'] == '0'
end
# Sidekiq-cron: load recurring jobs from gitlab.yml
diff --git a/config/initializers/trusted_proxies.rb b/config/initializers/trusted_proxies.rb
index df4a933e22f..30770b71e24 100644
--- a/config/initializers/trusted_proxies.rb
+++ b/config/initializers/trusted_proxies.rb
@@ -11,6 +11,12 @@ module Rack
end
end
+gitlab_trusted_proxies = Array(Gitlab.config.gitlab.trusted_proxies).map do |proxy|
+ begin
+ IPAddr.new(proxy)
+ rescue IPAddr::InvalidAddressError
+ end
+end.compact
+
Rails.application.config.action_dispatch.trusted_proxies = (
- [ '127.0.0.1', '::1' ] + Array(Gitlab.config.gitlab.trusted_proxies)
-).map { |proxy| IPAddr.new(proxy) }
+ [ '127.0.0.1', '::1' ] + gitlab_trusted_proxies)