diff options
author | Oswaldo Ferreira <oswaldo@gitlab.com> | 2019-05-29 13:43:07 -0300 |
---|---|---|
committer | Oswaldo Ferreira <oswaldo@gitlab.com> | 2019-05-29 19:52:25 -0300 |
commit | b599fb4f85b09d78d28ea5701eac7d28ceabbec7 (patch) | |
tree | 5332069fef54e895387d419420779da34fc58c6f /lib/gitlab.rb | |
parent | 5dd3b753f5ee4a400c7e492f7bacf75ecfab7cb4 (diff) | |
download | gitlab-ce-b599fb4f85b09d78d28ea5701eac7d28ceabbec7.tar.gz |
Add DNS rebinding protection settings
Diffstat (limited to 'lib/gitlab.rb')
-rw-r--r-- | lib/gitlab.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/gitlab.rb b/lib/gitlab.rb index 3f107fbbf3b..ccaf06c5d6a 100644 --- a/lib/gitlab.rb +++ b/lib/gitlab.rb @@ -40,6 +40,7 @@ module Gitlab SUBDOMAIN_REGEX = %r{\Ahttps://[a-z0-9]+\.gitlab\.com\z}.freeze VERSION = File.read(root.join("VERSION")).strip.freeze INSTALLATION_TYPE = File.read(root.join("INSTALLATION_TYPE")).strip.freeze + HTTP_PROXY_ENV_VARS = %w(http_proxy https_proxy HTTP_PROXY HTTPS_PROXY).freeze def self.com? # Check `gl_subdomain?` as well to keep parity with gitlab.com @@ -66,6 +67,10 @@ module Gitlab end end + def self.http_proxy_env? + HTTP_PROXY_ENV_VARS.any? { |name| ENV[name] } + end + def self.process_name return 'sidekiq' if Sidekiq.server? return 'console' if defined?(Rails::Console) |