gitlab-org--gitlab-foss/config/initializers/6_validations.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
528 B
Ruby
Raw Normal View History

# frozen_string_literal: true
def storage_validation_error(message)
raise "#{message}. Please fix this in your gitlab.yml before starting GitLab."
end
def validate_storages_config
if Gitlab.config.repositories.storages.empty?
storage_validation_error('No repository storage path defined')
end
2017-05-17 16:17:15 +00:00
Gitlab.config.repositories.storages.keys.each do |name|
unless /\A[a-zA-Z0-9\-_]+\z/.match?(name)
storage_validation_error("\"#{name}\" is not a valid storage name")
2017-05-17 16:17:15 +00:00
end
end
end
validate_storages_config