2020-04-24 23:36:52 +00:00
|
|
|
diff --git a/config/environments/production.rb b/config/environments/production.rb
|
2021-05-03 20:48:10 +00:00
|
|
|
index e1a7db8d860..5823f170410 100644
|
2020-04-24 23:36:52 +00:00
|
|
|
--- a/config/environments/production.rb
|
|
|
|
+++ b/config/environments/production.rb
|
2021-05-03 20:48:10 +00:00
|
|
|
@@ -71,10 +71,10 @@
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
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 = {
|
2021-03-09 03:18:52 +00:00
|
|
|
+ location: '/run/wrappers/bin/sendmail',
|
2020-04-24 23:36:52 +00:00
|
|
|
+ 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
|
2021-05-03 20:48:10 +00:00
|
|
|
index da1a15302da..c846db93e5c 100644
|
2020-04-24 23:36:52 +00:00
|
|
|
--- a/config/gitlab.yml.example
|
|
|
|
+++ b/config/gitlab.yml.example
|
2021-05-03 20:48:10 +00:00
|
|
|
@@ -1191,7 +1191,7 @@ production: &base
|
2020-04-24 23:36:52 +00:00
|
|
|
# CAUTION!
|
|
|
|
# Use the default values unless you really know what you are doing
|
|
|
|
git:
|
|
|
|
- bin_path: /usr/bin/git
|
|
|
|
+ bin_path: git
|
|
|
|
|
|
|
|
## 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
|
2023-07-15 17:15:38 +00:00
|
|
|
index d096174fca3a..02d0f689c523 100644
|
2020-04-24 23:36:52 +00:00
|
|
|
--- a/config/initializers/1_settings.rb
|
|
|
|
+++ b/config/initializers/1_settings.rb
|
2023-07-15 17:15:38 +00:00
|
|
|
@@ -206,7 +206,7 @@
|
2020-11-24 20:58:05 +00:00
|
|
|
Settings.gitlab['user_home'] ||= begin
|
2020-04-24 23:36:52 +00:00
|
|
|
Etc.getpwnam(Settings.gitlab['user']).dir
|
2021-05-03 20:48:10 +00:00
|
|
|
rescue ArgumentError # no user configured
|
|
|
|
- '/home/' + Settings.gitlab['user']
|
|
|
|
+ '/homeless-shelter'
|
2020-04-24 23:36:52 +00:00
|
|
|
end
|
|
|
|
Settings.gitlab['time_zone'] ||= nil
|
|
|
|
Settings.gitlab['signup_enabled'] ||= true if Settings.gitlab['signup_enabled'].nil?
|
2023-07-15 17:15:38 +00:00
|
|
|
@@ -959,7 +959,7 @@
|
2020-04-24 23:36:52 +00:00
|
|
|
# Git
|
|
|
|
#
|
2023-07-15 17:15:38 +00:00
|
|
|
Settings['git'] ||= {}
|
2020-04-24 23:36:52 +00:00
|
|
|
-Settings.git['bin_path'] ||= '/usr/bin/git'
|
|
|
|
+Settings.git['bin_path'] ||= 'git'
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# Important: keep the satellites.path setting until GitLab 9.0 at
|
|
|
|
# least. This setting is fed to 'rm -rf' in
|
2021-03-09 03:18:52 +00:00
|
|
|
diff --git a/config/puma.rb.example b/config/puma.rb.example
|
2023-07-15 17:15:38 +00:00
|
|
|
index 07a6f6a25015..14a718a43202 100644
|
2021-03-09 03:18:52 +00:00
|
|
|
--- a/config/puma.rb.example
|
|
|
|
+++ b/config/puma.rb.example
|
|
|
|
@@ -5,12 +5,8 @@
|
|
|
|
# The default is "config.ru".
|
|
|
|
#
|
|
|
|
rackup 'config.ru'
|
|
|
|
-pidfile '/home/git/gitlab/tmp/pids/puma.pid'
|
|
|
|
-state_path '/home/git/gitlab/tmp/pids/puma.state'
|
|
|
|
-
|
|
|
|
-stdout_redirect '/home/git/gitlab/log/puma.stdout.log',
|
|
|
|
- '/home/git/gitlab/log/puma.stderr.log',
|
|
|
|
- true
|
|
|
|
+pidfile ENV['PUMA_PATH'] + '/tmp/pids/puma.pid'
|
|
|
|
+state_path ENV['PUMA_PATH'] + '/tmp/pids/puma.state'
|
|
|
|
|
|
|
|
# Configure "min" to be the minimum number of threads to use to answer
|
|
|
|
# requests and "max" the maximum.
|
2023-07-15 17:15:38 +00:00
|
|
|
@@ -31,11 +27,11 @@ queue_requests false
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
# Bind the server to "url". "tcp://", "unix://" and "ssl://" are the only
|
|
|
|
# accepted protocols.
|
|
|
|
-bind 'unix:///home/git/gitlab/tmp/sockets/gitlab.socket'
|
|
|
|
+bind "unix://#{ENV['PUMA_PATH']}/tmp/sockets/gitlab.socket"
|
|
|
|
|
|
|
|
workers 3
|
|
|
|
|
|
|
|
-require_relative "/home/git/gitlab/lib/gitlab/cluster/lifecycle_events"
|
|
|
|
+require_relative ENV['GITLAB_PATH'] + "lib/gitlab/cluster/lifecycle_events"
|
|
|
|
|
|
|
|
on_restart do
|
|
|
|
# Signal application hooks that we're about to restart
|
2023-07-15 17:15:38 +00:00
|
|
|
@@ -74,7 +70,7 @@ worker_timeout 60
|
|
|
|
wait_for_less_busy_worker ENV.fetch('PUMA_WAIT_FOR_LESS_BUSY_WORKER', 0.001).to_f
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
# Use json formatter
|
|
|
|
-require_relative "/home/git/gitlab/lib/gitlab/puma_logging/json_formatter"
|
|
|
|
+require_relative ENV['GITLAB_PATH'] + "lib/gitlab/puma_logging/json_formatter"
|
|
|
|
|
|
|
|
json_formatter = Gitlab::PumaLogging::JSONFormatter.new
|
|
|
|
log_formatter do |str|
|
2020-04-24 23:36:52 +00:00
|
|
|
diff --git a/lib/api/api.rb b/lib/api/api.rb
|
2021-05-03 20:48:10 +00:00
|
|
|
index a287ffbfcd8..1a5ca59183a 100644
|
2020-04-24 23:36:52 +00:00
|
|
|
--- a/lib/api/api.rb
|
|
|
|
+++ b/lib/api/api.rb
|
2021-03-09 03:18:52 +00:00
|
|
|
@@ -4,7 +4,7 @@ module API
|
|
|
|
class API < ::API::Base
|
2020-04-24 23:36:52 +00:00
|
|
|
include APIGuard
|
|
|
|
|
|
|
|
- LOG_FILENAME = Rails.root.join("log", "api_json.log")
|
|
|
|
+ LOG_FILENAME = File.join(ENV["GITLAB_LOG_PATH"], "api_json.log")
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
NO_SLASH_URL_PART_REGEX = %r{[^/]+}.freeze
|
|
|
|
NAMESPACE_OR_PROJECT_REQUIREMENTS = { id: NO_SLASH_URL_PART_REGEX }.freeze
|
|
|
|
diff --git a/lib/gitlab/authorized_keys.rb b/lib/gitlab/authorized_keys.rb
|
|
|
|
index 50cd15b7a10..3ac89e5b8e9 100644
|
|
|
|
--- a/lib/gitlab/authorized_keys.rb
|
|
|
|
+++ b/lib/gitlab/authorized_keys.rb
|
|
|
|
@@ -157,7 +157,7 @@ def command(id)
|
|
|
|
raise KeyError, "Invalid ID: #{id.inspect}"
|
|
|
|
end
|
|
|
|
|
|
|
|
- "#{File.join(Gitlab.config.gitlab_shell.path, 'bin', 'gitlab-shell')} #{id}"
|
|
|
|
+ "#{File.join('/run/current-system/sw/bin', 'gitlab-shell')} #{id}"
|
|
|
|
end
|
|
|
|
|
|
|
|
def strip(key)
|
2020-04-24 23:36:52 +00:00
|
|
|
diff --git a/lib/gitlab/logger.rb b/lib/gitlab/logger.rb
|
2021-03-09 03:18:52 +00:00
|
|
|
index 89a4e36a232..ae379ffb27a 100644
|
2020-04-24 23:36:52 +00:00
|
|
|
--- a/lib/gitlab/logger.rb
|
|
|
|
+++ b/lib/gitlab/logger.rb
|
2021-03-09 03:18:52 +00:00
|
|
|
@@ -37,7 +37,7 @@ def self.build
|
2020-04-24 23:36:52 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def self.full_log_path
|
|
|
|
- Rails.root.join("log", file_name)
|
2021-03-09 03:18:52 +00:00
|
|
|
+ File.join(ENV["GITLAB_LOG_PATH"], file_name)
|
2020-04-24 23:36:52 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def self.cache_key
|
|
|
|
diff --git a/lib/gitlab/uploads_transfer.rb b/lib/gitlab/uploads_transfer.rb
|
2021-03-09 03:18:52 +00:00
|
|
|
index e0e7084e27e..19fab855b90 100644
|
2020-04-24 23:36:52 +00:00
|
|
|
--- a/lib/gitlab/uploads_transfer.rb
|
|
|
|
+++ b/lib/gitlab/uploads_transfer.rb
|
2021-03-09 03:18:52 +00:00
|
|
|
@@ -3,7 +3,7 @@
|
2020-04-24 23:36:52 +00:00
|
|
|
module Gitlab
|
|
|
|
class UploadsTransfer < ProjectTransfer
|
|
|
|
def root_dir
|
|
|
|
- FileUploader.root
|
|
|
|
+ ENV['GITLAB_UPLOADS_PATH'] || FileUploader.root
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
diff --git a/lib/system_check/app/log_writable_check.rb b/lib/system_check/app/log_writable_check.rb
|
2021-03-09 03:18:52 +00:00
|
|
|
index 2c108f0c18d..3a16ff52d01 100644
|
2020-04-24 23:36:52 +00:00
|
|
|
--- a/lib/system_check/app/log_writable_check.rb
|
|
|
|
+++ b/lib/system_check/app/log_writable_check.rb
|
2021-03-09 03:18:52 +00:00
|
|
|
@@ -23,7 +23,7 @@ def show_error
|
2020-04-24 23:36:52 +00:00
|
|
|
private
|
|
|
|
|
|
|
|
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
|
2021-03-09 03:18:52 +00:00
|
|
|
index 54dff63ab61..882da702f29 100644
|
2020-04-24 23:36:52 +00:00
|
|
|
--- a/lib/system_check/app/uploads_directory_exists_check.rb
|
|
|
|
+++ b/lib/system_check/app/uploads_directory_exists_check.rb
|
2021-03-09 03:18:52 +00:00
|
|
|
@@ -6,12 +6,13 @@ class UploadsDirectoryExistsCheck < SystemCheck::BaseCheck
|
2020-04-24 23:36:52 +00:00
|
|
|
set_name 'Uploads directory exists?'
|
|
|
|
|
|
|
|
def check?
|
|
|
|
- File.directory?(Rails.root.join('public/uploads'))
|
|
|
|
+ File.directory?(ENV['GITLAB_UPLOADS_PATH'] || Rails.root.join('public/uploads'))
|
|
|
|
end
|
|
|
|
|
|
|
|
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"
|
2021-03-09 03:18:52 +00:00
|
|
|
+ "sudo -u #{gitlab_user} mkdir #{uploads_dir}"
|
2020-04-24 23:36:52 +00:00
|
|
|
)
|
|
|
|
for_more_information(
|
2021-03-09 03:18:52 +00:00
|
|
|
see_installation_guide_section('GitLab')
|
2020-04-24 23:36:52 +00:00
|
|
|
diff --git a/lib/system_check/app/uploads_path_permission_check.rb b/lib/system_check/app/uploads_path_permission_check.rb
|
2021-03-09 03:18:52 +00:00
|
|
|
index 2e1cc687c43..ca69d63bcf6 100644
|
2020-04-24 23:36:52 +00:00
|
|
|
--- a/lib/system_check/app/uploads_path_permission_check.rb
|
|
|
|
+++ b/lib/system_check/app/uploads_path_permission_check.rb
|
2021-03-09 03:18:52 +00:00
|
|
|
@@ -27,7 +27,7 @@ def show_error
|
2020-04-24 23:36:52 +00:00
|
|
|
private
|
|
|
|
|
|
|
|
def rails_uploads_path
|
|
|
|
- Rails.root.join('public/uploads')
|
|
|
|
+ ENV['GITLAB_UPLOADS_PATH'] || Rails.root.join('public/uploads')
|
|
|
|
end
|
|
|
|
|
|
|
|
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
|
2021-03-09 03:18:52 +00:00
|
|
|
index 567c7540777..29906b1c132 100644
|
2020-04-24 23:36:52 +00:00
|
|
|
--- a/lib/system_check/app/uploads_path_tmp_permission_check.rb
|
|
|
|
+++ b/lib/system_check/app/uploads_path_tmp_permission_check.rb
|
2021-03-09 03:18:52 +00:00
|
|
|
@@ -35,7 +35,7 @@ def upload_path_tmp
|
2020-04-24 23:36:52 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def uploads_fullpath
|
|
|
|
- File.realpath(Rails.root.join('public/uploads'))
|
|
|
|
+ File.realpath(ENV['GITLAB_UPLOADS_PATH'] || Rails.root.join('public/uploads'))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2022-03-05 16:20:37 +00:00
|
|
|
diff --git a/scripts/decomposition/generate-loose-foreign-key b/scripts/decomposition/generate-loose-foreign-key
|
|
|
|
index 35f84c64ce1..c2fecf3404c 100755
|
|
|
|
--- a/scripts/decomposition/generate-loose-foreign-key
|
|
|
|
+++ b/scripts/decomposition/generate-loose-foreign-key
|
|
|
|
@@ -1,4 +1,4 @@
|
|
|
|
-#!/usr/bin/env -S ENABLE_SPRING=0 bin/rails runner -e test
|
|
|
|
+#!/usr/bin/env rails
|
|
|
|
|
|
|
|
# This is helper script to swap foreign key to loose foreign key
|
|
|
|
# using DB schema
|