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
|
--- config/puma.rb.example.orig 2025-01-22 04:13:11 UTC
+++ config/puma.rb.example
@@ -1,15 +1,20 @@
# frozen_string_literal: true
+# Required as rubygem-concurrent-ruby version 1.3.5 has remove logger, but is required by active_support
+# The fix has only applied to rails 7.1 and 7.2
+# https://github.com/rails/rails/pull/49372
+require "logger"
+
# Load "path" as a rackup file.
#
# 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'
+pidfile '%%WWWDIR%%/tmp/pids/puma.pid'
+state_path '%%WWWDIR%%/tmp/pids/puma.state'
-stdout_redirect '/home/git/gitlab/log/puma.stdout.log',
- '/home/git/gitlab/log/puma.stderr.log',
+stdout_redirect '%%WWWDIR%%/log/puma.stdout.log',
+ '%%WWWDIR%%/log/puma.stderr.log',
true
# Configure "min" to be the minimum number of threads to use to answer
@@ -31,11 +36,11 @@ queue_requests false
# 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://%%WWWDIR%%/tmp/sockets/gitlab.socket'
workers 3
-require_relative "/home/git/gitlab/lib/gitlab/cluster/lifecycle_events"
+require_relative "%%WWWDIR%%/lib/gitlab/cluster/lifecycle_events"
on_restart do
# Signal application hooks that we're about to restart
@@ -74,14 +79,14 @@ wait_for_less_busy_worker ENV.fetch('PUMA_WAIT_FOR_LES
wait_for_less_busy_worker ENV.fetch('PUMA_WAIT_FOR_LESS_BUSY_WORKER', 0.001).to_f
# Use json formatter
-require_relative "/home/git/gitlab/lib/gitlab/puma_logging/json_formatter"
+require_relative "%%WWWDIR%%/lib/gitlab/puma_logging/json_formatter"
json_formatter = Gitlab::PumaLogging::JSONFormatter.new
log_formatter do |str|
json_formatter.call(str)
end
-require_relative "/home/git/gitlab/lib/gitlab/puma/error_handler"
+require_relative "%%WWWDIR%%/lib/gitlab/puma/error_handler"
error_handler = Gitlab::Puma::ErrorHandler.new(ENV['RAILS_ENV'] == 'production')
|