nixpkgs/pkgs/applications/version-management/gitlab/remove-hardcoded-locations.patch

166 lines
5.8 KiB
Diff
Raw Normal View History

diff --git a/config/environments/production.rb b/config/environments/production.rb
2017-07-05 22:53:31 +01:00
index c5cbfcf64c..e40f10e25f 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -70,14 +70,16 @@ 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: '/run/wrappers/bin/sendmail',
+ arguments: '-i -t'
+ }
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true
config.eager_load = true
config.allow_concurrency = false
+
+ config.active_record.dump_schema_after_migration = false
end
diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example
2017-07-05 22:53:31 +01:00
index 0b33783869..cd4e41d9bd 100644
--- a/config/gitlab.yml.example
+++ b/config/gitlab.yml.example
2017-11-03 21:27:58 +00:00
@@ -574,7 +574,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
2017-11-03 21:27:58 +00:00
## Webpack settings
# If enabled, this will tell rails to serve frontend assets from the webpack-dev-server running
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb
2017-07-05 22:53:31 +01:00
index 8ddf8e4d2e..559cf9adf7 100644
--- a/config/initializers/1_settings.rb
+++ b/config/initializers/1_settings.rb
2017-11-03 21:27:58 +00:00
@@ -252,7 +252,7 @@ Settings.gitlab['user'] ||= 'git'
Settings.gitlab['user_home'] ||= begin
Etc.getpwnam(Settings.gitlab['user']).dir
rescue ArgumentError # no user configured
- '/home/' + Settings.gitlab['user']
+ '/homeless-shelter'
end
Settings.gitlab['time_zone'] ||= nil
Settings.gitlab['signup_enabled'] ||= true if Settings.gitlab['signup_enabled'].nil?
2017-11-03 21:27:58 +00:00
@@ -491,7 +491,7 @@ Settings.backup['upload']['storage_class'] ||= nil
# Git
#
Settings['git'] ||= Settingslogic.new({})
2017-11-03 21:27:58 +00:00
-Settings.git['bin_path'] ||= '/usr/bin/git'
+Settings.git['bin_path'] ||= 'git'
# Important: keep the satellites.path setting until GitLab 9.0 at
2017-11-03 21:27:58 +00:00
# least. This setting is fed to 'rm -rf' in
diff --git a/lib/gitlab/logger.rb b/lib/gitlab/logger.rb
2017-07-05 22:53:31 +01:00
index 59b21149a9..4f4a39a06c 100644
--- a/lib/gitlab/logger.rb
+++ b/lib/gitlab/logger.rb
2017-09-28 19:09:31 +01:00
@@ -13,7 +13,7 @@
end
def self.read_latest
- path = Rails.root.join("log", file_name)
+ path = File.join(ENV["GITLAB_LOG_PATH"], file_name)
2017-09-28 19:09:31 +01:00
return [] unless File.readable?(path)
@@ -22,7 +22,7 @@
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
2017-07-05 22:53:31 +01:00
index b5f4124052..f72c556983 100644
--- a/lib/gitlab/uploads_transfer.rb
+++ b/lib/gitlab/uploads_transfer.rb
2017-07-05 22:53:31 +01:00
@@ -1,7 +1,7 @@
module Gitlab
class UploadsTransfer < ProjectTransfer
def root_dir
2017-07-05 22:53:31 +01:00
- File.join(CarrierWave.root, FileUploader.base_dir)
+ ENV['GITLAB_UPLOADS_PATH'] || File.join(CarrierWave.root, FileUploader.base_dir)
end
end
end
2017-07-05 22:53:31 +01:00
diff --git a/lib/system_check/app/log_writable_check.rb b/lib/system_check/app/log_writable_check.rb
index 3e0c436d6e..28cefc5514 100644
--- a/lib/system_check/app/log_writable_check.rb
+++ b/lib/system_check/app/log_writable_check.rb
@@ -21,7 +21,7 @@ module SystemCheck
private
2017-07-05 22:53:31 +01:00
def log_path
- Rails.root.join('log')
+ ENV["GITLAB_LOG_PATH"]
end
end
end
diff --git a/lib/system_check/app/uploads_directory_exists_check.rb b/lib/system_check/app/uploads_directory_exists_check.rb
index 7026d0ba07..6d88b8b9fb 100644
--- a/lib/system_check/app/uploads_directory_exists_check.rb
+++ b/lib/system_check/app/uploads_directory_exists_check.rb
@@ -4,12 +4,13 @@ module SystemCheck
set_name 'Uploads directory exists?'
2017-07-05 22:53:31 +01:00
def check?
- File.directory?(Rails.root.join('public/uploads'))
+ File.directory?(ENV['GITLAB_UPLOADS_PATH'] || Rails.root.join('public/uploads'))
end
2017-07-05 22:53:31 +01:00
def show_error
+ uploads_dir = ENV['GITLAB_UPLOADS_PATH'] || Rails.root.join('public/uploads')
try_fixing_it(
- "sudo -u #{gitlab_user} mkdir #{Rails.root}/public/uploads"
+ "sudo -u #{gitlab_user} mkdir #{uploads_dir}"
)
for_more_information(
2017-07-05 22:53:31 +01:00
see_installation_guide_section 'GitLab'
diff --git a/lib/system_check/app/uploads_path_permission_check.rb b/lib/system_check/app/uploads_path_permission_check.rb
index 7df6c06025..bb447c16b2 100644
--- a/lib/system_check/app/uploads_path_permission_check.rb
+++ b/lib/system_check/app/uploads_path_permission_check.rb
@@ -25,7 +25,7 @@ module SystemCheck
private
def rails_uploads_path
- Rails.root.join('public/uploads')
+ ENV['GITLAB_UPLOADS_PATH'] || Rails.root.join('public/uploads')
end
2017-07-05 22:53:31 +01:00
def uploads_fullpath
diff --git a/lib/system_check/app/uploads_path_tmp_permission_check.rb b/lib/system_check/app/uploads_path_tmp_permission_check.rb
index b276a81eac..070e3ebd81 100644
--- a/lib/system_check/app/uploads_path_tmp_permission_check.rb
+++ b/lib/system_check/app/uploads_path_tmp_permission_check.rb
@@ -33,7 +33,7 @@ module SystemCheck
end
2017-07-05 22:53:31 +01:00
def uploads_fullpath
- File.realpath(Rails.root.join('public/uploads'))
+ File.realpath(ENV['GITLAB_UPLOADS_PATH'] || Rails.root.join('public/uploads'))
end
end
end
2017-09-28 19:09:31 +01:00
--- a/lib/api/api.rb 1970-01-01 01:00:01.000000000 +0100
+++ b/lib/api/api.rb 2017-09-28 19:37:24.953605705 +0200
@@ -2,7 +2,7 @@
class API < Grape::API
include APIGuard
- LOG_FILENAME = Rails.root.join("log", "api_json.log")
+ LOG_FILENAME = File.join(ENV["GITLAB_LOG_PATH"], "api_json.log")
use GrapeLogging::Middleware::RequestLogger,
logger: Logger.new(LOG_FILENAME),