at 16.09-beta 137 lines 4.9 kB view raw
1diff --git a/config/environments/production.rb b/config/environments/production.rb 2index a9d8ac4..85f13f5 100644 3--- a/config/environments/production.rb 4+++ b/config/environments/production.rb 5@@ -70,14 +70,16 @@ Rails.application.configure do 6 7 config.action_mailer.delivery_method = :sendmail 8 # Defaults to: 9- # # config.action_mailer.sendmail_settings = { 10- # # location: '/usr/sbin/sendmail', 11- # # arguments: '-i -t' 12- # # } 13+ config.action_mailer.sendmail_settings = { 14+ location: '/var/setuid-wrappers/sendmail', 15+ arguments: '-i -t' 16+ } 17 config.action_mailer.perform_deliveries = true 18 config.action_mailer.raise_delivery_errors = true 19 20 config.eager_load = true 21 22 config.allow_concurrency = false 23+ 24+ config.active_record.dump_schema_after_migration = false 25 end 26diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example 27index 1470a6e..1b2660d 100644 28--- a/config/gitlab.yml.example 29+++ b/config/gitlab.yml.example 30@@ -476,7 +476,7 @@ production: &base 31 # CAUTION! 32 # Use the default values unless you really know what you are doing 33 git: 34- bin_path: /usr/bin/git 35+ bin_path: git 36 # The next value is the maximum memory size grit can use 37 # Given in number of bytes per git object (e.g. a commit) 38 # This value can be increased if you have very large commits 39diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb 40index 86f5521..3bf006b 100644 41--- a/config/initializers/1_settings.rb 42+++ b/config/initializers/1_settings.rb 43@@ -192,7 +192,7 @@ Settings.gitlab['user'] ||= 'git' 44 Settings.gitlab['user_home'] ||= begin 45 Etc.getpwnam(Settings.gitlab['user']).dir 46 rescue ArgumentError # no user configured 47- '/home/' + Settings.gitlab['user'] 48+ '/homeless-shelter' 49 end 50 Settings.gitlab['time_zone'] ||= nil 51 Settings.gitlab['signup_enabled'] ||= true if Settings.gitlab['signup_enabled'].nil? 52@@ -350,7 +350,7 @@ Settings.backup['upload']['encryption'] ||= nil 53 # 54 Settings['git'] ||= Settingslogic.new({}) 55 Settings.git['max_size'] ||= 20971520 # 20.megabytes 56-Settings.git['bin_path'] ||= '/usr/bin/git' 57+Settings.git['bin_path'] ||= 'git' 58 Settings.git['timeout'] ||= 10 59 60 # Important: keep the satellites.path setting until GitLab 9.0 at 61diff --git a/lib/gitlab/logger.rb b/lib/gitlab/logger.rb 62index 59b2114..4f4a39a 100644 63--- a/lib/gitlab/logger.rb 64+++ b/lib/gitlab/logger.rb 65@@ -13,20 +13,20 @@ module Gitlab 66 end 67 68 def self.read_latest 69- path = Rails.root.join("log", file_name) 70+ path = File.join(ENV["GITLAB_LOG_PATH"], file_name) 71 self.build unless File.exist?(path) 72 tail_output, _ = Gitlab::Popen.popen(%W(tail -n 2000 #{path})) 73 tail_output.split("\n") 74 end 75 76 def self.read_latest_for(filename) 77- path = Rails.root.join("log", filename) 78+ path = File.join(ENV["GITLAB_LOG_PATH"], filename) 79 tail_output, _ = Gitlab::Popen.popen(%W(tail -n 2000 #{path})) 80 tail_output.split("\n") 81 end 82 83 def self.build 84- new(Rails.root.join("log", file_name)) 85+ new(File.join(ENV["GITLAB_LOG_PATH"], file_name)) 86 end 87 end 88 end 89diff --git a/lib/gitlab/uploads_transfer.rb b/lib/gitlab/uploads_transfer.rb 90index be8fcc7..7642d74 100644 91--- a/lib/gitlab/uploads_transfer.rb 92+++ b/lib/gitlab/uploads_transfer.rb 93@@ -29,7 +29,7 @@ module Gitlab 94 end 95 96 def root_dir 97- File.join(Rails.root, "public", "uploads") 98+ ENV['GITLAB_UPLOADS_PATH'] || File.join(Rails.root, "public", "uploads") 99 end 100 end 101 end 102diff --git a/lib/tasks/gitlab/check.rake b/lib/tasks/gitlab/check.rake 103index 60f4636..157641f 100644 104--- a/lib/tasks/gitlab/check.rake 105+++ b/lib/tasks/gitlab/check.rake 106@@ -223,7 +223,7 @@ namespace :gitlab do 107 def check_log_writable 108 print "Log directory writable? ... " 109 110- log_path = Rails.root.join("log") 111+ log_path = ENV["GITLAB_LOG_PATH"] 112 113 if File.writable?(log_path) 114 puts "yes".color(:green) 115@@ -263,10 +263,11 @@ namespace :gitlab do 116 def check_uploads 117 print "Uploads directory setup correctly? ... " 118 119- unless File.directory?(Rails.root.join('public/uploads')) 120+ uploads_dir = ENV['GITLAB_UPLOADS_PATH'] || Rails.root.join('public/uploads') 121+ unless File.directory?(uploads_dir) 122 puts "no".color(:red) 123 try_fixing_it( 124- "sudo -u #{gitlab_user} mkdir #{Rails.root}/public/uploads" 125+ "sudo -u #{gitlab_user} mkdir #{uploads_dir}" 126 ) 127 for_more_information( 128 see_installation_guide_section "GitLab" 129@@ -275,7 +276,7 @@ namespace :gitlab do 130 return 131 end 132 133- upload_path = File.realpath(Rails.root.join('public/uploads')) 134+ upload_path = File.realpath(Rails.root.join(uploads_dir)) 135 upload_path_tmp = File.join(upload_path, 'tmp') 136 137 if File.stat(upload_path).mode == 040700