capistrano3-puma 3.1.1 → 5.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/CHANGELOG.md +13 -8
- data/CONTRIBUTORS.md +1 -0
- data/LICENSE.txt +1 -1
- data/README.md +37 -4
- data/capistrano3-puma.gemspec +1 -1
- data/lib/capistrano/puma.rb +3 -1
- data/lib/capistrano/puma/daemon.rb +13 -0
- data/lib/capistrano/puma/nginx.rb +2 -0
- data/lib/capistrano/puma/systemd.rb +19 -0
- data/lib/capistrano/puma/version.rb +1 -1
- data/lib/capistrano/tasks/daemon.rake +74 -0
- data/lib/capistrano/tasks/jungle.rake +1 -1
- data/lib/capistrano/tasks/puma.rake +0 -79
- data/lib/capistrano/tasks/systemd.rake +59 -0
- data/lib/capistrano/templates/nginx_conf.erb +10 -2
- data/lib/capistrano/templates/puma.rb.erb +2 -0
- data/lib/capistrano/templates/puma.service.erb +18 -0
- metadata +20 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2556d3d0f9c69518e9b8fff34c4e9a5414df32421c886749c5780ea76d4a29ab
|
4
|
+
data.tar.gz: 346d5440671df45a98bb55b9156de333b6d75978c8370f323b8e191f87f5e84c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e223d91b3153aa0cd69ffb59ffa21f3ac4d49c98f006825930ad4ea385c6d89e79d61d2478af3314e583abcfc596dcef180fed80b7d2f6f7c5fa93f2169a76c1
|
7
|
+
data.tar.gz: 6f1db9884b136d4595e65f7dc2bc7eb3027e8603e74e3f985b014a912ee8729c83b223a118ea37b39aa3981a82cead762fc26c959b4b171132624708400709f6
|
data/CHANGELOG.md
CHANGED
@@ -1,16 +1,21 @@
|
|
1
1
|
## Changelog
|
2
|
-
-
|
2
|
+
- 5.0.0:
|
3
|
+
- Support puma 5.0
|
4
|
+
- Support SystemD service manager
|
5
|
+
- 4.0.0:
|
6
|
+
- Support puma 4.x
|
7
|
+
- 3.1.0:
|
3
8
|
- Don't load puma hooks by default.
|
4
9
|
- 3.0.0:
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
10
|
+
- Require capistrano 3.7+
|
11
|
+
- Implement the plugin system
|
12
|
+
- don't fail if puma was already running
|
13
|
+
- Added :puma_daemonize option (default is false)
|
9
14
|
|
10
15
|
- 2.0.0:
|
11
|
-
|
12
|
-
|
13
|
-
|
16
|
+
- Require puma 3.4+
|
17
|
+
- Require Capistrano 3.5+
|
18
|
+
- Require capistrano-bundler
|
14
19
|
|
15
20
|
- 1.2.0: add support for puma user for puma user @mcb & @seuros
|
16
21
|
- 1.1.0: Set :puma_preload_app to false; Reload Monit after uploading any monit configuration; Always refresh Gemfile @rafaelgoulart @suhailpatel @sime
|
data/CONTRIBUTORS.md
CHANGED
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -26,6 +26,14 @@ And then execute:
|
|
26
26
|
install_plugin Capistrano::Puma::Monit # if you need the monit tasks
|
27
27
|
install_plugin Capistrano::Puma::Nginx # if you want to upload a nginx site template
|
28
28
|
```
|
29
|
+
You will need to select your service manager
|
30
|
+
```ruby
|
31
|
+
install_plugin Capistrano::Puma::Daemon # If you using puma daemonized (not supported in Puma 5+)
|
32
|
+
```
|
33
|
+
or
|
34
|
+
```ruby
|
35
|
+
install_plugin Capistrano::Puma::Systemd # if you use SystemD
|
36
|
+
```
|
29
37
|
|
30
38
|
To prevent loading the hooks of the plugin, add false to the load_hooks param.
|
31
39
|
```ruby
|
@@ -36,6 +44,15 @@ To prevent loading the hooks of the plugin, add false to the load_hooks param.
|
|
36
44
|
install_plugin Capistrano::Puma::Monit, load_hooks: false # Monit tasks without hooks
|
37
45
|
```
|
38
46
|
|
47
|
+
To make it work with rvm, rbenv and chruby, install the plugin after corresponding library inclusion.
|
48
|
+
```ruby
|
49
|
+
# Capfile
|
50
|
+
|
51
|
+
require 'capistrano/rbenv'
|
52
|
+
require 'capistrano/puma'
|
53
|
+
install_plugin Capistrano::Puma
|
54
|
+
```
|
55
|
+
|
39
56
|
### Config
|
40
57
|
|
41
58
|
To list available tasks use `cap -T`
|
@@ -44,7 +61,7 @@ To upload puma config use:
|
|
44
61
|
```ruby
|
45
62
|
cap production puma:config
|
46
63
|
```
|
47
|
-
By default the file located in `shared/puma.
|
64
|
+
By default the file located in `shared/puma.rb`
|
48
65
|
|
49
66
|
|
50
67
|
Ensure that `tmp/pids` and ` tmp/sockets log` are shared (via `linked_dirs`):
|
@@ -86,13 +103,26 @@ For Jungle tasks (beta), these options exist:
|
|
86
103
|
set :puma_run_path, '/usr/local/bin/run-puma'
|
87
104
|
```
|
88
105
|
|
106
|
+
### Systemd
|
107
|
+
|
108
|
+
Install Systemd plugin in `Capfile`:
|
109
|
+
```ruby
|
110
|
+
install_plugin Capistrano::Puma
|
111
|
+
install_plugin Capistrano::Puma::Systemd
|
112
|
+
```
|
113
|
+
|
114
|
+
To generate unit file use:
|
115
|
+
```
|
116
|
+
cap production puma:systemd:config puma:systemd:enable
|
117
|
+
```
|
118
|
+
|
89
119
|
### Multi bind
|
90
120
|
|
91
121
|
Multi-bind can be set with an array in the puma_bind variable
|
92
122
|
```ruby
|
93
123
|
set :puma_bind, %w(tcp://0.0.0.0:9292 unix:///tmp/puma.sock)
|
94
124
|
```
|
95
|
-
* Listening on tcp://0.0.0.0:
|
125
|
+
* Listening on tcp://0.0.0.0:9292
|
96
126
|
* Listening on unix:///tmp/puma.sock
|
97
127
|
|
98
128
|
### Active Record
|
@@ -127,6 +157,7 @@ Configurable options, shown here with defaults: Please note the configuration op
|
|
127
157
|
set :puma_daemonize, false
|
128
158
|
set :puma_plugins, [] #accept array of plugins
|
129
159
|
set :puma_tag, fetch(:application)
|
160
|
+
set :puma_restart_command, 'bundle exec puma'
|
130
161
|
|
131
162
|
set :nginx_config_name, "#{fetch(:application)}_#{fetch(:stage)}"
|
132
163
|
set :nginx_flags, 'fail_timeout=0'
|
@@ -135,9 +166,11 @@ Configurable options, shown here with defaults: Please note the configuration op
|
|
135
166
|
set :nginx_sites_available_path, '/etc/nginx/sites-available'
|
136
167
|
set :nginx_sites_enabled_path, '/etc/nginx/sites-enabled'
|
137
168
|
set :nginx_socket_flags, fetch(:nginx_flags)
|
138
|
-
set :nginx_ssl_certificate, "/etc/ssl/certs
|
139
|
-
set :nginx_ssl_certificate_key, "/etc/ssl/private
|
169
|
+
set :nginx_ssl_certificate, "/etc/ssl/certs/#{fetch(:nginx_config_name)}.crt"
|
170
|
+
set :nginx_ssl_certificate_key, "/etc/ssl/private/#{fetch(:nginx_config_name)}.key"
|
140
171
|
set :nginx_use_ssl, false
|
172
|
+
set :nginx_use_http2, true
|
173
|
+
set :nginx_downstream_uses_ssl, false
|
141
174
|
```
|
142
175
|
|
143
176
|
__Notes:__ If you are setting values for variables that might be used by other plugins, use `append` instead of `set`. For example:
|
data/capistrano3-puma.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
|
21
21
|
spec.add_dependency 'capistrano', '~> 3.7'
|
22
22
|
spec.add_dependency 'capistrano-bundler'
|
23
|
-
spec.add_dependency 'puma' , '
|
23
|
+
spec.add_dependency 'puma' , '>= 4.0', '< 6.0'
|
24
24
|
spec.post_install_message = %q{
|
25
25
|
All plugins need to be explicitly installed with install_plugin.
|
26
26
|
Please see README.md
|
data/lib/capistrano/puma.rb
CHANGED
@@ -76,6 +76,7 @@ module Capistrano
|
|
76
76
|
set_if_empty :puma_preload_app, false
|
77
77
|
set_if_empty :puma_daemonize, false
|
78
78
|
set_if_empty :puma_tag, ''
|
79
|
+
set_if_empty :puma_restart_command, 'bundle exec puma'
|
79
80
|
|
80
81
|
# Chruby, Rbenv and RVM integration
|
81
82
|
append :chruby_map_bins, 'puma', 'pumactl'
|
@@ -88,7 +89,6 @@ module Capistrano
|
|
88
89
|
|
89
90
|
def register_hooks
|
90
91
|
after 'deploy:check', 'puma:check'
|
91
|
-
after 'deploy:finished', 'puma:smart_restart'
|
92
92
|
end
|
93
93
|
|
94
94
|
def puma_workers
|
@@ -116,6 +116,8 @@ module Capistrano
|
|
116
116
|
end
|
117
117
|
|
118
118
|
require 'capistrano/puma/workers'
|
119
|
+
require 'capistrano/puma/daemon'
|
120
|
+
require 'capistrano/puma/systemd'
|
119
121
|
require 'capistrano/puma/monit'
|
120
122
|
require 'capistrano/puma/jungle'
|
121
123
|
require 'capistrano/puma/nginx'
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Capistrano
|
2
|
+
class Puma::Daemon < Capistrano::Plugin
|
3
|
+
include PumaCommon
|
4
|
+
|
5
|
+
def register_hooks
|
6
|
+
after 'deploy:finished', 'puma:smart_restart'
|
7
|
+
end
|
8
|
+
|
9
|
+
def define_tasks
|
10
|
+
eval_rakefile File.expand_path('../../tasks/daemon.rake', __FILE__)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -11,6 +11,8 @@ module Capistrano
|
|
11
11
|
set_if_empty :nginx_http_flags, fetch(:nginx_flags)
|
12
12
|
set_if_empty :nginx_socket_flags, fetch(:nginx_flags)
|
13
13
|
set_if_empty :nginx_use_ssl, false
|
14
|
+
set_if_empty :nginx_use_http2, true
|
15
|
+
set_if_empty :nginx_downstream_uses_ssl, false
|
14
16
|
end
|
15
17
|
|
16
18
|
def define_tasks
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Capistrano
|
2
|
+
class Puma::Systemd < Capistrano::Plugin
|
3
|
+
include PumaCommon
|
4
|
+
|
5
|
+
def register_hooks
|
6
|
+
after 'deploy:finished', 'puma:restart'
|
7
|
+
end
|
8
|
+
|
9
|
+
def define_tasks
|
10
|
+
eval_rakefile File.expand_path('../../tasks/systemd.rake', __FILE__)
|
11
|
+
end
|
12
|
+
|
13
|
+
def set_defaults
|
14
|
+
set_if_empty :puma_systemd_conf_dir, '/etc/systemd/system'
|
15
|
+
set_if_empty :puma_systemctl_bin, '/bin/systemctl'
|
16
|
+
set_if_empty :puma_service_unit_name, 'puma'
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,74 @@
|
|
1
|
+
git_plugin = self
|
2
|
+
|
3
|
+
namespace :puma do
|
4
|
+
desc 'Start puma'
|
5
|
+
task :start do
|
6
|
+
on roles(fetch(:puma_role)) do |role|
|
7
|
+
git_plugin.puma_switch_user(role) do
|
8
|
+
if test "[ -f #{fetch(:puma_pid)} ]" and test :kill, "-0 $( cat #{fetch(:puma_pid)} )"
|
9
|
+
info 'Puma is already running'
|
10
|
+
else
|
11
|
+
within current_path do
|
12
|
+
with rack_env: fetch(:puma_env) do
|
13
|
+
execute :puma, "-C #{fetch(:puma_conf)} --daemon"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
%w[halt stop status].map do |command|
|
22
|
+
desc "#{command} puma"
|
23
|
+
task command do
|
24
|
+
on roles (fetch(:puma_role)) do |role|
|
25
|
+
within current_path do
|
26
|
+
git_plugin.puma_switch_user(role) do
|
27
|
+
with rack_env: fetch(:puma_env) do
|
28
|
+
if test "[ -f #{fetch(:puma_pid)} ]"
|
29
|
+
if test :kill, "-0 $( cat #{fetch(:puma_pid)} )"
|
30
|
+
execute :pumactl, "-S #{fetch(:puma_state)} -F #{fetch(:puma_conf)} #{command}"
|
31
|
+
else
|
32
|
+
# delete invalid pid file , process is not running.
|
33
|
+
execute :rm, fetch(:puma_pid)
|
34
|
+
end
|
35
|
+
else
|
36
|
+
#pid file not found, so puma is probably not running or it using another pidfile
|
37
|
+
warn 'Puma not running'
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
%w[phased-restart restart].map do |command|
|
47
|
+
desc "#{command} puma"
|
48
|
+
task command do
|
49
|
+
on roles (fetch(:puma_role)) do |role|
|
50
|
+
within current_path do
|
51
|
+
git_plugin.puma_switch_user(role) do
|
52
|
+
with rack_env: fetch(:puma_env) do
|
53
|
+
if test "[ -f #{fetch(:puma_pid)} ]" and test :kill, "-0 $( cat #{fetch(:puma_pid)} )"
|
54
|
+
# NOTE pid exist but state file is nonsense, so ignore that case
|
55
|
+
execute :pumactl, "-S #{fetch(:puma_state)} -F #{fetch(:puma_conf)} #{command}"
|
56
|
+
else
|
57
|
+
# Puma is not running or state file is not present : Run it
|
58
|
+
invoke 'puma:start'
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
task :smart_restart do
|
68
|
+
if !fetch(:puma_preload_app) && fetch(:puma_workers, 0).to_i > 1
|
69
|
+
invoke 'puma:phased-restart'
|
70
|
+
else
|
71
|
+
invoke 'puma:restart'
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
@@ -39,7 +39,7 @@ namespace :puma do
|
|
39
39
|
task :add do
|
40
40
|
on roles(fetch(:puma_role)) do|role|
|
41
41
|
begin
|
42
|
-
sudo "/etc/init.d/puma add '#{current_path}' #{fetch(:puma_user, role.user)}"
|
42
|
+
sudo "/etc/init.d/puma add '#{current_path}' #{fetch(:puma_user, role.user)} '#{fetch(:puma_conf)}'"
|
43
43
|
rescue => error
|
44
44
|
warn error
|
45
45
|
end
|
@@ -8,75 +8,6 @@ namespace :puma do
|
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
11
|
-
desc 'Start puma'
|
12
|
-
task :start do
|
13
|
-
on roles(fetch(:puma_role)) do |role|
|
14
|
-
git_plugin.puma_switch_user(role) do
|
15
|
-
if test "[ -f #{fetch(:puma_conf)} ]"
|
16
|
-
info "using conf file #{fetch(:puma_conf)}"
|
17
|
-
else
|
18
|
-
invoke 'puma:config'
|
19
|
-
end
|
20
|
-
|
21
|
-
if test "[ -f #{fetch(:puma_pid)} ]" and test :kill, "-0 $( cat #{fetch(:puma_pid)} )"
|
22
|
-
info 'Already Puma is running'
|
23
|
-
else
|
24
|
-
within current_path do
|
25
|
-
with rack_env: fetch(:puma_env) do
|
26
|
-
execute :puma, "-C #{fetch(:puma_conf)} --daemon"
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
%w[halt stop status].map do |command|
|
35
|
-
desc "#{command} puma"
|
36
|
-
task command do
|
37
|
-
on roles (fetch(:puma_role)) do |role|
|
38
|
-
within current_path do
|
39
|
-
git_plugin.puma_switch_user(role) do
|
40
|
-
with rack_env: fetch(:puma_env) do
|
41
|
-
if test "[ -f #{fetch(:puma_pid)} ]"
|
42
|
-
if test :kill, "-0 $( cat #{fetch(:puma_pid)} )"
|
43
|
-
execute :pumactl, "-S #{fetch(:puma_state)} -F #{fetch(:puma_conf)} #{command}"
|
44
|
-
else
|
45
|
-
# delete invalid pid file , process is not running.
|
46
|
-
execute :rm, fetch(:puma_pid)
|
47
|
-
end
|
48
|
-
else
|
49
|
-
#pid file not found, so puma is probably not running or it using another pidfile
|
50
|
-
warn 'Puma not running'
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
%w[phased-restart restart].map do |command|
|
60
|
-
desc "#{command} puma"
|
61
|
-
task command do
|
62
|
-
on roles (fetch(:puma_role)) do |role|
|
63
|
-
within current_path do
|
64
|
-
git_plugin.puma_switch_user(role) do
|
65
|
-
with rack_env: fetch(:puma_env) do
|
66
|
-
if test "[ -f #{fetch(:puma_pid)} ]" and test :kill, "-0 $( cat #{fetch(:puma_pid)} )"
|
67
|
-
# NOTE pid exist but state file is nonsense, so ignore that case
|
68
|
-
execute :pumactl, "-S #{fetch(:puma_state)} -F #{fetch(:puma_conf)} #{command}"
|
69
|
-
else
|
70
|
-
# Puma is not running or state file is not present : Run it
|
71
|
-
invoke 'puma:start'
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
11
|
task :check do
|
81
12
|
on roles(fetch(:puma_role)) do |role|
|
82
13
|
#Create puma.rb for new deployments
|
@@ -87,14 +18,4 @@ namespace :puma do
|
|
87
18
|
end
|
88
19
|
end
|
89
20
|
end
|
90
|
-
|
91
|
-
|
92
|
-
task :smart_restart do
|
93
|
-
if !git_plugin.puma_preload_app? && git_plugin.puma_workers.to_i > 1
|
94
|
-
invoke 'puma:phased-restart'
|
95
|
-
else
|
96
|
-
invoke 'puma:restart'
|
97
|
-
end
|
98
|
-
end
|
99
|
-
|
100
21
|
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
git_plugin = self
|
4
|
+
|
5
|
+
namespace :puma do
|
6
|
+
namespace :systemd do
|
7
|
+
desc 'Config Puma systemd service'
|
8
|
+
task :config do
|
9
|
+
on roles(fetch(:puma_role)) do |role|
|
10
|
+
unit_filename = "#{fetch(:puma_service_unit_name)}.service"
|
11
|
+
git_plugin.template_puma 'puma.service', "#{fetch(:tmp_dir)}/#{unit_filename}", role
|
12
|
+
sudo "mv #{fetch(:tmp_dir)}/#{unit_filename} #{fetch(:puma_systemd_conf_dir)}"
|
13
|
+
sudo "#{fetch(:puma_systemctl_bin)} daemon-reload"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
desc 'Enable Puma systemd service'
|
18
|
+
task :enable do
|
19
|
+
on roles(fetch(:puma_role)) do
|
20
|
+
sudo "#{fetch(:puma_systemctl_bin)} enable #{fetch(:puma_service_unit_name)}"
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
desc 'Disable Puma systemd service'
|
25
|
+
task :disable do
|
26
|
+
on roles(fetch(:puma_role)) do
|
27
|
+
sudo "#{fetch(:puma_systemctl_bin)} disable #{fetch(:puma_service_unit_name)}"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
desc 'Start Puma service via systemd'
|
33
|
+
task :start do
|
34
|
+
on roles(fetch(:puma_role)) do
|
35
|
+
sudo "#{fetch(:puma_systemctl_bin)} start #{fetch(:puma_service_unit_name)}"
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
desc 'Stop Puma service via systemd'
|
40
|
+
task :stop do
|
41
|
+
on roles(fetch(:puma_role)) do
|
42
|
+
sudo "#{fetch(:puma_systemctl_bin)} stop #{fetch(:puma_service_unit_name)}"
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
desc 'Restart Puma service via systemd'
|
47
|
+
task :restart do
|
48
|
+
on roles(fetch(:puma_role)) do
|
49
|
+
sudo "#{fetch(:puma_systemctl_bin)} restart #{fetch(:puma_service_unit_name)}"
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
desc 'Get Puma service status via systemd'
|
54
|
+
task :status do
|
55
|
+
on roles(fetch(:puma_role)) do
|
56
|
+
sudo "#{fetch(:puma_systemctl_bin)} status #{fetch(:puma_service_unit_name)}"
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -20,8 +20,11 @@ server {
|
|
20
20
|
|
21
21
|
server {
|
22
22
|
<% if fetch(:nginx_use_ssl) -%>
|
23
|
-
|
24
|
-
ssl
|
23
|
+
<% if fetch(:nginx_use_http2) -%>
|
24
|
+
listen 443 ssl http2;
|
25
|
+
<% else -%>
|
26
|
+
listen 443 ssl;
|
27
|
+
<% end -%>
|
25
28
|
<% if fetch(:nginx_ssl_certificate) -%>
|
26
29
|
ssl_certificate <%= fetch(:nginx_ssl_certificate) %>;
|
27
30
|
<% else -%>
|
@@ -46,6 +49,7 @@ server {
|
|
46
49
|
error_page 503 @503;
|
47
50
|
|
48
51
|
location @puma_<%= fetch(:nginx_config_name) %> {
|
52
|
+
proxy_http_version 1.1;
|
49
53
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
50
54
|
proxy_set_header Host $host;
|
51
55
|
proxy_redirect off;
|
@@ -54,7 +58,11 @@ server {
|
|
54
58
|
<% if fetch(:nginx_use_ssl) -%>
|
55
59
|
proxy_set_header X-Forwarded-Proto https;
|
56
60
|
<% else -%>
|
61
|
+
<% if fetch(:nginx_downstream_uses_ssl) -%>
|
62
|
+
proxy_set_header X-Forwarded-Proto https;
|
63
|
+
<% else -%>
|
57
64
|
proxy_set_header X-Forwarded-Proto http;
|
65
|
+
<% end -%>
|
58
66
|
<% end -%>
|
59
67
|
proxy_pass http://puma_<%= fetch(:nginx_config_name) %>;
|
60
68
|
# limit_req zone=one;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
[Unit]
|
2
|
+
Description=Puma HTTP Server for <%= "#{fetch(:application)} (#{fetch(:stage)})" %>
|
3
|
+
After=network.target
|
4
|
+
|
5
|
+
[Service]
|
6
|
+
Type=simple
|
7
|
+
User=<%= puma_user(@role) %>
|
8
|
+
WorkingDirectory=<%= current_path %>
|
9
|
+
ExecStart=<%= SSHKit.config.command_map[:bundle] %> exec puma -C <%= fetch(:puma_conf) %>
|
10
|
+
ExecReload=/bin/kill -TSTP $MAINPID
|
11
|
+
ExecStop=/bin/kill -TERM $MAINPID
|
12
|
+
StandardOutput=append:<%= fetch(:puma_access_log) %>
|
13
|
+
StandardError=append:<%= fetch(:puma_error_log) %>
|
14
|
+
|
15
|
+
Restart=always
|
16
|
+
|
17
|
+
[Install]
|
18
|
+
WantedBy=multi-user.target
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano3-puma
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 5.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Abdelkader Boudih
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|
@@ -42,16 +42,22 @@ dependencies:
|
|
42
42
|
name: puma
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '4.0'
|
48
|
+
- - "<"
|
46
49
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
50
|
+
version: '6.0'
|
48
51
|
type: :runtime
|
49
52
|
prerelease: false
|
50
53
|
version_requirements: !ruby/object:Gem::Requirement
|
51
54
|
requirements:
|
52
|
-
- - "
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '4.0'
|
58
|
+
- - "<"
|
53
59
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
60
|
+
version: '6.0'
|
55
61
|
description: Puma integration for Capistrano 3
|
56
62
|
email:
|
57
63
|
- Terminale@gmail.com
|
@@ -68,20 +74,25 @@ files:
|
|
68
74
|
- Rakefile
|
69
75
|
- capistrano3-puma.gemspec
|
70
76
|
- lib/capistrano/puma.rb
|
77
|
+
- lib/capistrano/puma/daemon.rb
|
71
78
|
- lib/capistrano/puma/jungle.rb
|
72
79
|
- lib/capistrano/puma/monit.rb
|
73
80
|
- lib/capistrano/puma/nginx.rb
|
81
|
+
- lib/capistrano/puma/systemd.rb
|
74
82
|
- lib/capistrano/puma/version.rb
|
75
83
|
- lib/capistrano/puma/workers.rb
|
84
|
+
- lib/capistrano/tasks/daemon.rake
|
76
85
|
- lib/capistrano/tasks/jungle.rake
|
77
86
|
- lib/capistrano/tasks/monit.rake
|
78
87
|
- lib/capistrano/tasks/nginx.rake
|
79
88
|
- lib/capistrano/tasks/puma.rake
|
89
|
+
- lib/capistrano/tasks/systemd.rake
|
80
90
|
- lib/capistrano/tasks/workers.rake
|
81
91
|
- lib/capistrano/templates/nginx_conf.erb
|
82
92
|
- lib/capistrano/templates/puma-deb.erb
|
83
93
|
- lib/capistrano/templates/puma-rpm.erb
|
84
94
|
- lib/capistrano/templates/puma.rb.erb
|
95
|
+
- lib/capistrano/templates/puma.service.erb
|
85
96
|
- lib/capistrano/templates/puma_monit.conf.erb
|
86
97
|
- lib/capistrano/templates/run-puma.erb
|
87
98
|
- lib/capistrano3-puma.rb
|
@@ -107,9 +118,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
118
|
- !ruby/object:Gem::Version
|
108
119
|
version: '0'
|
109
120
|
requirements: []
|
110
|
-
|
111
|
-
|
112
|
-
signing_key:
|
121
|
+
rubygems_version: 3.0.3
|
122
|
+
signing_key:
|
113
123
|
specification_version: 4
|
114
124
|
summary: Puma integration for Capistrano
|
115
125
|
test_files: []
|