debian-mirror-gitlab/config/initializers/6_validations.rb

18 lines
497 B
Ruby
Raw Normal View History

2016-08-24 12:49:21 +05:30
def storage_validation_error(message)
raise "#{message}. Please fix this in your gitlab.yml before starting GitLab."
end
2017-08-17 22:00:37 +05:30
def validate_storages_config
2019-09-30 21:07:59 +05:30
if Gitlab.config.repositories.storages.empty?
storage_validation_error('No repository storage path defined')
end
2017-09-10 17:25:29 +05:30
2019-09-30 21:07:59 +05:30
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-09-10 17:25:29 +05:30
end
2017-08-17 22:00:37 +05:30
end
end
validate_storages_config