puma-simon 3.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (157) hide show
  1. checksums.yaml +7 -0
  2. data/.github/issue_template.md +20 -0
  3. data/.gitignore +18 -0
  4. data/.hoeignore +12 -0
  5. data/.travis.yml +29 -0
  6. data/DEPLOYMENT.md +91 -0
  7. data/Gemfile +12 -0
  8. data/History.md +1254 -0
  9. data/LICENSE +26 -0
  10. data/Manifest.txt +78 -0
  11. data/README.md +353 -0
  12. data/Rakefile +158 -0
  13. data/Release.md +9 -0
  14. data/bin/puma +10 -0
  15. data/bin/puma-wild +31 -0
  16. data/bin/pumactl +12 -0
  17. data/docs/nginx.md +80 -0
  18. data/docs/signals.md +43 -0
  19. data/docs/systemd.md +197 -0
  20. data/examples/CA/cacert.pem +23 -0
  21. data/examples/CA/newcerts/cert_1.pem +19 -0
  22. data/examples/CA/newcerts/cert_2.pem +19 -0
  23. data/examples/CA/private/cakeypair.pem +30 -0
  24. data/examples/CA/serial +1 -0
  25. data/examples/config.rb +200 -0
  26. data/examples/plugins/redis_stop_puma.rb +46 -0
  27. data/examples/puma/cert_puma.pem +19 -0
  28. data/examples/puma/client-certs/ca.crt +19 -0
  29. data/examples/puma/client-certs/ca.key +27 -0
  30. data/examples/puma/client-certs/client.crt +19 -0
  31. data/examples/puma/client-certs/client.key +27 -0
  32. data/examples/puma/client-certs/client_expired.crt +19 -0
  33. data/examples/puma/client-certs/client_expired.key +27 -0
  34. data/examples/puma/client-certs/client_unknown.crt +19 -0
  35. data/examples/puma/client-certs/client_unknown.key +27 -0
  36. data/examples/puma/client-certs/generate.rb +78 -0
  37. data/examples/puma/client-certs/keystore.jks +0 -0
  38. data/examples/puma/client-certs/server.crt +19 -0
  39. data/examples/puma/client-certs/server.key +27 -0
  40. data/examples/puma/client-certs/server.p12 +0 -0
  41. data/examples/puma/client-certs/unknown_ca.crt +19 -0
  42. data/examples/puma/client-certs/unknown_ca.key +27 -0
  43. data/examples/puma/csr_puma.pem +11 -0
  44. data/examples/puma/keystore.jks +0 -0
  45. data/examples/puma/puma_keypair.pem +15 -0
  46. data/examples/qc_config.rb +13 -0
  47. data/ext/puma_http11/PumaHttp11Service.java +17 -0
  48. data/ext/puma_http11/ext_help.h +15 -0
  49. data/ext/puma_http11/extconf.rb +15 -0
  50. data/ext/puma_http11/http11_parser.c +1069 -0
  51. data/ext/puma_http11/http11_parser.h +65 -0
  52. data/ext/puma_http11/http11_parser.java.rl +161 -0
  53. data/ext/puma_http11/http11_parser.rl +147 -0
  54. data/ext/puma_http11/http11_parser_common.rl +54 -0
  55. data/ext/puma_http11/io_buffer.c +155 -0
  56. data/ext/puma_http11/mini_ssl.c +457 -0
  57. data/ext/puma_http11/org/jruby/puma/Http11.java +234 -0
  58. data/ext/puma_http11/org/jruby/puma/Http11Parser.java +473 -0
  59. data/ext/puma_http11/org/jruby/puma/MiniSSL.java +339 -0
  60. data/ext/puma_http11/puma_http11.c +500 -0
  61. data/gemfiles/2.1-Gemfile +12 -0
  62. data/lib/puma.rb +15 -0
  63. data/lib/puma/accept_nonblock.rb +23 -0
  64. data/lib/puma/app/status.rb +66 -0
  65. data/lib/puma/binder.rb +402 -0
  66. data/lib/puma/cli.rb +220 -0
  67. data/lib/puma/client.rb +434 -0
  68. data/lib/puma/cluster.rb +510 -0
  69. data/lib/puma/commonlogger.rb +106 -0
  70. data/lib/puma/compat.rb +14 -0
  71. data/lib/puma/configuration.rb +364 -0
  72. data/lib/puma/const.rb +224 -0
  73. data/lib/puma/control_cli.rb +259 -0
  74. data/lib/puma/convenient.rb +23 -0
  75. data/lib/puma/daemon_ext.rb +31 -0
  76. data/lib/puma/delegation.rb +11 -0
  77. data/lib/puma/detect.rb +13 -0
  78. data/lib/puma/dsl.rb +486 -0
  79. data/lib/puma/events.rb +152 -0
  80. data/lib/puma/io_buffer.rb +7 -0
  81. data/lib/puma/java_io_buffer.rb +45 -0
  82. data/lib/puma/jruby_restart.rb +83 -0
  83. data/lib/puma/launcher.rb +410 -0
  84. data/lib/puma/minissl.rb +221 -0
  85. data/lib/puma/null_io.rb +42 -0
  86. data/lib/puma/plugin.rb +115 -0
  87. data/lib/puma/plugin/tmp_restart.rb +35 -0
  88. data/lib/puma/rack/backports/uri/common_193.rb +33 -0
  89. data/lib/puma/rack/builder.rb +298 -0
  90. data/lib/puma/rack/urlmap.rb +91 -0
  91. data/lib/puma/rack_default.rb +7 -0
  92. data/lib/puma/reactor.rb +210 -0
  93. data/lib/puma/runner.rb +171 -0
  94. data/lib/puma/server.rb +949 -0
  95. data/lib/puma/single.rb +112 -0
  96. data/lib/puma/state_file.rb +29 -0
  97. data/lib/puma/tcp_logger.rb +39 -0
  98. data/lib/puma/thread_pool.rb +297 -0
  99. data/lib/puma/util.rb +128 -0
  100. data/lib/rack/handler/puma.rb +78 -0
  101. data/puma.gemspec +52 -0
  102. data/test/ab_rs.rb +22 -0
  103. data/test/config.rb +2 -0
  104. data/test/config/app.rb +9 -0
  105. data/test/config/plugin.rb +1 -0
  106. data/test/config/settings.rb +2 -0
  107. data/test/config/state_file_testing_config.rb +14 -0
  108. data/test/hello-bind.ru +2 -0
  109. data/test/hello-delay.ru +3 -0
  110. data/test/hello-map.ru +3 -0
  111. data/test/hello-post.ru +4 -0
  112. data/test/hello-stuck.ru +1 -0
  113. data/test/hello-tcp.ru +5 -0
  114. data/test/hello.ru +1 -0
  115. data/test/hijack.ru +6 -0
  116. data/test/hijack2.ru +5 -0
  117. data/test/lobster.ru +4 -0
  118. data/test/shell/run.sh +24 -0
  119. data/test/shell/t1.rb +19 -0
  120. data/test/shell/t1_conf.rb +3 -0
  121. data/test/shell/t2.rb +17 -0
  122. data/test/shell/t2_conf.rb +6 -0
  123. data/test/shell/t3.rb +25 -0
  124. data/test/shell/t3_conf.rb +5 -0
  125. data/test/slow.ru +4 -0
  126. data/test/ssl_config.rb +4 -0
  127. data/test/test_app_status.rb +93 -0
  128. data/test/test_binder.rb +31 -0
  129. data/test/test_cli.rb +209 -0
  130. data/test/test_config.rb +95 -0
  131. data/test/test_events.rb +161 -0
  132. data/test/test_helper.rb +50 -0
  133. data/test/test_http10.rb +27 -0
  134. data/test/test_http11.rb +186 -0
  135. data/test/test_integration.rb +247 -0
  136. data/test/test_iobuffer.rb +39 -0
  137. data/test/test_minissl.rb +29 -0
  138. data/test/test_null_io.rb +49 -0
  139. data/test/test_persistent.rb +245 -0
  140. data/test/test_puma_server.rb +626 -0
  141. data/test/test_puma_server_ssl.rb +222 -0
  142. data/test/test_rack_handler.rb +57 -0
  143. data/test/test_rack_server.rb +138 -0
  144. data/test/test_tcp_logger.rb +39 -0
  145. data/test/test_tcp_rack.rb +36 -0
  146. data/test/test_thread_pool.rb +250 -0
  147. data/test/test_unix_socket.rb +35 -0
  148. data/test/test_web_server.rb +88 -0
  149. data/tools/jungle/README.md +9 -0
  150. data/tools/jungle/init.d/README.md +59 -0
  151. data/tools/jungle/init.d/puma +421 -0
  152. data/tools/jungle/init.d/run-puma +18 -0
  153. data/tools/jungle/upstart/README.md +61 -0
  154. data/tools/jungle/upstart/puma-manager.conf +31 -0
  155. data/tools/jungle/upstart/puma.conf +69 -0
  156. data/tools/trickletest.rb +45 -0
  157. metadata +297 -0
@@ -0,0 +1,23 @@
1
+ -----BEGIN CERTIFICATE-----
2
+ MIIDxzCCAq+gAwIBAgIBADANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJVUzEO
3
+ MAwGA1UECgwFbG9jYWwxDTALBgNVBAsMBGFlcm8xCzAJBgNVBAMMAkNBMB4XDTEy
4
+ MDExNDAwMTcyN1oXDTE3MDExMjAwMTcyN1owOTELMAkGA1UEBhMCVVMxDjAMBgNV
5
+ BAoMBWxvY2FsMQ0wCwYDVQQLDARhZXJvMQswCQYDVQQDDAJDQTCCASIwDQYJKoZI
6
+ hvcNAQEBBQADggEPADCCAQoCggEBAN8bteVsrQxfKHzYuwP1vjH2r6qavPK/agCK
7
+ bbPXZmWfUUGjL4ZT4jmnz/B6QNBBKTE/zWcuLXvyRR2FUCi8c5itUvraJVI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RPt/hYdA6G5h4zheRc3KZ7YbIwWRwlkm2w5
17
+ is4ToZKwheycaaQnUfOdHUTtZ4Kv0kRof+LMcDUDTrsydWF4T4xGxGD7/CVJkH1G
18
+ 5OTVsfv6Tw7kEMYaXYBQPs0u3GSxY3CZ+k5wATr9PBBYcArSkt5WNQYCJfO/MnWF
19
+ z/31hp/ziCIoesgo6uZMO4Dr5Pka54nc4O4KOblvUUMX07WkYGrc4nxBGvhQ5Jl4
20
+ A8dJBPCK3OlsVCnHYrDQ0cemhLOYPuiyKTtCUIs2nHuiM4RwoCRJgsVBUnKK+tTx
21
+ AkM9uQvYsrZ/DoBooBdXJQy3uiHH86zEskiy72H8Wgcu8GbLt2JgCyhXkwDzrIRf
22
+ hnAN4FS2VNOt5dDTVHBWG1vIxxlM2+LrYpY/QqihNgotZ+C4VWHkoDwbF478JgxM
23
+ 5Yk+0X9kGvLQbZCJFXdAKAyr/AzRH+Hx1cDvSi7gypf8qOEZwD1rq7f0qw8jnqfG
24
+ 3QIFoN1/+xTAV8lTlGhvbQYz1XHVBH9l7TSQDLIrnwHTIv+PdZbTveGftCCnLdDo
25
+ wBLBnw4mKVCtnHrEgXMQF62yuwueQ8zhdh8jf3osYV/COlRZwQQGgZtnQCeeyDIh
26
+ 8GJR9b4uv22QDNv7J2vcqTEWJdnpAZvIBFGuCBCAgev+URLGW2ELXfWQwNgc5+yP
27
+ nGRXo+IwD1uhvEqtuin+cAn/sJhOa66g0ZcV/3AcrdQhbicn12YM71cMvA/XRKf5
28
+ rpo8bAEwDqyoFoywH4IHM3HNV45rS+brskz6tZC5ELondCPVmUqgVu7ELHlJfPXx
29
+ RbzbMPJEGr8WjWUiTDhrD2vWgoJ6NRKkDAUYm6KQb8Sbajd2JAAlYntLz5jKqNqN
30
+ -----END RSA PRIVATE KEY-----
@@ -0,0 +1 @@
1
+ 0003
@@ -0,0 +1,200 @@
1
+ #!/usr/bin/env puma
2
+
3
+ # The directory to operate out of.
4
+ #
5
+ # The default is the current directory.
6
+ #
7
+ # directory '/u/apps/lolcat'
8
+
9
+ # Use an object or block as the rack application. This allows the
10
+ # config file to be the application itself.
11
+ #
12
+ # app do |env|
13
+ # puts env
14
+ #
15
+ # body = 'Hello, World!'
16
+ #
17
+ # [200, { 'Content-Type' => 'text/plain', 'Content-Length' => body.length.to_s }, [body]]
18
+ # end
19
+
20
+ # Load "path" as a rackup file.
21
+ #
22
+ # The default is "config.ru".
23
+ #
24
+ # rackup '/u/apps/lolcat/config.ru'
25
+
26
+ # Set the environment in which the rack's app will run. The value must be a string.
27
+ #
28
+ # The default is "development".
29
+ #
30
+ # environment 'production'
31
+
32
+ # Daemonize the server into the background. Highly suggest that
33
+ # this be combined with "pidfile" and "stdout_redirect".
34
+ #
35
+ # The default is "false".
36
+ #
37
+ # daemonize
38
+ # daemonize false
39
+
40
+ # Store the pid of the server in the file at "path".
41
+ #
42
+ # pidfile '/u/apps/lolcat/tmp/pids/puma.pid'
43
+
44
+ # Use "path" as the file to store the server info state. This is
45
+ # used by "pumactl" to query and control the server.
46
+ #
47
+ # state_path '/u/apps/lolcat/tmp/pids/puma.state'
48
+
49
+ # Redirect STDOUT and STDERR to files specified. The 3rd parameter
50
+ # ("append") specifies whether the output is appended, the default is
51
+ # "false".
52
+ #
53
+ # stdout_redirect '/u/apps/lolcat/log/stdout', '/u/apps/lolcat/log/stderr'
54
+ # stdout_redirect '/u/apps/lolcat/log/stdout', '/u/apps/lolcat/log/stderr', true
55
+
56
+ # Disable request logging.
57
+ #
58
+ # The default is "false".
59
+ #
60
+ # quiet
61
+
62
+ # Configure "min" to be the minimum number of threads to use to answer
63
+ # requests and "max" the maximum.
64
+ #
65
+ # The default is "0, 16".
66
+ #
67
+ # threads 0, 16
68
+
69
+ # Bind the server to "url". "tcp://", "unix://" and "ssl://" are the only
70
+ # accepted protocols.
71
+ #
72
+ # The default is "tcp://0.0.0.0:9292".
73
+ #
74
+ # bind 'tcp://0.0.0.0:9292'
75
+ # bind 'unix:///var/run/puma.sock'
76
+ # bind 'unix:///var/run/puma.sock?umask=0111'
77
+ # bind 'ssl://127.0.0.1:9292?key=path_to_key&cert=path_to_cert'
78
+
79
+ # Instead of "bind 'ssl://127.0.0.1:9292?key=path_to_key&cert=path_to_cert'" you
80
+ # can also use the "ssl_bind" option.
81
+ #
82
+ # ssl_bind '127.0.0.1', '9292', {
83
+ # key: path_to_key,
84
+ # cert: path_to_cert
85
+ # }
86
+ # for JRuby additional keys are required:
87
+ # keystore: path_to_keystore,
88
+ # keystore_pass: password
89
+
90
+ # Code to run before doing a restart. This code should
91
+ # close log files, database connections, etc.
92
+ #
93
+ # This can be called multiple times to add code each time.
94
+ #
95
+ # on_restart do
96
+ # puts 'On restart...'
97
+ # end
98
+
99
+ # Command to use to restart puma. This should be just how to
100
+ # load puma itself (ie. 'ruby -Ilib bin/puma'), not the arguments
101
+ # to puma, as those are the same as the original process.
102
+ #
103
+ # restart_command '/u/app/lolcat/bin/restart_puma'
104
+
105
+ # === Cluster mode ===
106
+
107
+ # How many worker processes to run. Typically this is set to
108
+ # to the number of available cores.
109
+ #
110
+ # The default is "0".
111
+ #
112
+ # workers 2
113
+
114
+ # Code to run immediately before the master starts workers.
115
+ #
116
+ # before_fork do
117
+ # puts "Starting workers..."
118
+ # end
119
+
120
+ # Code to run in a worker before it starts serving requests.
121
+ #
122
+ # This is called everytime a worker is to be started.
123
+ #
124
+ # on_worker_boot do
125
+ # puts 'On worker boot...'
126
+ # end
127
+
128
+ # Code to run in a worker right before it exits.
129
+ #
130
+ # This is called everytime a worker is to about to shutdown.
131
+ #
132
+ # on_worker_shutdown do
133
+ # puts 'On worker shutdown...'
134
+ # end
135
+
136
+ # Code to run in the master right before a worker is started. The worker's
137
+ # index is passed as an argument.
138
+ #
139
+ # This is called everytime a worker is to be started.
140
+ #
141
+ # on_worker_fork do
142
+ # puts 'Before worker fork...'
143
+ # end
144
+
145
+ # Code to run in the master after a worker has been started. The worker's
146
+ # index is passed as an argument.
147
+ #
148
+ # This is called everytime a worker is to be started.
149
+ #
150
+ # after_worker_fork do
151
+ # puts 'After worker fork...'
152
+ # end
153
+
154
+ # Allow workers to reload bundler context when master process is issued
155
+ # a USR1 signal. This allows proper reloading of gems while the master
156
+ # is preserved across a phased-restart. (incompatible with preload_app)
157
+ # (off by default)
158
+
159
+ # prune_bundler
160
+
161
+ # Preload the application before starting the workers; this conflicts with
162
+ # phased restart feature. (off by default)
163
+
164
+ # preload_app!
165
+
166
+ # Additional text to display in process listing
167
+ #
168
+ # tag 'app name'
169
+ #
170
+ # If you do not specify a tag, Puma will infer it. If you do not want Puma
171
+ # to add a tag, use an empty string.
172
+
173
+ # Verifies that all workers have checked in to the master process within
174
+ # the given timeout. If not the worker process will be restarted. This is
175
+ # not a request timeout, it is to protect against a hung or dead process.
176
+ # Setting this value will not protect against slow requests.
177
+ # Default value is 60 seconds.
178
+ #
179
+ # worker_timeout 60
180
+
181
+ # Change the default worker timeout for booting
182
+ #
183
+ # If unspecified, this defaults to the value of worker_timeout.
184
+ #
185
+ # worker_boot_timeout 60
186
+
187
+ # === Puma control rack application ===
188
+
189
+ # Start the puma control rack application on "url". This application can
190
+ # be communicated with to control the main server. Additionally, you can
191
+ # provide an authentication token, so all requests to the control server
192
+ # will need to include that token as a query parameter. This allows for
193
+ # simple authentication.
194
+ #
195
+ # Check out https://github.com/puma/puma/blob/master/lib/puma/app/status.rb
196
+ # to see what the app has available.
197
+ #
198
+ # activate_control_app 'unix:///var/run/pumactl.sock'
199
+ # activate_control_app 'unix:///var/run/pumactl.sock', { auth_token: '12345' }
200
+ # activate_control_app 'unix:///var/run/pumactl.sock', { no_token: true }
@@ -0,0 +1,46 @@
1
+ require 'puma/plugin'
2
+ require 'redis'
3
+
4
+ # How to stop Puma on Heroku
5
+ # - You can't use normal methods because the dyno is not accessible
6
+ # - There's no file system, no way to send signals
7
+ # but ...
8
+ # - You can use Redis or Memcache; any network distributed key-value
9
+ # store
10
+
11
+ # 1. Add this plugin to your 'lib' directory
12
+ # 2. In the `puma.rb` config file add the following lines
13
+ # === Plugins ===
14
+ # require './lib/puma/plugins/redis_stop_puma'
15
+ # plugin 'redis_stop_puma'
16
+ # 3. Now, when you set the redis key "puma::restart::web.1", your web.1 dyno
17
+ # will restart
18
+ # 4. Sniffing the Heroku logs for R14 errors is application (and configuration)
19
+ # specific. I use the Logentries service, watch for the pattern and the call
20
+ # a webhook back into my app to set the Redis key. YMMV
21
+
22
+ # You can test this locally by setting the DYNO environment variable when
23
+ # when starting puma, e.g. `DYNO=pants.1 puma`
24
+
25
+ Puma::Plugin.create do
26
+ def start(launcher)
27
+
28
+ hostname = ENV['DYNO']
29
+ return unless hostname
30
+
31
+ redis = Redis.new(url: ENV.fetch('REDIS_URL', nil))
32
+ return unless redis.ping == 'PONG'
33
+
34
+ in_background do
35
+ while true
36
+ sleep 2
37
+ if message = redis.get("puma::restart::#{hostname}")
38
+ redis.del("puma::restart::#{hostname}")
39
+ $stderr.puts message
40
+ launcher.stop
41
+ break
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,19 @@
1
+ -----BEGIN CERTIFICATE-----
2
+ MIIC/jCCAeagAwIBAgIBAjANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJVUzEO
3
+ MAwGA1UECgwFbG9jYWwxDTALBgNVBAsMBGFlcm8xCzAJBgNVBAMMAkNBMB4XDTEy
4
+ MDExNDAwMjcyN1oXDTEzMDExMzAwMjcyN1owSDELMAkGA1UEBhMCVVMxDjAMBgNV
5
+ BAoMBWxvY2FsMQ0wCwYDVQQLDARhZXJvMQswCQYDVQQLDAJDQTENMAsGA1UEAwwE
6
+ cHVtYTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEArxfNMp+g/pKhsDEkB3KR
7
+ 1MAkbfnN/UKMvfXwlnXpz7YX1LHHnMutiI/PqymAp6BPcu+umuW2qMHQyqqtyATm
8
+ Z9jr3t837nhmxwG1noRaKRtsckn9FD43ZlpPg0Q5QnhS4oOsXwJ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