about summary refs log tree commit diff
path: root/pkgs/applications/version-management/gitlab/remove-hardcoded-locations.patch
blob: fbf5a05fc4e6f66fce7a75abfa5c0d8a2c3b502f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
diff --git a/config/environments/production.rb b/config/environments/production.rb
index 9095266..694a4c5 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -67,10 +67,10 @@ Rails.application.configure do
 
   config.action_mailer.delivery_method = :sendmail
   # Defaults to:
-  # # config.action_mailer.sendmail_settings = {
-  # #   location: '/usr/sbin/sendmail',
-  # #   arguments: '-i -t'
-  # # }
+  config.action_mailer.sendmail_settings = {
+    location: '/var/setuid-wrappers/sendmail',
+    arguments: '-i -t'
+  }
   config.action_mailer.perform_deliveries = true
   config.action_mailer.raise_delivery_errors = true
 
diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example
index 05f127d..6a4ae68 100644
--- a/config/gitlab.yml.example
+++ b/config/gitlab.yml.example
@@ -423,7 +423,7 @@ production: &base
   # CAUTION!
   # Use the default values unless you really know what you are doing
   git:
-    bin_path: /usr/bin/git
+    bin_path: git
     # The next value is the maximum memory size grit can use
     # Given in number of bytes per git object (e.g. a commit)
     # This value can be increased if you have very large commits
diff --git a/lib/gitlab/logger.rb b/lib/gitlab/logger.rb
index 59b2114..4f4a39a 100644
--- a/lib/gitlab/logger.rb
+++ b/lib/gitlab/logger.rb
@@ -13,20 +13,20 @@ module Gitlab
     end
 
     def self.read_latest
-      path = Rails.root.join("log", file_name)
+      path = File.join(ENV["GITLAB_LOG_PATH"], file_name)
       self.build unless File.exist?(path)
       tail_output, _ = Gitlab::Popen.popen(%W(tail -n 2000 #{path}))
       tail_output.split("\n")
     end
 
     def self.read_latest_for(filename)
-      path = Rails.root.join("log", filename)
+      path = File.join(ENV["GITLAB_LOG_PATH"], filename)
       tail_output, _ = Gitlab::Popen.popen(%W(tail -n 2000 #{path}))
       tail_output.split("\n")
     end
 
     def self.build
-      new(Rails.root.join("log", file_name))
+      new(File.join(ENV["GITLAB_LOG_PATH"], file_name))
     end
   end
 end
diff --git a/lib/gitlab/uploads_transfer.rb b/lib/gitlab/uploads_transfer.rb
index be8fcc7..7642d74 100644
--- a/lib/gitlab/uploads_transfer.rb
+++ b/lib/gitlab/uploads_transfer.rb
@@ -29,7 +29,7 @@ module Gitlab
     end
 
     def root_dir
-      File.join(Rails.root, "public", "uploads")
+      ENV['GITLAB_UPLOADS_PATH'] || File.join(Rails.root, "public", "uploads")
     end
   end
 end
diff --git a/lib/tasks/gitlab/check.rake b/lib/tasks/gitlab/check.rake
index d59872d..0b8007f 100644
--- a/lib/tasks/gitlab/check.rake
+++ b/lib/tasks/gitlab/check.rake
@@ -223,7 +223,7 @@ namespace :gitlab do
     def check_log_writable
       print "Log directory writable? ... "
 
-      log_path = Rails.root.join("log")
+      log_path = ENV["GITLAB_LOG_PATH"]
 
       if File.writable?(log_path)
         puts "yes".green
@@ -263,10 +263,12 @@ namespace :gitlab do
     def check_uploads
       print "Uploads directory setup correctly? ... "
 
-      unless File.directory?(Rails.root.join('public/uploads'))
+      uploads_dir = ENV['GITLAB_UPLOADS_PATH'] || Rails.root.join('public/uploads')
+
+      unless File.directory?(uploads_dir)
         puts "no".red
         try_fixing_it(
-          "sudo -u #{gitlab_user} mkdir #{Rails.root}/public/uploads"
+          "sudo -u #{gitlab_user} mkdir #{uploads_dir}"
         )
         for_more_information(
           see_installation_guide_section "GitLab"
@@ -275,7 +277,7 @@ namespace :gitlab do
         return
       end
 
-      upload_path = File.realpath(Rails.root.join('public/uploads'))
+      upload_path = File.realpath(Rails.root.join(uploads_dir))
       upload_path_tmp = File.join(upload_path, 'tmp')
 
       if File.stat(upload_path).mode == 040700