diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-18 20:02:30 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-18 20:02:30 +0000 |
commit | 41fe97390ceddf945f3d967b8fdb3de4c66b7dea (patch) | |
tree | 9c8d89a8624828992f06d892cd2f43818ff5dcc8 /lib/gitlab.rb | |
parent | 0804d2dc31052fb45a1efecedc8e06ce9bc32862 (diff) | |
download | gitlab-ce-41fe97390ceddf945f3d967b8fdb3de4c66b7dea.tar.gz |
Add latest changes from gitlab-org/gitlab@14-9-stable-eev14.9.0-rc42
Diffstat (limited to 'lib/gitlab.rb')
-rw-r--r-- | lib/gitlab.rb | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/gitlab.rb b/lib/gitlab.rb index 2449554d3c0..d33120575a2 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.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 @@ -82,12 +88,8 @@ module Gitlab Gitlab::Saas.subdomain_regex === Gitlab.config.gitlab.url end - def self.dev_env_org_or_com? - dev_env_or_com? || org? - end - - def self.dev_env_or_com? - Rails.env.development? || com? + def self.org_or_com? + org? || com? end def self.dev_or_test_env? |