From 871e82b7c73283c2c71355e3258a6c9d3b8c0eda Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Mon, 21 Feb 2022 15:19:50 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- lib/gitlab.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib/gitlab.rb') diff --git a/lib/gitlab.rb b/lib/gitlab.rb index 2449554d3c0..ad1a1611309 100644 --- a/lib/gitlab.rb +++ b/lib/gitlab.rb @@ -49,9 +49,15 @@ module Gitlab 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.simulate_com? + return false unless Rails.env.test? || Rails.env.development? + + Gitlab::Utils.to_boolean(ENV['GITLAB_SIMULATE_SAAS']) + end + def self.com? # Check `gl_subdomain?` as well to keep parity with gitlab.com - Gitlab.config.gitlab.url == Gitlab::Saas.com_url || gl_subdomain? + simulate_com? || Gitlab.config.gitlab.url == Gitlab::Saas.com_url || gl_subdomain? end def self.com @@ -87,7 +93,7 @@ module Gitlab end def self.dev_env_or_com? - Rails.env.development? || com? + com? end def self.dev_or_test_env? -- cgit v1.2.1