Commit 3c793920 authored by Mario de la Ossa's avatar Mario de la Ossa Committed by Sean McGivern

use Gitlab::UserSettings directly as a singleton instead of including/extending it

parent f32b4108
class Admin::CohortsController < Admin::ApplicationController class Admin::CohortsController < Admin::ApplicationController
def index def index
if current_application_settings.usage_ping_enabled if Gitlab::CurrentSettings.usage_ping_enabled
cohorts_results = Rails.cache.fetch('cohorts', expires_in: 1.day) do cohorts_results = Rails.cache.fetch('cohorts', expires_in: 1.day) do
CohortsService.new.execute CohortsService.new.execute
end end
......
...@@ -2,7 +2,6 @@ require 'gon' ...@@ -2,7 +2,6 @@ require 'gon'
require 'fogbugz' require 'fogbugz'
class ApplicationController < ActionController::Base class ApplicationController < ActionController::Base
include Gitlab::CurrentSettings
include Gitlab::GonHelper include Gitlab::GonHelper
include GitlabRoutingHelper include GitlabRoutingHelper
include PageLayoutHelper include PageLayoutHelper
...@@ -28,7 +27,7 @@ class ApplicationController < ActionController::Base ...@@ -28,7 +27,7 @@ class ApplicationController < ActionController::Base
protect_from_forgery with: :exception protect_from_forgery with: :exception
helper_method :can?, :current_application_settings helper_method :can?
helper_method :import_sources_enabled?, :github_import_enabled?, :gitea_import_enabled?, :github_import_configured?, :gitlab_import_enabled?, :gitlab_import_configured?, :bitbucket_import_enabled?, :bitbucket_import_configured?, :google_code_import_enabled?, :fogbugz_import_enabled?, :git_import_enabled?, :gitlab_project_import_enabled? helper_method :import_sources_enabled?, :github_import_enabled?, :gitea_import_enabled?, :github_import_configured?, :gitlab_import_enabled?, :gitlab_import_configured?, :bitbucket_import_enabled?, :bitbucket_import_configured?, :google_code_import_enabled?, :fogbugz_import_enabled?, :git_import_enabled?, :gitlab_project_import_enabled?
rescue_from Encoding::CompatibilityError do |exception| rescue_from Encoding::CompatibilityError do |exception|
...@@ -108,7 +107,7 @@ class ApplicationController < ActionController::Base ...@@ -108,7 +107,7 @@ class ApplicationController < ActionController::Base
end end
def verify_namespace_plan_check_enabled def verify_namespace_plan_check_enabled
render_404 unless current_application_settings.should_check_namespace_plan? render_404 unless Gitlab::CurrentSettings.should_check_namespace_plan?
end end
def log_exception(exception) def log_exception(exception)
...@@ -127,7 +126,7 @@ class ApplicationController < ActionController::Base ...@@ -127,7 +126,7 @@ class ApplicationController < ActionController::Base
if Gitlab::Geo.secondary? if Gitlab::Geo.secondary?
Gitlab::Geo.primary_node.oauth_logout_url(@geo_logout_state) Gitlab::Geo.primary_node.oauth_logout_url(@geo_logout_state)
else else
current_application_settings.after_sign_out_path.presence || new_user_session_path Gitlab::CurrentSettings.after_sign_out_path.presence || new_user_session_path
end end
end end
...@@ -276,15 +275,15 @@ class ApplicationController < ActionController::Base ...@@ -276,15 +275,15 @@ class ApplicationController < ActionController::Base
end end
def import_sources_enabled? def import_sources_enabled?
!current_application_settings.import_sources.empty? !Gitlab::CurrentSettings.import_sources.empty?
end end
def github_import_enabled? def github_import_enabled?
current_application_settings.import_sources.include?('github') Gitlab::CurrentSettings.import_sources.include?('github')
end end
def gitea_import_enabled? def gitea_import_enabled?
current_application_settings.import_sources.include?('gitea') Gitlab::CurrentSettings.import_sources.include?('gitea')
end end
def github_import_configured? def github_import_configured?
...@@ -292,7 +291,7 @@ class ApplicationController < ActionController::Base ...@@ -292,7 +291,7 @@ class ApplicationController < ActionController::Base
end end
def gitlab_import_enabled? def gitlab_import_enabled?
request.host != 'gitlab.com' && current_application_settings.import_sources.include?('gitlab') request.host != 'gitlab.com' && Gitlab::CurrentSettings.import_sources.include?('gitlab')
end end
def gitlab_import_configured? def gitlab_import_configured?
...@@ -300,7 +299,7 @@ class ApplicationController < ActionController::Base ...@@ -300,7 +299,7 @@ class ApplicationController < ActionController::Base
end end
def bitbucket_import_enabled? def bitbucket_import_enabled?
current_application_settings.import_sources.include?('bitbucket') Gitlab::CurrentSettings.import_sources.include?('bitbucket')
end end
def bitbucket_import_configured? def bitbucket_import_configured?
...@@ -308,19 +307,19 @@ class ApplicationController < ActionController::Base ...@@ -308,19 +307,19 @@ class ApplicationController < ActionController::Base
end end
def google_code_import_enabled? def google_code_import_enabled?
current_application_settings.import_sources.include?('google_code') Gitlab::CurrentSettings.import_sources.include?('google_code')
end end
def fogbugz_import_enabled? def fogbugz_import_enabled?
current_application_settings.import_sources.include?('fogbugz') Gitlab::CurrentSettings.import_sources.include?('fogbugz')
end end
def git_import_enabled? def git_import_enabled?
current_application_settings.import_sources.include?('git') Gitlab::CurrentSettings.import_sources.include?('git')
end end
def gitlab_project_import_enabled? def gitlab_project_import_enabled?
current_application_settings.import_sources.include?('gitlab_project') Gitlab::CurrentSettings.import_sources.include?('gitlab_project')
end end
# U2F (universal 2nd factor) devices need a unique identifier for the application # U2F (universal 2nd factor) devices need a unique identifier for the application
......
...@@ -20,13 +20,13 @@ module EnforcesTwoFactorAuthentication ...@@ -20,13 +20,13 @@ module EnforcesTwoFactorAuthentication
end end
def two_factor_authentication_required? def two_factor_authentication_required?
current_application_settings.require_two_factor_authentication? || Gitlab::CurrentSettings.require_two_factor_authentication? ||
current_user.try(:require_two_factor_authentication_from_group?) current_user.try(:require_two_factor_authentication_from_group?)
end end
def two_factor_authentication_reason(global: -> {}, group: -> {}) def two_factor_authentication_reason(global: -> {}, group: -> {})
if two_factor_authentication_required? if two_factor_authentication_required?
if current_application_settings.require_two_factor_authentication? if Gitlab::CurrentSettings.require_two_factor_authentication?
global.call global.call
else else
groups = current_user.expanded_groups_requiring_two_factor_authentication.reorder(name: :asc) groups = current_user.expanded_groups_requiring_two_factor_authentication.reorder(name: :asc)
...@@ -36,7 +36,7 @@ module EnforcesTwoFactorAuthentication ...@@ -36,7 +36,7 @@ module EnforcesTwoFactorAuthentication
end end
def two_factor_grace_period def two_factor_grace_period
periods = [current_application_settings.two_factor_grace_period] periods = [Gitlab::CurrentSettings.two_factor_grace_period]
periods << current_user.two_factor_grace_period if current_user.try(:require_two_factor_authentication_from_group?) periods << current_user.two_factor_grace_period if current_user.try(:require_two_factor_authentication_from_group?)
periods.min periods.min
end end
......
module RequiresWhitelistedMonitoringClient module RequiresWhitelistedMonitoringClient
extend ActiveSupport::Concern extend ActiveSupport::Concern
include Gitlab::CurrentSettings
included do included do
before_action :validate_ip_whitelisted_or_valid_token! before_action :validate_ip_whitelisted_or_valid_token!
end end
...@@ -26,7 +24,7 @@ module RequiresWhitelistedMonitoringClient ...@@ -26,7 +24,7 @@ module RequiresWhitelistedMonitoringClient
token.present? && token.present? &&
ActiveSupport::SecurityUtils.variable_size_secure_compare( ActiveSupport::SecurityUtils.variable_size_secure_compare(
token, token,
current_application_settings.health_check_access_token Gitlab::CurrentSettings.health_check_access_token
) )
end end
......
...@@ -51,7 +51,7 @@ class InvitesController < ApplicationController ...@@ -51,7 +51,7 @@ class InvitesController < ApplicationController
return if current_user return if current_user
notice = "To accept this invitation, sign in" notice = "To accept this invitation, sign in"
notice << " or create an account" if current_application_settings.allow_signup? notice << " or create an account" if Gitlab::CurrentSettings.allow_signup?
notice << "." notice << "."
store_location_for :user, request.fullpath store_location_for :user, request.fullpath
......
...@@ -10,6 +10,6 @@ class KodingController < ApplicationController ...@@ -10,6 +10,6 @@ class KodingController < ApplicationController
private private
def check_integration! def check_integration!
render_404 unless current_application_settings.koding_enabled? render_404 unless Gitlab::CurrentSettings.koding_enabled?
end end
end end
class Oauth::ApplicationsController < Doorkeeper::ApplicationsController class Oauth::ApplicationsController < Doorkeeper::ApplicationsController
include Gitlab::CurrentSettings
include Gitlab::GonHelper include Gitlab::GonHelper
include PageLayoutHelper include PageLayoutHelper
include OauthApplications include OauthApplications
...@@ -31,7 +30,7 @@ class Oauth::ApplicationsController < Doorkeeper::ApplicationsController ...@@ -31,7 +30,7 @@ class Oauth::ApplicationsController < Doorkeeper::ApplicationsController
private private
def verify_user_oauth_applications_enabled def verify_user_oauth_applications_enabled
return if current_application_settings.user_oauth_applications? return if Gitlab::CurrentSettings.user_oauth_applications?
redirect_to profile_path redirect_to profile_path
end end
......
...@@ -158,7 +158,7 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController ...@@ -158,7 +158,7 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
label = Gitlab::OAuth::Provider.label_for(oauth['provider']) label = Gitlab::OAuth::Provider.label_for(oauth['provider'])
message = "Signing in using your #{label} account without a pre-existing GitLab account is not allowed." message = "Signing in using your #{label} account without a pre-existing GitLab account is not allowed."
if current_application_settings.allow_signup? if Gitlab::CurrentSettings.allow_signup?
message << " Create a GitLab account first, and then connect it to your #{label} account." message << " Create a GitLab account first, and then connect it to your #{label} account."
end end
......
class PasswordsController < Devise::PasswordsController class PasswordsController < Devise::PasswordsController
include Gitlab::CurrentSettings
skip_before_action :require_no_authentication, only: [:edit, :update] skip_before_action :require_no_authentication, only: [:edit, :update]
before_action :resource_from_email, only: [:create] before_action :resource_from_email, only: [:create]
...@@ -48,7 +46,7 @@ class PasswordsController < Devise::PasswordsController ...@@ -48,7 +46,7 @@ class PasswordsController < Devise::PasswordsController
if resource if resource
return if resource.allow_password_authentication? return if resource.allow_password_authentication?
else else
return if current_application_settings.password_authentication_enabled? return if Gitlab::CurrentSettings.password_authentication_enabled?
end end
redirect_to after_sending_reset_password_instructions_path_for(resource_name), redirect_to after_sending_reset_password_instructions_path_for(resource_name),
......
...@@ -24,7 +24,7 @@ module Projects ...@@ -24,7 +24,7 @@ module Projects
end end
def slack_service def slack_service
if current_application_settings.slack_app_enabled if Gitlab::CurrentSettings.slack_app_enabled
'slack_slash_commands' 'slack_slash_commands'
else else
'gitlab_slack_application' 'gitlab_slack_application'
......
...@@ -404,7 +404,7 @@ class ProjectsController < Projects::ApplicationController ...@@ -404,7 +404,7 @@ class ProjectsController < Projects::ApplicationController
end end
def project_export_enabled def project_export_enabled
render_404 unless current_application_settings.project_export_enabled? render_404 unless Gitlab::CurrentSettings.project_export_enabled?
end end
def redirect_git_extension def redirect_git_extension
......
...@@ -23,7 +23,7 @@ class RootController < Dashboard::ProjectsController ...@@ -23,7 +23,7 @@ class RootController < Dashboard::ProjectsController
def redirect_unlogged_user def redirect_unlogged_user
if redirect_to_home_page_url? if redirect_to_home_page_url?
redirect_to(current_application_settings.home_page_url) redirect_to(Gitlab::CurrentSettings.home_page_url)
else else
redirect_to(new_user_session_path) redirect_to(new_user_session_path)
end end
...@@ -48,9 +48,9 @@ class RootController < Dashboard::ProjectsController ...@@ -48,9 +48,9 @@ class RootController < Dashboard::ProjectsController
def redirect_to_home_page_url? def redirect_to_home_page_url?
# If user is not signed-in and tries to access root_path - redirect him to landing page # If user is not signed-in and tries to access root_path - redirect him to landing page
# Don't redirect to the default URL to prevent endless redirections # Don't redirect to the default URL to prevent endless redirections
return false unless current_application_settings.home_page_url.present? return false unless Gitlab::CurrentSettings.home_page_url.present?
home_page_url = current_application_settings.home_page_url.chomp('/') home_page_url = Gitlab::CurrentSettings.home_page_url.chomp('/')
root_urls = [Gitlab.config.gitlab['url'].chomp('/'), root_url.chomp('/')] root_urls = [Gitlab.config.gitlab['url'].chomp('/'), root_url.chomp('/')]
root_urls.exclude?(home_page_url) root_urls.exclude?(home_page_url)
......
...@@ -2,25 +2,23 @@ module ApplicationSettingsHelper ...@@ -2,25 +2,23 @@ module ApplicationSettingsHelper
prepend EE::ApplicationSettingsHelper prepend EE::ApplicationSettingsHelper
extend self extend self
include Gitlab::CurrentSettings
delegate :allow_signup?, delegate :allow_signup?,
:gravatar_enabled?, :gravatar_enabled?,
:password_authentication_enabled_for_web?, :password_authentication_enabled_for_web?,
:akismet_enabled?, :akismet_enabled?,
:koding_enabled?, :koding_enabled?,
to: :current_application_settings to: :'Gitlab::CurrentSettings.current_application_settings'
def user_oauth_applications? def user_oauth_applications?
current_application_settings.user_oauth_applications Gitlab::CurrentSettings.user_oauth_applications
end end
def allowed_protocols_present? def allowed_protocols_present?
current_application_settings.enabled_git_access_protocol.present? Gitlab::CurrentSettings.enabled_git_access_protocol.present?
end end
def enabled_protocol def enabled_protocol
case current_application_settings.enabled_git_access_protocol case Gitlab::CurrentSettings.enabled_git_access_protocol
when 'http' when 'http'
gitlab_config.protocol gitlab_config.protocol
when 'ssh' when 'ssh'
...@@ -58,7 +56,7 @@ module ApplicationSettingsHelper ...@@ -58,7 +56,7 @@ module ApplicationSettingsHelper
# toggle button effect. # toggle button effect.
def import_sources_checkboxes(help_block_id) def import_sources_checkboxes(help_block_id)
Gitlab::ImportSources.options.map do |name, source| Gitlab::ImportSources.options.map do |name, source|
checked = current_application_settings.import_sources.include?(source) checked = Gitlab::CurrentSettings.import_sources.include?(source)
css_class = checked ? 'active' : '' css_class = checked ? 'active' : ''
checkbox_name = 'application_setting[import_sources][]' checkbox_name = 'application_setting[import_sources][]'
...@@ -73,7 +71,7 @@ module ApplicationSettingsHelper ...@@ -73,7 +71,7 @@ module ApplicationSettingsHelper
def oauth_providers_checkboxes def oauth_providers_checkboxes
button_based_providers.map do |source| button_based_providers.map do |source|
disabled = current_application_settings.disabled_oauth_sign_in_sources.include?(source.to_s) disabled = Gitlab::CurrentSettings.disabled_oauth_sign_in_sources.include?(source.to_s)
css_class = 'btn' css_class = 'btn'
css_class << ' active' unless disabled css_class << ' active' unless disabled
checkbox_name = 'application_setting[enabled_oauth_sign_in_sources][]' checkbox_name = 'application_setting[enabled_oauth_sign_in_sources][]'
......
module AuthHelper module AuthHelper
include Gitlab::CurrentSettings
PROVIDERS_WITH_ICONS = %w(twitter github gitlab bitbucket google_oauth2 facebook azure_oauth2 authentiq).freeze PROVIDERS_WITH_ICONS = %w(twitter github gitlab bitbucket google_oauth2 facebook azure_oauth2 authentiq).freeze
FORM_BASED_PROVIDERS = [/\Aldap/, 'kerberos', 'crowd'].freeze FORM_BASED_PROVIDERS = [/\Aldap/, 'kerberos', 'crowd'].freeze
delegate :slack_app_id, to: :current_application_settings delegate :slack_app_id, to: :'Gitlab::CurrentSettings.current_application_settings'
def ldap_enabled? def ldap_enabled?
Gitlab::LDAP::Config.enabled? Gitlab::LDAP::Config.enabled?
...@@ -47,7 +45,7 @@ module AuthHelper ...@@ -47,7 +45,7 @@ module AuthHelper
end end
def enabled_button_based_providers def enabled_button_based_providers
disabled_providers = current_application_settings.disabled_oauth_sign_in_sources || [] disabled_providers = Gitlab::CurrentSettings.disabled_oauth_sign_in_sources || []
button_based_providers.map(&:to_s) - disabled_providers button_based_providers.map(&:to_s) - disabled_providers
end end
......
module ProjectsHelper module ProjectsHelper
include Gitlab::CurrentSettings
prepend ::EE::ProjectsHelper prepend ::EE::ProjectsHelper
def link_to_project(project) def link_to_project(project)
...@@ -216,7 +214,7 @@ module ProjectsHelper ...@@ -216,7 +214,7 @@ module ProjectsHelper
project.cache_key, project.cache_key,
controller.controller_name, controller.controller_name,
controller.action_name, controller.action_name,
current_application_settings.cache_key, Gitlab::CurrentSettings.cache_key,
'v2.5' 'v2.5'
] ]
...@@ -468,10 +466,10 @@ module ProjectsHelper ...@@ -468,10 +466,10 @@ module ProjectsHelper
path = "#{import_path}?repo=#{repo}&branch=#{branch}&sha=#{sha}" path = "#{import_path}?repo=#{repo}&branch=#{branch}&sha=#{sha}"
return URI.join(current_application_settings.koding_url, path).to_s return URI.join(Gitlab::CurrentSettings.koding_url, path).to_s
end end
current_application_settings.koding_url Gitlab::CurrentSettings.koding_url
end end
def contribution_guide_path(project) def contribution_guide_path(project)
...@@ -588,7 +586,7 @@ module ProjectsHelper ...@@ -588,7 +586,7 @@ module ProjectsHelper
def restricted_levels def restricted_levels
return [] if current_user.admin? return [] if current_user.admin?
current_application_settings.restricted_visibility_levels || [] Gitlab::CurrentSettings.restricted_visibility_levels || []
end end
def project_permissions_settings(project) def project_permissions_settings(project)
......
module VersionCheckHelper module VersionCheckHelper
def version_status_badge def version_status_badge
if Rails.env.production? && current_application_settings.version_check_enabled if Rails.env.production? && Gitlab::CurrentSettings.version_check_enabled
image_url = VersionCheck.new.url image_url = VersionCheck.new.url
image_tag image_url, class: 'js-version-status-badge' image_tag image_url, class: 'js-version-status-badge'
end end
......
...@@ -151,12 +151,12 @@ module VisibilityLevelHelper ...@@ -151,12 +151,12 @@ module VisibilityLevelHelper
def restricted_visibility_levels(show_all = false) def restricted_visibility_levels(show_all = false)
return [] if current_user.admin? && !show_all return [] if current_user.admin? && !show_all
current_application_settings.restricted_visibility_levels || [] Gitlab::CurrentSettings.restricted_visibility_levels || []
end end
delegate :default_project_visibility, delegate :default_project_visibility,
:default_group_visibility, :default_group_visibility,
to: :current_application_settings to: :'Gitlab::CurrentSettings.current_application_settings'
def disallowed_visibility_level?(form_model, level) def disallowed_visibility_level?(form_model, level)
return false unless form_model.respond_to?(:visibility_level_allowed?) return false unless form_model.respond_to?(:visibility_level_allowed?)
......
class AbuseReportMailer < BaseMailer class AbuseReportMailer < BaseMailer
include Gitlab::CurrentSettings
def notify(abuse_report_id) def notify(abuse_report_id)
return unless deliverable? return unless deliverable?
@abuse_report = AbuseReport.find(abuse_report_id) @abuse_report = AbuseReport.find(abuse_report_id)
mail( mail(
to: current_application_settings.admin_notification_email, to: Gitlab::CurrentSettings.admin_notification_email,
subject: "#{@abuse_report.user.name} (#{@abuse_report.user.username}) was reported for abuse" subject: "#{@abuse_report.user.name} (#{@abuse_report.user.username}) was reported for abuse"
) )
end end
...@@ -15,6 +13,6 @@ class AbuseReportMailer < BaseMailer ...@@ -15,6 +13,6 @@ class AbuseReportMailer < BaseMailer
private private
def deliverable? def deliverable?
current_application_settings.admin_notification_email.present? Gitlab::CurrentSettings.admin_notification_email.present?
end end
end end
class BaseMailer < ActionMailer::Base class BaseMailer < ActionMailer::Base
include Gitlab::CurrentSettings
around_action :render_with_default_locale around_action :render_with_default_locale
helper ApplicationHelper helper ApplicationHelper
helper MarkupHelper helper MarkupHelper
attr_accessor :current_user attr_accessor :current_user
helper_method :current_user, :can?, :current_application_settings helper_method :current_user, :can?
default from: proc { default_sender_address.format } default from: proc { default_sender_address.format }
default reply_to: proc { default_reply_to_address.format } default reply_to: proc { default_reply_to_address.format }
......
module Clusters module Clusters
module Platforms module Platforms
class Kubernetes < ActiveRecord::Base class Kubernetes < ActiveRecord::Base
include Gitlab::CurrentSettings
include Gitlab::Kubernetes include Gitlab::Kubernetes
include ReactiveCaching include ReactiveCaching
...@@ -171,7 +170,7 @@ module Clusters ...@@ -171,7 +170,7 @@ module Clusters
{ {
token: token, token: token,
ca_pem: ca_pem, ca_pem: ca_pem,
max_session_time: current_application_settings.terminal_max_session_time max_session_time: Gitlab::CurrentSettings.terminal_max_session_time
} }
end end
......
...@@ -230,7 +230,7 @@ class Group < Namespace ...@@ -230,7 +230,7 @@ class Group < Namespace
end end
def actual_size_limit def actual_size_limit
return current_application_settings.repository_size_limit if repository_size_limit.nil? return Gitlab::CurrentSettings.repository_size_limit if repository_size_limit.nil?
repository_size_limit repository_size_limit
end end
......
require 'digest/md5' require 'digest/md5'
class Key < ActiveRecord::Base class Key < ActiveRecord::Base
include Gitlab::CurrentSettings
include AfterCommitQueue include AfterCommitQueue
include Sortable include Sortable
...@@ -107,7 +106,7 @@ class Key < ActiveRecord::Base ...@@ -107,7 +106,7 @@ class Key < ActiveRecord::Base
end end
def key_meets_restrictions def key_meets_restrictions
restriction = current_application_settings.key_restriction_for(public_key.type) restriction = Gitlab::CurrentSettings.key_restriction_for(public_key.type)
if restriction == ApplicationSetting::FORBIDDEN_KEY_VALUE if restriction == ApplicationSetting::FORBIDDEN_KEY_VALUE
errors.add(:key, forbidden_key_type_message) errors.add(:key, forbidden_key_type_message)
...@@ -118,7 +117,7 @@ class Key < ActiveRecord::Base ...@@ -118,7 +117,7 @@ class Key < ActiveRecord::Base
def forbidden_key_type_message def forbidden_key_type_message
allowed_types = allowed_types =
current_application_settings Gitlab::CurrentSettings
.allowed_key_types .allowed_key_types
.map(&:upcase) .map(&:upcase)
.to_sentence(last_word_connector: ', or ', two_words_connector: ' or ') .to_sentence(last_word_connector: ', or ', two_words_connector: ' or ')
......
...@@ -3,7 +3,6 @@ class Namespace < ActiveRecord::Base ...@@ -3,7 +3,6 @@ class Namespace < ActiveRecord::Base
include CacheMarkdownField include CacheMarkdownField
include Sortable include Sortable
include Gitlab::ShellAdapter include Gitlab::ShellAdapter
include Gitlab::CurrentSettings
include Gitlab::VisibilityLevel include Gitlab::VisibilityLevel
include Routable include Routable
include AfterCommitQueue include AfterCommitQueue
...@@ -162,7 +161,7 @@ class Namespace < ActiveRecord::Base ...@@ -162,7 +161,7 @@ class Namespace < ActiveRecord::Base
end end
def actual_size_limit def actual_size_limit
current_application_settings.repository_size_limit Gitlab::CurrentSettings.repository_size_limit
end end
def shared_runners_enabled? def shared_runners_enabled?
......
...@@ -5,7 +5,6 @@ class Note < ActiveRecord::Base ...@@ -5,7 +5,6 @@ class Note < ActiveRecord::Base
extend ActiveModel::Naming extend ActiveModel::Naming
prepend EE::Note prepend EE::Note
include Gitlab::CurrentSettings
include Participable include Participable
include Mentionable include Mentionable
include Elastic::NotesSearch include Elastic::NotesSearch
...@@ -204,7 +203,7 @@ class Note < ActiveRecord::Base ...@@ -204,7 +203,7 @@ class Note < ActiveRecord::Base
end end
def max_attachment_size def max_attachment_size
current_application_settings.max_attachment_size.megabytes.to_i Gitlab::CurrentSettings.max_attachment_size.megabytes.to_i
end end
def hook_attrs def hook_attrs
......
...@@ -4,7 +4,6 @@ class Project < ActiveRecord::Base ...@@ -4,7 +4,6 @@ class Project < ActiveRecord::Base
include Gitlab::ConfigHelper include Gitlab::ConfigHelper
include Gitlab::ShellAdapter include Gitlab::ShellAdapter
include Gitlab::VisibilityLevel include Gitlab::VisibilityLevel
include Gitlab::CurrentSettings
include AccessRequestable include AccessRequestable
include Avatarable include Avatarable
include CacheMarkdownField include CacheMarkdownField
...@@ -26,7 +25,6 @@ class Project < ActiveRecord::Base ...@@ -26,7 +25,6 @@ class Project < ActiveRecord::Base
prepend EE::Project prepend EE::Project
extend Gitlab::ConfigHelper extend Gitlab::ConfigHelper
extend Gitlab::CurrentSettings
BoardLimitExceeded = Class.new(StandardError) BoardLimitExceeded = Class.new(StandardError)
...@@ -54,8 +52,8 @@ class Project < ActiveRecord::Base ...@@ -54,8 +52,8 @@ class Project < ActiveRecord::Base
default_value_for :visibility_level, gitlab_config_features.visibility_level default_value_for :visibility_level, gitlab_config_features.visibility_level
default_value_for :resolve_outdated_diff_discussions, false default_value_for :resolve_outdated_diff_discussions, false
default_value_for :container_registry_enabled, gitlab_config_features.container_registry default_value_for :container_registry_enabled, gitlab_config_features.container_registry
default_value_for(:repository_storage) { current_application_settings.pick_repository_storage } default_value_for(:repository_storage) { Gitlab::CurrentSettings.pick_repository_storage }
default_value_for(:shared_runners_enabled) { current_application_settings.shared_runners_enabled } default_value_for(:shared_runners_enabled) { Gitlab::CurrentSettings.shared_runners_enabled }
default_value_for :issues_enabled, gitlab_config_features.issues default_value_for :issues_enabled, gitlab_config_features.issues
default_value_for :merge_requests_enabled, gitlab_config_features.merge_requests default_value_for :merge_requests_enabled, gitlab_config_features.merge_requests
default_value_for :builds_enabled, gitlab_config_features.builds default_value_for :builds_enabled, gitlab_config_features.builds
...@@ -495,14 +493,14 @@ class Project < ActiveRecord::Base ...@@ -495,14 +493,14 @@ class Project < ActiveRecord::Base
def auto_devops_enabled? def auto_devops_enabled?
if auto_devops&.enabled.nil? if auto_devops&.enabled.nil?
current_application_settings.auto_devops_enabled? Gitlab::CurrentSettings.auto_devops_enabled?
else else
auto_devops.enabled? auto_devops.enabled?
end end
end end
def has_auto_devops_implicitly_disabled? def has_auto_devops_implicitly_disabled?
auto_devops&.enabled.nil? && !current_application_settings.auto_devops_enabled? auto_devops&.enabled.nil? && !Gitlab::CurrentSettings.auto_devops_enabled?
end end
def empty_repo? def empty_repo?
...@@ -1483,14 +1481,14 @@ class Project < ActiveRecord::Base ...@@ -1483,14 +1481,14 @@ class Project < ActiveRecord::Base
# Ensure HEAD points to the default branch in case it is not master # Ensure HEAD points to the default branch in case it is not master
change_head(default_branch) change_head(default_branch)
if current_application_settings.default_branch_protection != Gitlab::Access::PROTECTION_NONE && !ProtectedBranch.protected?(self, default_branch) if Gitlab::CurrentSettings.default_branch_protection != Gitlab::Access::PROTECTION_NONE && !ProtectedBranch.protected?(self, default_branch)
params = { params = {
name: default_branch, name: default_branch,
push_access_levels_attributes: [{ push_access_levels_attributes: [{
access_level: current_application_settings.default_branch_protection == Gitlab::Access::PROTECTION_DEV_CAN_PUSH ? Gitlab::Access::DEVELOPER : Gitlab::Access::MASTER access_level: Gitlab::CurrentSettings.default_branch_protection == Gitlab::Access::PROTECTION_DEV_CAN_PUSH ? Gitlab::Access::DEVELOPER : Gitlab::Access::MASTER
}], }],
merge_access_levels_attributes: [{ merge_access_levels_attributes: [{
access_level: current_application_settings.default_branch_protection == Gitlab::Access::PROTECTION_DEV_CAN_MERGE ? Gitlab::Access::DEVELOPER : Gitlab::Access::MASTER access_level: Gitlab::CurrentSettings.default_branch_protection == Gitlab::Access::PROTECTION_DEV_CAN_MERGE ? Gitlab::Access::DEVELOPER : Gitlab::Access::MASTER
}] }]
} }
...@@ -1779,7 +1777,7 @@ class Project < ActiveRecord::Base ...@@ -1779,7 +1777,7 @@ class Project < ActiveRecord::Base
end end
def use_hashed_storage def use_hashed_storage
if self.new_record? && current_application_settings.hashed_storage_enabled if self.new_record? && Gitlab::CurrentSettings.hashed_storage_enabled
self.storage_version = LATEST_STORAGE_VERSION self.storage_version = LATEST_STORAGE_VERSION
end end
end end
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
# After we've migrated data, we'll remove KubernetesService. This would happen in a few months. # After we've migrated data, we'll remove KubernetesService. This would happen in a few months.
# If you're modyfiyng this class, please note that you should update the same change in Clusters::Platforms::Kubernetes. # If you're modyfiyng this class, please note that you should update the same change in Clusters::Platforms::Kubernetes.
class KubernetesService < DeploymentService class KubernetesService < DeploymentService
include Gitlab::CurrentSettings
include Gitlab::Kubernetes include Gitlab::Kubernetes
include ReactiveCaching include ReactiveCaching
...@@ -233,7 +232,7 @@ class KubernetesService < DeploymentService ...@@ -233,7 +232,7 @@ class KubernetesService < DeploymentService
{ {
token: token, token: token,
ca_pem: ca_pem, ca_pem: ca_pem,
max_session_time: current_application_settings.terminal_max_session_time max_session_time: Gitlab::CurrentSettings.terminal_max_session_time
} }
end end
......
...@@ -4,7 +4,6 @@ class ProjectWiki ...@@ -4,7 +4,6 @@ class ProjectWiki
# EE only modules # EE only modules
include Elastic::WikiRepositoriesSearch include Elastic::WikiRepositoriesSearch
include Gitlab::CurrentSettings
MARKUPS = { MARKUPS = {
'Markdown' => :markdown, 'Markdown' => :markdown,
...@@ -204,7 +203,7 @@ class ProjectWiki ...@@ -204,7 +203,7 @@ class ProjectWiki
# EE only # EE only
def update_elastic_index def update_elastic_index
index_blobs if current_application_settings.elasticsearch_indexing? index_blobs if Gitlab::CurrentSettings.elasticsearch_indexing?
end end
def path_to_repo def path_to_repo
......
...@@ -3,8 +3,6 @@ class ProtectedBranch < ActiveRecord::Base ...@@ -3,8 +3,6 @@ class ProtectedBranch < ActiveRecord::Base
include ProtectedRef include ProtectedRef
prepend EE::ProtectedRef prepend EE::ProtectedRef
extend Gitlab::CurrentSettings
protected_ref_access_levels :merge, :push protected_ref_access_levels :merge, :push
# Check if branch name is marked as protected in the system # Check if branch name is marked as protected in the system
...@@ -17,7 +15,7 @@ class ProtectedBranch < ActiveRecord::Base ...@@ -17,7 +15,7 @@ class ProtectedBranch < ActiveRecord::Base
end end
def self.default_branch_protected? def self.default_branch_protected?
current_application_settings.default_branch_protection == Gitlab::Access::PROTECTION_FULL || Gitlab::CurrentSettings.default_branch_protection == Gitlab::Access::PROTECTION_FULL ||
current_application_settings.default_branch_protection == Gitlab::Access::PROTECTION_DEV_CAN_MERGE Gitlab::CurrentSettings.default_branch_protection == Gitlab::Access::PROTECTION_DEV_CAN_MERGE
end end
end end
...@@ -12,8 +12,6 @@ class Snippet < ActiveRecord::Base ...@@ -12,8 +12,6 @@ class Snippet < ActiveRecord::Base
include Editable include Editable
include Gitlab::SQL::Pattern include Gitlab::SQL::Pattern
extend Gitlab::CurrentSettings
cache_markdown_field :title, pipeline: :single_line cache_markdown_field :title, pipeline: :single_line
cache_markdown_field :description cache_markdown_field :description
cache_markdown_field :content cache_markdown_field :content
...@@ -29,7 +27,7 @@ class Snippet < ActiveRecord::Base ...@@ -29,7 +27,7 @@ class Snippet < ActiveRecord::Base
default_content_html_invalidator || file_name_changed? default_content_html_invalidator || file_name_changed?
end end
default_value_for(:visibility_level) { current_application_settings.default_snippet_visibility } default_value_for(:visibility_level) { Gitlab::CurrentSettings.default_snippet_visibility }
belongs_to :author, class_name: 'User' belongs_to :author, class_name: 'User'
belongs_to :project belongs_to :project
......
...@@ -2,10 +2,8 @@ require 'carrierwave/orm/activerecord' ...@@ -2,10 +2,8 @@ require 'carrierwave/orm/activerecord'
class User < ActiveRecord::Base class User < ActiveRecord::Base
extend Gitlab::ConfigHelper extend Gitlab::ConfigHelper
extend Gitlab::CurrentSettings
include Gitlab::ConfigHelper include Gitlab::ConfigHelper
include Gitlab::CurrentSettings
include Gitlab::SQL::Pattern include Gitlab::SQL::Pattern
include AfterCommitQueue include AfterCommitQueue
include Avatarable include Avatarable
...@@ -32,7 +30,7 @@ class User < ActiveRecord::Base ...@@ -32,7 +30,7 @@ class User < ActiveRecord::Base
add_authentication_token_field :rss_token add_authentication_token_field :rss_token
default_value_for :admin, false default_value_for :admin, false
default_value_for(:external) { current_application_settings.user_default_external } default_value_for(:external) { Gitlab::CurrentSettings.user_default_external }
default_value_for :can_create_group, gitlab_config.default_can_create_group default_value_for :can_create_group, gitlab_config.default_can_create_group
default_value_for :can_create_team, false default_value_for :can_create_team, false
default_value_for :hide_no_ssh_key, false default_value_for :hide_no_ssh_key, false
...@@ -678,11 +676,11 @@ class User < ActiveRecord::Base ...@@ -678,11 +676,11 @@ class User < ActiveRecord::Base
end end
def allow_password_authentication_for_web? def allow_password_authentication_for_web?
current_application_settings.password_authentication_enabled_for_web? && !ldap_user? Gitlab::CurrentSettings.password_authentication_enabled_for_web? && !ldap_user?
end end
def allow_password_authentication_for_git? def allow_password_authentication_for_git?
current_application_settings.password_authentication_enabled_for_git? && !ldap_user? Gitlab::CurrentSettings.password_authentication_enabled_for_git? && !ldap_user?
end end
def can_change_username? def can_change_username?
...@@ -810,7 +808,7 @@ class User < ActiveRecord::Base ...@@ -810,7 +808,7 @@ class User < ActiveRecord::Base
# without this safeguard! # without this safeguard!
return unless has_attribute?(:projects_limit) && projects_limit.nil? return unless has_attribute?(:projects_limit) && projects_limit.nil?
self.projects_limit = current_application_settings.default_projects_limit self.projects_limit = Gitlab::CurrentSettings.default_projects_limit
end end
def requires_ldap_check? def requires_ldap_check?
...@@ -1237,7 +1235,7 @@ class User < ActiveRecord::Base ...@@ -1237,7 +1235,7 @@ class User < ActiveRecord::Base
else else
# Only revert these back to the default if they weren't specifically changed in this update. # Only revert these back to the default if they weren't specifically changed in this update.
self.can_create_group = gitlab_config.default_can_create_group unless can_create_group_changed? self.can_create_group = gitlab_config.default_can_create_group unless can_create_group_changed?
self.projects_limit = current_application_settings.default_projects_limit unless projects_limit_changed? self.projects_limit = Gitlab::CurrentSettings.default_projects_limit unless projects_limit_changed?
end end
end end
...@@ -1245,15 +1243,15 @@ class User < ActiveRecord::Base ...@@ -1245,15 +1243,15 @@ class User < ActiveRecord::Base
valid = true valid = true
error = nil error = nil
if current_application_settings.domain_blacklist_enabled? if Gitlab::CurrentSettings.domain_blacklist_enabled?
blocked_domains = current_application_settings.domain_blacklist blocked_domains = Gitlab::CurrentSettings.domain_blacklist
if domain_matches?(blocked_domains, email) if domain_matches?(blocked_domains, email)
error = 'is not from an allowed domain.' error = 'is not from an allowed domain.'
valid = false valid = false
end end
end end
allowed_domains = current_application_settings.domain_whitelist allowed_domains = Gitlab::CurrentSettings.domain_whitelist
unless allowed_domains.blank? unless allowed_domains.blank?
if domain_matches?(allowed_domains, email) if domain_matches?(allowed_domains, email)
valid = true valid = true
......
class AkismetService class AkismetService
include Gitlab::CurrentSettings
attr_accessor :owner, :text, :options attr_accessor :owner, :text, :options
def initialize(owner, text, options = {}) def initialize(owner, text, options = {})
...@@ -41,12 +39,12 @@ class AkismetService ...@@ -41,12 +39,12 @@ class AkismetService
private private
def akismet_client def akismet_client
@akismet_client ||= ::Akismet::Client.new(current_application_settings.akismet_api_key, @akismet_client ||= ::Akismet::Client.new(Gitlab::CurrentSettings.akismet_api_key,
Gitlab.config.gitlab.url) Gitlab.config.gitlab.url)
end end
def akismet_enabled? def akismet_enabled?
current_application_settings.akismet_enabled Gitlab::CurrentSettings.akismet_enabled
end end
def submit(type) def submit(type)
......
module Auth module Auth
class ContainerRegistryAuthenticationService < BaseService class ContainerRegistryAuthenticationService < BaseService
extend Gitlab::CurrentSettings
AUDIENCE = 'container_registry'.freeze AUDIENCE = 'container_registry'.freeze
def execute(authentication_abilities:) def execute(authentication_abilities:)
...@@ -32,7 +30,7 @@ module Auth ...@@ -32,7 +30,7 @@ module Auth
end end
def self.token_expire_at def self.token_expire_at
Time.now + current_application_settings.container_registry_token_expire_delay.minutes Time.now + Gitlab::CurrentSettings.container_registry_token_expire_delay.minutes
end end
private private
......
class BaseService class BaseService
include Gitlab::Allowable include Gitlab::Allowable
include Gitlab::CurrentSettings
attr_accessor :project, :current_user, :params attr_accessor :project, :current_user, :params
......
...@@ -2,7 +2,6 @@ module Ci ...@@ -2,7 +2,6 @@ module Ci
# This class responsible for assigning # This class responsible for assigning
# proper pending build to runner on runner API request # proper pending build to runner on runner API request
class RegisterJobService class RegisterJobService
include Gitlab::CurrentSettings
prepend EE::Ci::RegisterJobService prepend EE::Ci::RegisterJobService
attr_reader :runner attr_reader :runner
......
class GitPushService < BaseService class GitPushService < BaseService
attr_accessor :push_data, :push_commits attr_accessor :push_data, :push_commits
include Gitlab::CurrentSettings
include Gitlab::Access include Gitlab::Access
# The N most recent commits to process in a single push payload. # The N most recent commits to process in a single push payload.
...@@ -53,7 +52,7 @@ class GitPushService < BaseService ...@@ -53,7 +52,7 @@ class GitPushService < BaseService
update_gitattributes if default_branch? update_gitattributes if default_branch?
end end
if current_application_settings.elasticsearch_indexing? && default_branch? if Gitlab::CurrentSettings.elasticsearch_indexing? && default_branch?
ElasticCommitIndexerWorker.perform_async(@project.id, params[:oldrev], params[:newrev]) ElasticCommitIndexerWorker.perform_async(@project.id, params[:oldrev], params[:newrev])
end end
......
class GravatarService class GravatarService
include Gitlab::CurrentSettings
def execute(email, size = nil, scale = 2, username: nil) def execute(email, size = nil, scale = 2, username: nil)
return unless current_application_settings.gravatar_enabled? return unless Gitlab::CurrentSettings.gravatar_enabled?
identifier = email.presence || username.presence identifier = email.presence || username.presence
return unless identifier return unless identifier
......
...@@ -7,8 +7,6 @@ ...@@ -7,8 +7,6 @@
# #
module Projects module Projects
class HousekeepingService < BaseService class HousekeepingService < BaseService
include Gitlab::CurrentSettings
# Timeout set to 24h # Timeout set to 24h
LEASE_TIMEOUT = 86400 LEASE_TIMEOUT = 86400
...@@ -83,19 +81,19 @@ module Projects ...@@ -83,19 +81,19 @@ module Projects
end end
def housekeeping_enabled? def housekeeping_enabled?
current_application_settings.housekeeping_enabled Gitlab::CurrentSettings.housekeeping_enabled
end end
def gc_period def gc_period
current_application_settings.housekeeping_gc_period Gitlab::CurrentSettings.housekeeping_gc_period
end end
def full_repack_period def full_repack_period
current_application_settings.housekeeping_full_repack_period Gitlab::CurrentSettings.housekeeping_full_repack_period
end end
def repack_period def repack_period
current_application_settings.housekeeping_incremental_repack_period Gitlab::CurrentSettings.housekeeping_incremental_repack_period
end end
end end
end end
module Projects module Projects
class UpdatePagesService < BaseService class UpdatePagesService < BaseService
include Gitlab::CurrentSettings
BLOCK_SIZE = 32.kilobytes BLOCK_SIZE = 32.kilobytes
MAX_SIZE = 1.terabyte MAX_SIZE = 1.terabyte
SITE_PATH = 'public/'.freeze SITE_PATH = 'public/'.freeze
...@@ -142,7 +140,7 @@ module Projects ...@@ -142,7 +140,7 @@ module Projects
end end
def max_size def max_size
max_pages_size = current_application_settings.max_pages_size.megabytes max_pages_size = Gitlab::CurrentSettings.max_pages_size.megabytes
return MAX_SIZE if max_pages_size.zero? return MAX_SIZE if max_pages_size.zero?
......
...@@ -44,7 +44,7 @@ module Projects ...@@ -44,7 +44,7 @@ module Projects
def run_auto_devops_pipeline? def run_auto_devops_pipeline?
return false if project.repository.gitlab_ci_yml || !project.auto_devops.previous_changes.include?('enabled') return false if project.repository.gitlab_ci_yml || !project.auto_devops.previous_changes.include?('enabled')
project.auto_devops.enabled? || (project.auto_devops.enabled.nil? && current_application_settings.auto_devops_enabled?) project.auto_devops.enabled? || (project.auto_devops.enabled.nil? && Gitlab::CurrentSettings.auto_devops_enabled?)
end end
private private
......
module Search module Search
class GlobalService class GlobalService
include Gitlab::CurrentSettings
attr_accessor :current_user, :params attr_accessor :current_user, :params
attr_reader :default_project_filter attr_reader :default_project_filter
...@@ -11,7 +9,7 @@ module Search ...@@ -11,7 +9,7 @@ module Search
end end
def execute def execute
if current_application_settings.elasticsearch_search? if Gitlab::CurrentSettings.elasticsearch_search?
Gitlab::Elastic::SearchResults.new(current_user, params[:search], elastic_projects, elastic_global) Gitlab::Elastic::SearchResults.new(current_user, params[:search], elastic_projects, elastic_global)
else else
Gitlab::SearchResults.new(current_user, projects, params[:search], Gitlab::SearchResults.new(current_user, projects, params[:search],
...@@ -41,7 +39,7 @@ module Search ...@@ -41,7 +39,7 @@ module Search
def scope def scope
@scope ||= begin @scope ||= begin
allowed_scopes = %w[issues merge_requests milestones] allowed_scopes = %w[issues merge_requests milestones]
allowed_scopes += %w[wiki_blobs blobs commits] if current_application_settings.elasticsearch_search? allowed_scopes += %w[wiki_blobs blobs commits] if Gitlab::CurrentSettings.elasticsearch_search?
allowed_scopes.delete(params[:scope]) { 'projects' } allowed_scopes.delete(params[:scope]) { 'projects' }
end end
......
module Search module Search
class ProjectService class ProjectService
include Gitlab::CurrentSettings
attr_accessor :project, :current_user, :params attr_accessor :project, :current_user, :params
def initialize(project, user, params) def initialize(project, user, params)
...@@ -9,7 +7,7 @@ module Search ...@@ -9,7 +7,7 @@ module Search
end end
def execute def execute
if current_application_settings.elasticsearch_search? if Gitlab::CurrentSettings.elasticsearch_search?
Gitlab::Elastic::ProjectSearchResults.new(current_user, Gitlab::Elastic::ProjectSearchResults.new(current_user,
params[:search], params[:search],
project.id, project.id,
......
...@@ -11,10 +11,8 @@ class SubmitUsagePingService ...@@ -11,10 +11,8 @@ class SubmitUsagePingService
percentage_projects_prometheus_active leader_service_desk_issues instance_service_desk_issues percentage_projects_prometheus_active leader_service_desk_issues instance_service_desk_issues
percentage_service_desk_issues].freeze percentage_service_desk_issues].freeze
include Gitlab::CurrentSettings
def execute def execute
return false unless current_application_settings.usage_ping_enabled? return false unless Gitlab::CurrentSettings.usage_ping_enabled?
response = HTTParty.post( response = HTTParty.post(
URL, URL,
......
class UploadService class UploadService
include Gitlab::CurrentSettings
def initialize(model, file, uploader_class = FileUploader) def initialize(model, file, uploader_class = FileUploader)
@model, @file, @uploader_class = model, file, uploader_class @model, @file, @uploader_class = model, file, uploader_class
end end
...@@ -17,6 +15,6 @@ class UploadService ...@@ -17,6 +15,6 @@ class UploadService
private private
def max_attachment_size def max_attachment_size
current_application_settings.max_attachment_size.megabytes.to_i Gitlab::CurrentSettings.max_attachment_size.megabytes.to_i
end end
end end
module Users module Users
class BuildService < BaseService class BuildService < BaseService
prepend ::EE::Users::BuildService prepend ::EE::Users::BuildService
include Gitlab::CurrentSettings
def initialize(current_user, params = {}) def initialize(current_user, params = {})
@current_user = current_user @current_user = current_user
...@@ -35,7 +34,7 @@ module Users ...@@ -35,7 +34,7 @@ module Users
private private
def can_create_user? def can_create_user?
(current_user.nil? && current_application_settings.allow_signup?) || current_user&.admin? (current_user.nil? && Gitlab::CurrentSettings.allow_signup?) || current_user&.admin?
end end
# Allowed params for creating a user (admins only) # Allowed params for creating a user (admins only)
...@@ -103,7 +102,7 @@ module Users ...@@ -103,7 +102,7 @@ module Users
end end
def skip_user_confirmation_email_from_setting def skip_user_confirmation_email_from_setting
!current_application_settings.send_user_confirmation_email !Gitlab::CurrentSettings.send_user_confirmation_email
end end
end end
end end
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
= render 'callout' = render 'callout'
.prepend-top-default .prepend-top-default
- if !current_application_settings.usage_ping_enabled - if !Gitlab::CurrentSettings.usage_ping_enabled
= render 'disabled' = render 'disabled'
- elsif @metric.blank? - elsif @metric.blank?
= render 'no_data' = render 'no_data'
......
...@@ -102,10 +102,10 @@ ...@@ -102,10 +102,10 @@
= boolean_to_icon Gitlab::IncomingEmail.enabled? = boolean_to_icon Gitlab::IncomingEmail.enabled?
- elastic = "Elasticsearch" - elastic = "Elasticsearch"
%p{ "aria-label" => "#{elastic}: status " + (current_application_settings.elasticsearch_search? ? "on" : "off") } %p{ "aria-label" => "#{elastic}: status " + (Gitlab::CurrentSettings.elasticsearch_search? ? "on" : "off") }
= elastic = elastic
%span.light.pull-right %span.light.pull-right
= boolean_to_icon current_application_settings.elasticsearch_search? = boolean_to_icon Gitlab::CurrentSettings.elasticsearch_search?
- geo = link_to 'Geo', admin_geo_nodes_path - geo = link_to 'Geo', admin_geo_nodes_path
%p{ "aria-label" => "#{geo}: status " + (Gitlab::Geo.enabled? ? "on" : "off") } %p{ "aria-label" => "#{geo}: status " + (Gitlab::Geo.enabled? ? "on" : "off") }
= geo = geo
...@@ -134,7 +134,7 @@ ...@@ -134,7 +134,7 @@
.well-segment.admin-well .well-segment.admin-well
%h4 %h4
Components Components
- if current_application_settings.version_check_enabled - if Gitlab::CurrentSettings.version_check_enabled
.pull-right .pull-right
= version_status_badge = version_status_badge
%p %p
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
= render 'shared/repository_size_limit_setting', form: f, type: :group = render 'shared/repository_size_limit_setting', form: f, type: :group
- if current_application_settings.should_check_namespace_plan? - if Gitlab::CurrentSettings.should_check_namespace_plan?
= render 'admin/namespace_plan', f: f = render 'admin/namespace_plan', f: f
.form-group.group-description-holder .form-group.group-description-holder
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
.pull-left .pull-left
%p %p
#{ s_('HealthCheck|Access token is') } #{ s_('HealthCheck|Access token is') }
%code#health-check-token= current_application_settings.health_check_access_token %code#health-check-token= Gitlab::CurrentSettings.health_check_access_token
.prepend-top-10 .prepend-top-10
= button_to _("Reset health check access token"), reset_health_check_token_admin_application_settings_path, = button_to _("Reset health check access token"), reset_health_check_token_admin_application_settings_path,
method: :put, class: 'btn btn-default', method: :put, class: 'btn btn-default',
...@@ -18,14 +18,14 @@ ...@@ -18,14 +18,14 @@
= link_to s_('More information is available|here'), help_page_path('user/admin_area/monitoring/health_check') = link_to s_('More information is available|here'), help_page_path('user/admin_area/monitoring/health_check')
%ul %ul
%li %li
%code= readiness_url(token: current_application_settings.health_check_access_token) %code= readiness_url(token: Gitlab::CurrentSettings.health_check_access_token)
%li %li
%code= liveness_url(token: current_application_settings.health_check_access_token) %code= liveness_url(token: Gitlab::CurrentSettings.health_check_access_token)
%li %li
%code= metrics_url(token: current_application_settings.health_check_access_token) %code= metrics_url(token: Gitlab::CurrentSettings.health_check_access_token)
- if Gitlab::Geo.secondary? - if Gitlab::Geo.secondary?
%li %li
%code= health_check_url(token: current_application_settings.health_check_access_token, checks: :geo) %code= health_check_url(token: Gitlab::CurrentSettings.health_check_access_token, checks: :geo)
%hr %hr
.panel.panel-default .panel.panel-default
.panel-heading .panel-heading
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
data: { confirm: _("Are you sure you want to reset registration token?") } data: { confirm: _("Are you sure you want to reset registration token?") }
= render partial: 'ci/runner/how_to_setup_runner', = render partial: 'ci/runner/how_to_setup_runner',
locals: { registration_token: current_application_settings.runners_registration_token, locals: { registration_token: Gitlab::CurrentSettings.runners_registration_token,
type: 'shared' } type: 'shared' }
.append-bottom-20.clearfix .append-bottom-20.clearfix
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
= render partial: 'access_levels', locals: { f: f } = render partial: 'access_levels', locals: { f: f }
- if current_application_settings.should_check_namespace_plan? - if Gitlab::CurrentSettings.should_check_namespace_plan?
= f.fields_for :namespace do |namespace_form| = f.fields_for :namespace do |namespace_form|
%fieldset %fieldset
%legend Licensed Features %legend Licensed Features
......
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
%p.lead.append-bottom-20 %p.lead.append-bottom-20
Please check your email to confirm your account Please check your email to confirm your account
%hr %hr
- if current_application_settings.after_sign_up_text.present? - if Gitlab::CurrentSettings.after_sign_up_text.present?
.well-confirmation.text-center .well-confirmation.text-center
= markdown_field(current_application_settings, :after_sign_up_text) = markdown_field(Gitlab::CurrentSettings, :after_sign_up_text)
%p.text-center %p.text-center
No confirmation email received? Please check your spam folder or No confirmation email received? Please check your spam folder or
.append-bottom-20.prepend-top-20.text-center .append-bottom-20.prepend-top-20.text-center
......
= webpack_bundle_tag 'docs' = webpack_bundle_tag 'docs'
%div %div
- if current_application_settings.help_page_text.present? - if Gitlab::CurrentSettings.help_page_text.present?
= markdown(current_application_settings.help_page_text) = markdown(Gitlab::CurrentSettings.help_page_text)
%hr %hr
%h1 %h1
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
= version_status_badge = version_status_badge
%hr %hr
- unless current_application_settings.help_page_hide_commercial_content? - unless Gitlab::CurrentSettings.help_page_hide_commercial_content?
%p.slead %p.slead
GitLab is open source software to collaborate on code. GitLab is open source software to collaborate on code.
%br %br
...@@ -46,6 +46,6 @@ ...@@ -46,6 +46,6 @@
%li %li
%button.btn-blank.btn-link.js-trigger-shortcut{ type: 'button' } %button.btn-blank.btn-link.js-trigger-shortcut{ type: 'button' }
Use shortcuts Use shortcuts
- unless current_application_settings.help_page_hide_commercial_content? - unless Gitlab::CurrentSettings.help_page_hide_commercial_content?
%li= link_to 'Get a support subscription', 'https://about.gitlab.com/pricing/' %li= link_to 'Get a support subscription', 'https://about.gitlab.com/pricing/'
%li= link_to 'Compare GitLab editions', 'https://about.gitlab.com/features/#compare' %li= link_to 'Compare GitLab editions', 'https://about.gitlab.com/features/#compare'
...@@ -3,4 +3,4 @@ ...@@ -3,4 +3,4 @@
= icon('circle', class: 'cgreen') = icon('circle', class: 'cgreen')
Integration is active for Integration is active for
= link_to koding_project_url, target: '_blank', rel: 'noopener noreferrer' do = link_to koding_project_url, target: '_blank', rel: 'noopener noreferrer' do
#{current_application_settings.koding_url} #{Gitlab::CurrentSettings.koding_url}
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
= webpack_bundle_tag "webpack_runtime" = webpack_bundle_tag "webpack_runtime"
= webpack_bundle_tag "common" = webpack_bundle_tag "common"
= webpack_bundle_tag "main" = webpack_bundle_tag "main"
= webpack_bundle_tag "raven" if current_application_settings.clientside_sentry_enabled = webpack_bundle_tag "raven" if Gitlab::CurrentSettings.clientside_sentry_enabled
= webpack_bundle_tag "test" if Rails.env.test? = webpack_bundle_tag "test" if Rails.env.test?
- if content_for?(:page_specific_javascripts) - if content_for?(:page_specific_javascripts)
......
...@@ -26,13 +26,13 @@ ...@@ -26,13 +26,13 @@
Perform code reviews and enhance collaboration with merge requests. Perform code reviews and enhance collaboration with merge requests.
Each project can also have an issue tracker and a wiki. Each project can also have an issue tracker and a wiki.
- if current_application_settings.sign_in_text.present? - if Gitlab::CurrentSettings.sign_in_text.present?
= markdown_field(current_application_settings, :sign_in_text) = markdown_field(Gitlab::CurrentSettings.current_application_settings, :sign_in_text)
- if current_application_settings.help_text.present? - if Gitlab::CurrentSettings.help_text.present?
%h3 Need help? %h3 Need help?
%hr %hr
%p.slead %p.slead
= markdown(current_application_settings.help_text) = markdown(Gitlab::CurrentSettings.help_text)
%hr.footer-fixed %hr.footer-fixed
.container.footer-container .container.footer-container
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
= link_to profile_account_path do = link_to profile_account_path do
%strong.fly-out-top-item-name %strong.fly-out-top-item-name
#{ _('Account') } #{ _('Account') }
- if current_application_settings.should_check_namespace_plan? - if Gitlab::CurrentSettings.should_check_namespace_plan?
= nav_link(controller: :billings) do = nav_link(controller: :billings) do
= link_to profile_billings_path do = link_to profile_billings_path do
.nav-icon-container .nav-icon-container
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
= link_to profile_billings_path do = link_to profile_billings_path do
%strong.fly-out-top-item-name %strong.fly-out-top-item-name
#{ _('Billing') } #{ _('Billing') }
- if current_application_settings.user_oauth_applications? - if Gitlab::CurrentSettings.user_oauth_applications?
= nav_link(controller: 'oauth/applications') do = nav_link(controller: 'oauth/applications') do
= link_to applications_profile_path do = link_to applications_profile_path do
.nav-icon-container .nav-icon-container
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
- else - else
commented on a #{link_to 'discussion', @target_url} commented on a #{link_to 'discussion', @target_url}
- elsif current_application_settings.email_author_in_body - elsif Gitlab::CurrentSettings.email_author_in_body
%p.details %p.details
#{link_to @note.author_name, user_url(@note.author)} commented: #{link_to @note.author_name, user_url(@note.author)} commented:
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<%= ":" -%> <%= ":" -%>
<% elsif current_application_settings.email_author_in_body -%> <% elsif Gitlab::CurrentSettings.email_author_in_body -%>
<%= "#{@note.author_name} commented:" -%> <%= "#{@note.author_name} commented:" -%>
......
- if current_application_settings.email_author_in_body - if Gitlab::CurrentSettings.email_author_in_body
%p.details %p.details
#{link_to @issue.author_name, user_url(@issue.author)} created an issue: #{link_to @issue.author_name, user_url(@issue.author)} created an issue:
......
- if current_application_settings.email_author_in_body - if Gitlab::CurrentSettings.email_author_in_body
%p.details %p.details
#{link_to @merge_request.author_name, user_url(@merge_request.author)} created a merge request: #{link_to @merge_request.author_name, user_url(@merge_request.author)} created a merge request:
......
%p %p
Hi #{@user['name']}! Hi #{@user['name']}!
%p %p
- if current_application_settings.allow_signup? - if Gitlab::CurrentSettings.allow_signup?
Your account has been created successfully. Your account has been created successfully.
- else - else
The Administrator created an account for you. Now you are a member of the company GitLab application. The Administrator created an account for you. Now you are a member of the company GitLab application.
......
- return unless current_application_settings.project_export_enabled? - return unless Gitlab::CurrentSettings.project_export_enabled?
- project = local_assigns.fetch(:project) - project = local_assigns.fetch(:project)
- expanded = Rails.env.test? - expanded = Rails.env.test?
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
- link = commit_path(project, commit, merge_request: merge_request) - link = commit_path(project, commit, merge_request: merge_request)
- cache_key = [project.full_path, - cache_key = [project.full_path,
commit.id, commit.id,
current_application_settings, Gitlab::CurrentSettings.current_application_settings,
@path.presence, @path.presence,
current_controller?(:commits), current_controller?(:commits),
merge_request&.iid, merge_request&.iid,
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
.radio .radio
= form.label :enabled_ do = form.label :enabled_ do
= form.radio_button :enabled, '' = form.radio_button :enabled, ''
%strong Instance default (#{current_application_settings.auto_devops_enabled? ? 'enabled' : 'disabled'}) %strong Instance default (#{Gitlab::CurrentSettings.auto_devops_enabled? ? 'enabled' : 'disabled'})
%br %br
%span.descr %span.descr
Follow the instance default to either have Auto DevOps enabled or disabled when there is no project specific <code>.gitlab-ci.yml</code>. Follow the instance default to either have Auto DevOps enabled or disabled when there is no project specific <code>.gitlab-ci.yml</code>.
......
%h3 Shared Runners %h3 Shared Runners
.bs-callout.bs-callout-warning.shared-runners-description .bs-callout.bs-callout-warning.shared-runners-description
- if current_application_settings.shared_runners_text.present? - if Gitlab::CurrentSettings.shared_runners_text.present?
= markdown_field(current_application_settings, :shared_runners_text) = markdown_field(Gitlab::CurrentSettings.current_application_settings, :shared_runners_text)
- else - else
GitLab Shared Runners execute code of different projects on the same Runner GitLab Shared Runners execute code of different projects on the same Runner
unless you configure GitLab Runner Autoscale with MaxBuilds 1 (which it is unless you configure GitLab Runner Autoscale with MaxBuilds 1 (which it is
......
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
Milestones Milestones
%span.badge %span.badge
= limited_count(@search_results.limited_milestones_count) = limited_count(@search_results.limited_milestones_count)
- if current_application_settings.elasticsearch_search? - if Gitlab::CurrentSettings.elasticsearch_search?
%li{ class: active_when(@scope == 'blobs') } %li{ class: active_when(@scope == 'blobs') }
= link_to search_filter_path(scope: 'blobs') do = link_to search_filter_path(scope: 'blobs') do
Code Code
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
- unless params[:snippets].eql? 'true' - unless params[:snippets].eql? 'true'
= render 'filter' = render 'filter'
= button_tag "Search", class: "btn btn-success btn-search" = button_tag "Search", class: "btn btn-success btn-search"
- if current_application_settings.elasticsearch_search? - if Gitlab::CurrentSettings.elasticsearch_search?
.help-block .help-block
= link_to 'Advanced search functionality', help_page_path('user/search/advanced_search_syntax.md'), target: '_blank' = link_to 'Advanced search functionality', help_page_path('user/search/advanced_search_syntax.md'), target: '_blank'
is enabled. is enabled.
class GitGarbageCollectWorker class GitGarbageCollectWorker
include ApplicationWorker include ApplicationWorker
include Gitlab::CurrentSettings
sidekiq_options retry: false sidekiq_options retry: false
...@@ -102,7 +101,7 @@ class GitGarbageCollectWorker ...@@ -102,7 +101,7 @@ class GitGarbageCollectWorker
end end
def bitmaps_enabled? def bitmaps_enabled?
current_application_settings.housekeeping_bitmaps_enabled Gitlab::CurrentSettings.housekeeping_bitmaps_enabled
end end
def git(write_bitmaps:) def git(write_bitmaps:)
......
...@@ -13,8 +13,6 @@ module Elasticsearch ...@@ -13,8 +13,6 @@ module Elasticsearch
cattr_accessor :cached_config cattr_accessor :cached_config
module ClassMethods module ClassMethods
include Gitlab::CurrentSettings
# Override the default ::Elasticsearch::Model::Client implementation to # Override the default ::Elasticsearch::Model::Client implementation to
# return a client configured from application settings. All including # return a client configured from application settings. All including
# classes will use the same instance, which is refreshed automatically # classes will use the same instance, which is refreshed automatically
...@@ -28,7 +26,7 @@ module Elasticsearch ...@@ -28,7 +26,7 @@ module Elasticsearch
store = ::Elasticsearch::Model::Client store = ::Elasticsearch::Model::Client
store::CLIENT_MUTEX.synchronize do store::CLIENT_MUTEX.synchronize do
config = current_application_settings.elasticsearch_config config = Gitlab::CurrentSettings.elasticsearch_config
if store.cached_client.nil? || config != store.cached_config if store.cached_client.nil? || config != store.cached_config
store.cached_client = ::Gitlab::Elastic::Client.build(config) store.cached_client = ::Gitlab::Elastic::Client.build(config)
......
...@@ -11,7 +11,7 @@ class Profiles::SlacksController < Profiles::ApplicationController ...@@ -11,7 +11,7 @@ class Profiles::SlacksController < Profiles::ApplicationController
def slack_link def slack_link
project = disabled_projects.find(params[:project_id]) project = disabled_projects.find(params[:project_id])
link = add_to_slack_link(project, current_application_settings.slack_app_id) link = add_to_slack_link(project, Gitlab::CurrentSettings.slack_app_id)
render json: { add_to_slack_link: link } render json: { add_to_slack_link: link }
end end
......
...@@ -101,7 +101,7 @@ module LicenseHelper ...@@ -101,7 +101,7 @@ module LicenseHelper
end end
def show_advanced_search_promotion? def show_advanced_search_promotion?
!current_application_settings.should_check_namespace_plan? && show_promotions? && show_callout?('promote_advanced_search_dismissed') && !License.feature_available?(:elastic_search) !Gitlab::CurrentSettings.should_check_namespace_plan? && show_promotions? && show_callout?('promote_advanced_search_dismissed') && !License.feature_available?(:elastic_search)
end end
extend self extend self
......
...@@ -4,7 +4,6 @@ module Elastic ...@@ -4,7 +4,6 @@ module Elastic
included do included do
include Elasticsearch::Model include Elasticsearch::Model
include Gitlab::CurrentSettings
index_name [Rails.application.class.parent_name.downcase, Rails.env].join('-') index_name [Rails.application.class.parent_name.downcase, Rails.env].join('-')
...@@ -39,13 +38,13 @@ module Elastic ...@@ -39,13 +38,13 @@ module Elastic
} }
after_commit on: :create do after_commit on: :create do
if current_application_settings.elasticsearch_indexing? && self.searchable? if Gitlab::CurrentSettings.elasticsearch_indexing? && self.searchable?
ElasticIndexerWorker.perform_async(:index, self.class.to_s, self.id) ElasticIndexerWorker.perform_async(:index, self.class.to_s, self.id)
end end
end end
after_commit on: :update do after_commit on: :update do
if current_application_settings.elasticsearch_indexing? && self.searchable? if Gitlab::CurrentSettings.elasticsearch_indexing? && self.searchable?
ElasticIndexerWorker.perform_async( ElasticIndexerWorker.perform_async(
:update, :update,
self.class.to_s, self.class.to_s,
...@@ -56,7 +55,7 @@ module Elastic ...@@ -56,7 +55,7 @@ module Elastic
end end
after_commit on: :destroy do after_commit on: :destroy do
if current_application_settings.elasticsearch_indexing? && self.searchable? if Gitlab::CurrentSettings.elasticsearch_indexing? && self.searchable?
ElasticIndexerWorker.perform_async( ElasticIndexerWorker.perform_async(
:delete, :delete,
self.class.to_s, self.class.to_s,
......
...@@ -60,7 +60,7 @@ module EE ...@@ -60,7 +60,7 @@ module EE
end end
def project_creation_level def project_creation_level
super || current_application_settings.default_project_creation super || ::Gitlab::CurrentSettings.default_project_creation
end end
end end
end end
...@@ -108,7 +108,7 @@ module EE ...@@ -108,7 +108,7 @@ module EE
def actual_shared_runners_minutes_limit def actual_shared_runners_minutes_limit
shared_runners_minutes_limit || shared_runners_minutes_limit ||
current_application_settings.shared_runners_minutes ::Gitlab::CurrentSettings.shared_runners_minutes
end end
def shared_runners_minutes_limit_enabled? def shared_runners_minutes_limit_enabled?
...@@ -170,7 +170,7 @@ module EE ...@@ -170,7 +170,7 @@ module EE
def load_feature_available(feature) def load_feature_available(feature)
globally_available = License.feature_available?(feature) globally_available = License.feature_available?(feature)
if current_application_settings.should_check_namespace_plan? if ::Gitlab::CurrentSettings.should_check_namespace_plan?
globally_available && feature_available_in_plan?(feature) globally_available && feature_available_in_plan?(feature)
else else
globally_available globally_available
......
...@@ -15,7 +15,7 @@ module EE ...@@ -15,7 +15,7 @@ module EE
before_validation :mark_remote_mirrors_for_removal before_validation :mark_remote_mirrors_for_removal
before_save :set_override_pull_mirror_available, unless: -> { ::Gitlab::CurrentSettings.current_application_settings.mirror_available } before_save :set_override_pull_mirror_available, unless: -> { ::Gitlab::CurrentSettings.mirror_available }
after_save :create_mirror_data, if: ->(project) { project.mirror? && project.mirror_changed? } after_save :create_mirror_data, if: ->(project) { project.mirror? && project.mirror_changed? }
after_save :destroy_mirror_data, if: ->(project) { !project.mirror? && project.mirror_changed? } after_save :destroy_mirror_data, if: ->(project) { !project.mirror? && project.mirror_changed? }
...@@ -449,12 +449,12 @@ module EE ...@@ -449,12 +449,12 @@ module EE
def remote_mirror_available? def remote_mirror_available?
remote_mirror_available_overridden || remote_mirror_available_overridden ||
current_application_settings.mirror_available ::Gitlab::CurrentSettings.mirror_available
end end
def pull_mirror_available? def pull_mirror_available?
pull_mirror_available_overridden || pull_mirror_available_overridden ||
current_application_settings.mirror_available ::Gitlab::CurrentSettings.mirror_available
end end
private private
...@@ -477,7 +477,7 @@ module EE ...@@ -477,7 +477,7 @@ module EE
def load_licensed_feature_available(feature) def load_licensed_feature_available(feature)
globally_available = License.feature_available?(feature) globally_available = License.feature_available?(feature)
if namespace && current_application_settings.should_check_namespace_plan? if namespace && ::Gitlab::CurrentSettings.should_check_namespace_plan?
globally_available && globally_available &&
(public? && namespace.public? || namespace.feature_available_in_plan?(feature)) (public? && namespace.public? || namespace.feature_available_in_plan?(feature))
else else
......
class Geo::DeletedProject class Geo::DeletedProject
include Gitlab::CurrentSettings
attr_reader :id, :name, :disk_path attr_reader :id, :name, :disk_path
def initialize(id:, name:, disk_path:, repository_storage:) def initialize(id:, name:, disk_path:, repository_storage:)
...@@ -17,7 +15,7 @@ class Geo::DeletedProject ...@@ -17,7 +15,7 @@ class Geo::DeletedProject
end end
def repository_storage def repository_storage
@repository_storage ||= current_application_settings.pick_repository_storage @repository_storage ||= Gitlab::CurrentSettings.pick_repository_storage
end end
def repository_storage_path def repository_storage_path
......
...@@ -36,7 +36,7 @@ module EE ...@@ -36,7 +36,7 @@ module EE
end end
def application_shared_runners_minutes def application_shared_runners_minutes
current_application_settings.shared_runners_minutes ::Gitlab::CurrentSettings.shared_runners_minutes
end end
def shared_runner_build_limits_feature_enabled? def shared_runner_build_limits_feature_enabled?
......
module Geo module Geo
class NodeStatusFetchService class NodeStatusFetchService
include Gitlab::CurrentSettings
include HTTParty include HTTParty
def call(geo_node) def call(geo_node)
...@@ -48,7 +47,7 @@ module Geo ...@@ -48,7 +47,7 @@ module Geo
end end
def timeout def timeout
current_application_settings.geo_status_timeout Gitlab::CurrentSettings.geo_status_timeout
end end
end end
end end
...@@ -53,8 +53,8 @@ module Projects ...@@ -53,8 +53,8 @@ module Projects
def exchange_slack_token def exchange_slack_token
HTTParty.get(SLACK_EXCHANGE_TOKEN_URL, query: { HTTParty.get(SLACK_EXCHANGE_TOKEN_URL, query: {
client_id: current_application_settings.slack_app_id, client_id: Gitlab::CurrentSettings.slack_app_id,
client_secret: current_application_settings.slack_app_secret, client_secret: Gitlab::CurrentSettings.slack_app_secret,
redirect_uri: slack_auth_project_settings_slack_url(project), redirect_uri: slack_auth_project_settings_slack_url(project),
code: params[:code] code: params[:code]
}) })
......
- namespace = local_assigns[:namespace] - namespace = local_assigns[:namespace]
- if current_application_settings.should_check_namespace_plan? && namespace && namespace.plan.present? - if Gitlab::CurrentSettings.should_check_namespace_plan? && namespace && namespace.plan.present?
%span.plan-badge.has-tooltip{ data: { plan: namespace.plan.name }, title: "#{namespace.plan.title} Plan" } %span.plan-badge.has-tooltip{ data: { plan: namespace.plan.name }, title: "#{namespace.plan.title} Plan" }
= custom_icon('icon_premium') = custom_icon('icon_premium')
- namespace = local_assigns[:namespace] - namespace = local_assigns[:namespace]
- if current_application_settings.should_check_namespace_plan? && namespace - if Gitlab::CurrentSettings.should_check_namespace_plan? && namespace
%li %li
%span.light Plan: %span.light Plan:
- if namespace.plan.present? - if namespace.plan.present?
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
%span %span
Pipelines quota Pipelines quota
- if current_application_settings.should_check_namespace_plan? - if Gitlab::CurrentSettings.should_check_namespace_plan?
= nav_link(path: 'billings#index') do = nav_link(path: 'billings#index') do
= link_to group_billings_path(@group), title: 'Billing' do = link_to group_billings_path(@group), title: 'Billing' do
%span %span
......
...@@ -7,5 +7,5 @@ ...@@ -7,5 +7,5 @@
%span.help-block#shared_runners_minutes_limit_help_block %span.help-block#shared_runners_minutes_limit_help_block
Set the maximum number of pipeline minutes that a group can use on shared Runners per month. Set the maximum number of pipeline minutes that a group can use on shared Runners per month.
Set 0 for unlimited. Set 0 for unlimited.
Set empty to inherit the global setting of #{current_application_settings.shared_runners_minutes}. Set empty to inherit the global setting of #{Gitlab::CurrentSettings.shared_runners_minutes}.
= link_to icon('question-circle'), help_page_path("user/admin_area/settings/continuous_integration", anchor: "shared-runners-build-minutes-quota"), target: '_blank' = link_to icon('question-circle'), help_page_path("user/admin_area/settings/continuous_integration", anchor: "shared-runners-build-minutes-quota"), target: '_blank'
- if current_application_settings.email_author_in_body - if Gitlab::CurrentSettings.email_author_in_body
%div %div
#{link_to @updated_by.name, user_url(@updated_by)} added you as an approver for: #{link_to @updated_by.name, user_url(@updated_by)} added you as an approver for:
%p.details %p.details
......
- if current_application_settings.email_author_in_body - if Gitlab::CurrentSettings.email_author_in_body
%div %div
#{link_to @note.author_name, user_url(@note.author)} wrote: #{link_to @note.author_name, user_url(@note.author)} wrote:
%div %div
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
Web IDE (Beta) Web IDE (Beta)
%p %p
Enable the new web IDE on this device to make it possible to open and edit multiple files with a single commit. Enable the new web IDE on this device to make it possible to open and edit multiple files with a single commit.
- if current_application_settings.should_check_namespace_plan? - if Gitlab::CurrentSettings.should_check_namespace_plan?
Available for public GitLab.com projects or those using Gold. Available for public GitLab.com projects or those using Gold.
.col-lg-8.multi-file-editor-options .col-lg-8.multi-file-editor-options
= label_tag do = label_tag do
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
.help-block .help-block
Automatically update this project's branches and tags from the upstream Automatically update this project's branches and tags from the upstream
repository every hour. The Git LFS objects will not be synced. repository every hour. The Git LFS objects will not be synced.
- if current_application_settings.should_check_namespace_plan? - if Gitlab::CurrentSettings.should_check_namespace_plan?
.help-block .help-block
Mirroring will only be available if the feature is included in the plan of the selected group or user. Mirroring will only be available if the feature is included in the plan of the selected group or user.
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
= custom_icon('icon_search_avatar') = custom_icon('icon_search_avatar')
.user-callout-copy .user-callout-copy
%h5 %h5
- if current_application_settings.should_check_namespace_plan? - if Gitlab::CurrentSettings.should_check_namespace_plan?
= _('Upgrade your plan to activate Advanced Global Search.') = _('Upgrade your plan to activate Advanced Global Search.')
- else - else
= _('Improve search with Advanced Global Search and GitLab Enterprise Edition.') = _('Improve search with Advanced Global Search and GitLab Enterprise Edition.')
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
= custom_icon('icon_audit_events_purple') = custom_icon('icon_audit_events_purple')
.user-callout-copy .user-callout-copy
%h4 %h4
- if current_application_settings.should_check_namespace_plan? - if Gitlab::CurrentSettings.should_check_namespace_plan?
Upgrade your plan to activate Audit Events. Upgrade your plan to activate Audit Events.
- else - else
Track your project with Audit Events. Track your project with Audit Events.
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
= custom_icon('icon_burndown_charts') = custom_icon('icon_burndown_charts')
.user-callout-copy .user-callout-copy
%h4 %h4
- if current_application_settings.should_check_namespace_plan? - if Gitlab::CurrentSettings.should_check_namespace_plan?
Upgrade your plan to improve milestones with Burndown Charts. Upgrade your plan to improve milestones with Burndown Charts.
- else - else
Improve milestones with Burndown Charts. Improve milestones with Burndown Charts.
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
= custom_icon('icon_contribution_analytics') = custom_icon('icon_contribution_analytics')
.user-callout-copy .user-callout-copy
%h4 %h4
- if current_application_settings.should_check_namespace_plan? - if Gitlab::CurrentSettings.should_check_namespace_plan?
= _('Upgrade your plan to activate Contribution Analytics.') = _('Upgrade your plan to activate Contribution Analytics.')
- else - else
= _('Track activity with Contribution Analytics.') = _('Track activity with Contribution Analytics.')
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
= custom_icon('icon_export_issues') = custom_icon('icon_export_issues')
.user-callout-copy .user-callout-copy
%h4 %h4
- if current_application_settings.should_check_namespace_plan? - if Gitlab::CurrentSettings.should_check_namespace_plan?
Upgrade your plan to export issues. Upgrade your plan to export issues.
- else - else
Export issues with GitLab Enterprise Edition. Export issues with GitLab Enterprise Edition.
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
= custom_icon('icon_group_webhook') = custom_icon('icon_group_webhook')
.user-callout-copy .user-callout-copy
%h4 %h4
- if current_application_settings.should_check_namespace_plan? - if Gitlab::CurrentSettings.should_check_namespace_plan?
= _('Upgrade your plan to activate Group Webhooks.') = _('Upgrade your plan to activate Group Webhooks.')
- else - else
= _('Add Group Webhooks and GitLab Enterprise Edition.') = _('Add Group Webhooks and GitLab Enterprise Edition.')
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
.svg-container.center .svg-container.center
= custom_icon('icon_issue_board') = custom_icon('icon_issue_board')
%p %p
- if current_application_settings.should_check_namespace_plan? - if Gitlab::CurrentSettings.should_check_namespace_plan?
= _('Upgrade your plan to improve Issue boards.') = _('Upgrade your plan to improve Issue boards.')
- else - else
= _('Improve Issue boards with GitLab Enterprise Edition.') = _('Improve Issue boards with GitLab Enterprise Edition.')
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
%i.fa.fa-times.dropdown-menu-close-icon{ "aria-hidden" => "true", "data-hidden" => "true" } %i.fa.fa-times.dropdown-menu-close-icon{ "aria-hidden" => "true", "data-hidden" => "true" }
%div %div
%p %p
- if current_application_settings.should_check_namespace_plan? - if Gitlab::CurrentSettings.should_check_namespace_plan?
= _('Upgrade your plan to activate Issue weight.') = _('Upgrade your plan to activate Issue weight.')
- else - else
= _('Improve issues management with Issue weight and GitLab Enterprise Edition.') = _('Improve issues management with Issue weight and GitLab Enterprise Edition.')
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
= icon('times', class: 'dismiss-icon', 'aria-hidden' => 'true') = icon('times', class: 'dismiss-icon', 'aria-hidden' => 'true')
.user-callout-copy .user-callout-copy
%h4 %h4
- if current_application_settings.should_check_namespace_plan? - if Gitlab::CurrentSettings.should_check_namespace_plan?
Upgrade your plan to improve Merge Requests. Upgrade your plan to improve Merge Requests.
- else - else
Improve Merge Requests and customer support with GitLab Enterprise Edition. Improve Merge Requests and customer support with GitLab Enterprise Edition.
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
= custom_icon('icon_push_rules') = custom_icon('icon_push_rules')
.user-callout-copy .user-callout-copy
%h4 %h4
- if current_application_settings.should_check_namespace_plan? - if Gitlab::CurrentSettings.should_check_namespace_plan?
Upgrade your plan to improve repositories. Upgrade your plan to improve repositories.
- else - else
Improve repositories with GitLab Enterprise Edition. Improve repositories with GitLab Enterprise Edition.
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
= custom_icon('icon_service_desk') = custom_icon('icon_service_desk')
.user-callout-copy .user-callout-copy
%h4 %h4
- if current_application_settings.should_check_namespace_plan? - if Gitlab::CurrentSettings.should_check_namespace_plan?
Upgrade your plan to activate Service Desk. Upgrade your plan to activate Service Desk.
- else - else
Improve customer support with GitLab Service Desk. Improve customer support with GitLab Service Desk.
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
= icon('times', class: 'dismiss-icon', 'aria-hidden' => 'true') = icon('times', class: 'dismiss-icon', 'aria-hidden' => 'true')
.user-callout-copy .user-callout-copy
%h4 %h4
- if current_application_settings.should_check_namespace_plan? - if Gitlab::CurrentSettings.should_check_namespace_plan?
Upgrade your plan to improve Merge Requests with Squash Commit. Upgrade your plan to improve Merge Requests with Squash Commit.
- else - else
Improve Merge Requests with Squash Commit and GitLab Enterprise Edition. Improve Merge Requests with Squash Commit and GitLab Enterprise Edition.
......
- short_form = local_assigns.fetch :short_form, false - short_form = local_assigns.fetch :short_form, false
- if current_application_settings.should_check_namespace_plan? - if Gitlab::CurrentSettings.should_check_namespace_plan?
- namespace = @project&.namespace || @group - namespace = @project&.namespace || @group
- if can?(current_user, :admin_namespace, namespace) - if can?(current_user, :admin_namespace, namespace)
= link_to 'Upgrade your plan', upgrade_plan_url, class: 'btn btn-primary' = link_to 'Upgrade your plan', upgrade_plan_url, class: 'btn btn-primary'
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment