Read about our upcoming Code of Conduct on this issue

Commit 9b337b83 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Epic: Gitlab configuration with default values

parent a6501e915ef3
......@@ -14,10 +14,10 @@
# Enable Grack support
mount Grack::Bundle.new({
git_path: GIT_OPTS['path'],
project_root: GIT_HOST['base_path'],
upload_pack: GIT_HOST['upload_pack'],
receive_pack: GIT_HOST['receive_pack']
git_path: Gitlab.config.git_bin_path,
project_root: Gitlab.config.git_base_path,
upload_pack: Gitlab.config.git_upload_pack,
receive_pack: Gitlab.config.git_receive_pack
}), at: '/:path', constraints: { path: /[\w-]+\.git/ }
#
......
......@@ -7,15 +7,11 @@ def self.system
end
def self.admin_uri
GIT_HOST["admin_uri"]
Gitlab.config.git_host.admin_uri
end
def self.url_to_repo(path)
if !GIT_HOST["port"] or GIT_HOST["port"] == 22
"#{GIT_HOST["git_user"]}@#{GIT_HOST["host"]}:#{path}.git"
else
"ssh://#{GIT_HOST["git_user"]}@#{GIT_HOST["host"]}:#{GIT_HOST["port"]}/#{path}.git"
end
Gitlab.config.ssh_path + "#{path}.git"
end
end
end
......@@ -3,6 +3,7 @@ namespace :gitlab do
desc "GITLAB | Check gitlab installation status"
task :status => :environment do
puts "Starting diagnostic"
git_base_path = Gitlab.config.git_base_path
print "config/database.yml............"
if File.exists?(File.join Rails.root, "config", "database.yml")
......@@ -21,16 +22,16 @@ namespace :gitlab do
end
GIT_HOST = YAML.load_file("#{Rails.root}/config/gitlab.yml")["git_host"]
print "#{GIT_HOST['base_path']}............"
if File.exists?(GIT_HOST['base_path'])
print "#{git_base_path}............"
if File.exists?(git_base_path)
puts "exists".green
else
puts "missing".red
return
end
print "#{GIT_HOST['base_path']} is writable?............"
if File.stat(GIT_HOST['base_path']).writable?
print "#{git_base_path} is writable?............"
if File.stat(git_base_path).writable?
puts "YES".green
else
puts "NO".red
......@@ -38,7 +39,7 @@ namespace :gitlab do
end
begin
`git clone #{GIT_HOST["admin_uri"]} /tmp/gitolite_gitlab_test`
`git clone #{Gitlab.config.gitolite_admin_uri} /tmp/gitolite_gitlab_test`
FileUtils.rm_rf("/tmp/gitolite_gitlab_test")
print "Can clone gitolite-admin?............"
puts "YES".green
......@@ -49,7 +50,7 @@ namespace :gitlab do
end
print "UMASK for .gitolite.rc is 0007? ............"
unless open("#{GIT_HOST['base_path']}/../.gitolite.rc").grep(/REPO_UMASK = 0007/).empty?
unless open("#{git_base_path}/../.gitolite.rc").grep(/REPO_UMASK = 0007/).empty?
puts "YES".green
else
puts "NO".red
......
......@@ -5,7 +5,7 @@
include EmailSpec::Matchers
before :all do
default_url_options[:host] = EMAIL_OPTS['host']
default_url_options[:host] = Gitlab.config.web_host
end
let(:recipient) { Factory.create(:user, :email => 'recipient@example.com') }
......
......@@ -56,7 +56,7 @@
it "returns the full web URL for this repo" do
project = Project.new(:code => "somewhere")
project.web_url.should == "#{GIT_HOST['host']}/somewhere"
project.web_url.should == "#{Gitlab.config.url}/somewhere"
end
describe :valid_repo? do
......
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