puma 5.0.4 → 5.2.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of puma might be problematic. Click here for more details.

Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/History.md +109 -48
  3. data/README.md +48 -18
  4. data/docs/architecture.md +21 -18
  5. data/docs/compile_options.md +19 -0
  6. data/docs/deployment.md +1 -1
  7. data/docs/fork_worker.md +2 -0
  8. data/docs/kubernetes.md +66 -0
  9. data/docs/plugins.md +1 -1
  10. data/docs/rails_dev_mode.md +29 -0
  11. data/docs/stats.md +142 -0
  12. data/docs/systemd.md +24 -2
  13. data/ext/puma_http11/extconf.rb +18 -5
  14. data/ext/puma_http11/http11_parser.c +45 -47
  15. data/ext/puma_http11/http11_parser.java.rl +1 -1
  16. data/ext/puma_http11/http11_parser.rl +1 -1
  17. data/ext/puma_http11/mini_ssl.c +162 -84
  18. data/ext/puma_http11/org/jruby/puma/Http11Parser.java +5 -7
  19. data/ext/puma_http11/puma_http11.c +8 -2
  20. data/lib/puma.rb +20 -10
  21. data/lib/puma/app/status.rb +4 -7
  22. data/lib/puma/binder.rb +60 -24
  23. data/lib/puma/cli.rb +4 -0
  24. data/lib/puma/client.rb +4 -9
  25. data/lib/puma/cluster.rb +10 -6
  26. data/lib/puma/cluster/worker.rb +8 -2
  27. data/lib/puma/cluster/worker_handle.rb +5 -2
  28. data/lib/puma/configuration.rb +14 -1
  29. data/lib/puma/const.rb +11 -3
  30. data/lib/puma/control_cli.rb +73 -70
  31. data/lib/puma/detect.rb +14 -10
  32. data/lib/puma/dsl.rb +104 -22
  33. data/lib/puma/error_logger.rb +10 -3
  34. data/lib/puma/events.rb +18 -3
  35. data/lib/puma/json.rb +96 -0
  36. data/lib/puma/launcher.rb +52 -6
  37. data/lib/puma/minissl.rb +48 -17
  38. data/lib/puma/minissl/context_builder.rb +6 -0
  39. data/lib/puma/null_io.rb +12 -0
  40. data/lib/puma/reactor.rb +19 -12
  41. data/lib/puma/request.rb +20 -7
  42. data/lib/puma/runner.rb +19 -7
  43. data/lib/puma/server.rb +20 -75
  44. data/lib/puma/state_file.rb +5 -3
  45. data/lib/puma/systemd.rb +46 -0
  46. data/lib/rack/handler/puma.rb +1 -0
  47. metadata +12 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 88dc01e1628aacb4ee705cc2ab0ecda793913c284737acf93c92674b45a8ec93
4
- data.tar.gz: bcfb46e65dc12b753628656ed7450643a6e6b2a451e2024c872275aa72f28422
3
+ metadata.gz: 472ee56cda171d14d1ba6dee3f83d6b5cce8458e6346d36443295c6aae8ca243
4
+ data.tar.gz: 625953f46071794b66b44974a74a4382015ecef0ce85b629cf7448935d1f15c8
5
5
  SHA512:
6
- metadata.gz: 0b5815aa75f4b0f0af4e8e1a2ecb3f46d7fc9e9c6c9f340f5ee8b4c4f1def02d24736a685520699ed46946557a7b1355ff1df765fd7670fb8ecbbc5d4df5eb64
7
- data.tar.gz: f4294d0f1c811b4e230fa42162be39abab57c6c14d0c2b81a887893a997e8864b3afe9e06c32a2f5185166cfa680b6c1f66c473ef7f839c1430f41248f782793
6
+ metadata.gz: b8510e5f6e17815d2d36be57806f70294d4796cf7a63c7c9e76cfc31454f314b46da8ab3a83b2f35436e4ae98a1a138dbb20c9f75fee89a41edeeb5689459ff4
7
+ data.tar.gz: ef268e432c892a993831786227eee70ab3c013b5aaf306538e603a405cbc40457dffd961acfefa98a0fef6117f4b6463634f60fd4a5e111c79f361f7e5ae28e4
data/History.md CHANGED
@@ -1,19 +1,70 @@
1
- ## 5.1.0
1
+ ## 5.2.2 / 2021-02-22
2
+
3
+ * Bugfixes
4
+ * Add `#flush` and `#sync` methods to `Puma::NullIO` ([#2553])
5
+ * Restore `sync=true` on `STDOUT` and `STDERR` streams ([#2557])
6
+
7
+ ## 5.2.1 / 2021-02-05
8
+
9
+ * Bugfixes
10
+ * Fix TCP cork/uncork operations to work with ssl clients ([#2550])
11
+ * Require rack/common_logger explicitly if :verbose is true ([#2547])
12
+ * MiniSSL::Socket#write - use data.byteslice(wrote..-1) ([#2543])
13
+ * Set `@env[CONTENT_LENGTH]` value as string. ([#2549])
14
+
15
+ ## 5.2.0 / 2021-01-27
2
16
 
3
17
  * Features
4
- * Your feature goes here <Most recent on the top, like GitHub> (#Github Number)
5
- * Integrate with systemd's watchdog and notification features (#2438)
6
- * Adds max_fast_inline as a configuration option for the Server object (#2406)
18
+ * 10x latency improvement for MRI on ssl connections by reducing overhead ([#2519])
19
+ * Add option to specify the desired IO selector backend for libev ([#2522])
20
+ * Add ability to set OpenSSL verification flags (MRI only) ([#2490])
21
+ * Uses `flush` after writing messages to avoid mutating $stdout and $stderr using `sync=true` ([#2486])
7
22
 
8
23
  * Bugfixes
9
- * Your bugfix goes here <Most recent on the top, like GitHub> (#Github Number)
10
- * Ignore illegal (by Rack spec) response header (#2439)
11
- * Close idle connections immediately on shutdown (#2460)
24
+ * MiniSSL - Update dhparam to 2048 bit for use with SSL_CTX_set_tmp_dh ([#2535])
25
+ * Change 'Goodbye!' message to be output after listeners are closed ([#2529])
26
+ * Fix ssl bind logging with 0.0.0.0 and localhost ([#2533])
27
+ * Fix compiler warnings, but skipped warnings related to ragel state machine generated code ([#1953])
28
+ * Fix phased restart errors related to nio4r gem when using the Puma control server ([#2516])
29
+ * Add `#string` method to `Puma::NullIO` ([#2520])
30
+ * Fix binding via Rack handler to IPv6 addresses ([#2521])
31
+
32
+ * Refactor
33
+ * Refactor MiniSSL::Context on MRI, fix MiniSSL::Socket#write ([#2519])
34
+ * Remove `Server#read_body` ([#2531])
35
+ * Fail build if compiling extensions raises warnings on GH Actions, configurable via `MAKE_WARNINGS_INTO_ERRORS` ([#1953])
36
+
37
+ ## 5.1.1 / 2020-12-10
38
+
39
+ * Bugfixes
40
+ * Fix over eager matching against banned header names ([#2510])
41
+
42
+ ## 5.1.0 / 2020-11-30
43
+
44
+ * Features
45
+ * Phased restart availability is now always logged, even if it is not available.
46
+ * Prints the loaded configuration if the environment variable `PUMA_LOG_CONFIG` is present ([#2472])
47
+ * Integrate with systemd's watchdog and notification features ([#2438])
48
+ * Adds max_fast_inline as a configuration option for the Server object ([#2406])
49
+ * You can now fork workers from worker 0 using SIGURG w/o fork_worker enabled [#2449]
50
+ * Add option to bind to systemd activated sockets ([#2362])
51
+ * Add compile option to change the `QUERY_STRING` max length ([#2485])
52
+
53
+ * Bugfixes
54
+ * Fix JRuby handling in Puma::DSL#ssl_bind ([#2489])
55
+ * control_cli.rb - all normal output should be to @stdout ([#2487])
56
+ * Catch 'Error in reactor loop escaped: mode not supported for this object: r' ([#2477])
57
+ * Ignore Rails' reaper thread (and any thread marked forksafe) for warning ([#2475])
58
+ * Ignore illegal (by Rack spec) response header ([#2439])
59
+ * Close idle connections immediately on shutdown ([#2460])
60
+ * Fix some instances of phased restart errors related to the `json` gem ([#2473])
61
+ * Remove use of `json` gem to fix phased restart errors ([#2479])
62
+ * Fix grouping regexp of ILLEGAL_HEADER_KEY_REGEX ([#2495])
12
63
 
13
64
  ## 5.0.4 / 2020-10-27
14
65
 
15
66
  * Bugfixes
16
- * Pass preloaded application into new workers if available when using `preload_app` (#2461)
67
+ * Pass preloaded application into new workers if available when using `preload_app` ([#2461], [#2454])
17
68
 
18
69
  ## 5.0.3 / 2020-10-26
19
70
 
@@ -21,7 +72,7 @@
21
72
  * Add Client#io_ok?, check before Reactor#register ([#2432])
22
73
  * Fix hang on shutdown in refork ([#2442])
23
74
  * Fix `Bundler::GemNotFound` errors for `nio4r` gem during phased restarts ([#2427], [#2018])
24
- * Server run thread safety fix ([#2435])
75
+ * Server run thread safety fix ([#2435])
25
76
  * Fire `on_booted` after server starts ([#2431], [#2212])
26
77
  * Cleanup daemonization in rc.d script ([#2409])
27
78
 
@@ -33,11 +84,12 @@
33
84
  * client.rb - remove JRuby specific 'finish' code ([#2412])
34
85
  * Consolidate fast_write calls in Server, extract early_hints assembly ([#2405])
35
86
  * Remove upstart from docs ([#2408])
87
+ * Extract worker process into separate class ([#2374])
36
88
  * Consolidate option handling in Server, Server small refactors, doc changes ([#2389])
37
89
 
38
90
  ## 5.0.2 / 2020-09-28
39
91
 
40
- * Bugfixes
92
+ * Bugfixes
41
93
  * Reverted API changes to Server.
42
94
 
43
95
  ## 5.0.1 / 2020-09-28
@@ -76,13 +128,13 @@
76
128
  * min_threads now set by environment variables PUMA_MIN_THREADS and MIN_THREADS. ([#2143])
77
129
  * max_threads now set by environment variables PUMA_MAX_THREADS and MAX_THREADS. ([#2143])
78
130
  * max_threads default to 5 in MRI or 16 for all other interpreters. ([#2143])
79
- * preload by default if workers > 1 ([#2143])
131
+ * `preload_app!` is on by default if number of workers > 1 and set via `WEB_CONCURRENCY` ([#2143])
80
132
  * Puma::Plugin.workers_supported? has been removed. Use Puma.forkable? instead. ([#2143])
81
133
  * `tcp_mode` has been removed without replacement. ([#2169])
82
134
  * Daemonization has been removed without replacement. ([#2170])
83
135
  * Changed #connected_port to #connected_ports ([#2076])
84
136
  * Configuration: `environment` is read from `RAILS_ENV`, if `RACK_ENV` can't be found ([#2022])
85
- * Log binding on http:// for TCP bindings to make it clickable
137
+ * Log binding on http:// for TCP bindings to make it clickable ([#2300])
86
138
 
87
139
  * Bugfixes
88
140
  * Fix JSON loading issues on phased-restarts ([#2269])
@@ -128,6 +180,11 @@
128
180
  * Support parallel tests in verbose progress reporting ([#2223])
129
181
  * Refactor error handling in server accept loop ([#2239])
130
182
 
183
+ ## 4.3.7 / 2020-11-30
184
+
185
+ * Bugfixes
186
+ * Backport set CONTENT_LENGTH for chunked requests (Originally: [#2287], backport: [#2496])
187
+
131
188
  ## 4.3.6 / 2020-09-05
132
189
 
133
190
  * Bugfixes
@@ -1651,6 +1708,42 @@ be added back in a future date when a java Puma::MiniSSL is added.
1651
1708
  * Bugfixes
1652
1709
  * Your bugfix goes here <Most recent on the top, like GitHub> (#Github Number)
1653
1710
 
1711
+ [#2557]:https://github.com/puma/puma/pull/2557 "PR by @cjlarose, merged 2021-02-22"
1712
+ [#2553]:https://github.com/puma/puma/pull/2553 "PR by @olivierbellone, merged 02-10-22"
1713
+ [#2550]:https://github.com/puma/puma/pull/2550 "PR by @MSP-Greg, merged 2021-02-05"
1714
+ [#2547]:https://github.com/puma/puma/pull/2547 "PR by @wildmaples, merged 2021-02-03"
1715
+ [#2543]:https://github.com/puma/puma/pull/2543 "PR by @MSP-Greg, merged 2021-02-01"
1716
+ [#2549]:https://github.com/puma/puma/pull/2549 "PR by @nmb, merged 2021-02-04"
1717
+ [#2519]:https://github.com/puma/puma/pull/2519 "PR by @MSP-Greg, merged 2021-01-26"
1718
+ [#2522]:https://github.com/puma/puma/pull/2522 "PR by @jcmfernandes, merged 2021-01-12"
1719
+ [#2490]:https://github.com/puma/puma/pull/2490 "PR by @Bonias, merged 2020-12-07"
1720
+ [#2486]:https://github.com/puma/puma/pull/2486 "PR by @ccverak, merged 2020-12-02"
1721
+ [#2535]:https://github.com/puma/puma/pull/2535 "PR by @MSP-Greg, merged 2021-01-27"
1722
+ [#2529]:https://github.com/puma/puma/pull/2529 "PR by @MSP-Greg, merged 2021-01-24"
1723
+ [#2533]:https://github.com/puma/puma/pull/2533 "PR by @MSP-Greg, merged 2021-01-24"
1724
+ [#1953]:https://github.com/puma/puma/issues/1953 "Issue by @nateberkopec, closed 2020-12-01"
1725
+ [#2516]:https://github.com/puma/puma/pull/2516 "PR by @cjlarose, merged 2020-12-17"
1726
+ [#2520]:https://github.com/puma/puma/pull/2520 "PR by @dentarg, merged 2021-01-04"
1727
+ [#2521]:https://github.com/puma/puma/pull/2521 "PR by @ojab, merged 2021-01-04"
1728
+ [#2531]:https://github.com/puma/puma/pull/2531 "PR by @wjordan, merged 2021-01-19"
1729
+ [#2510]:https://github.com/puma/puma/pull/2510 "PR by @micke, merged 2020-12-10"
1730
+ [#2472]:https://github.com/puma/puma/pull/2472 "PR by @ccverak, merged 2020-11-02"
1731
+ [#2438]:https://github.com/puma/puma/pull/2438 "PR by @ekohl, merged 2020-10-26"
1732
+ [#2406]:https://github.com/puma/puma/pull/2406 "PR by @fdel15, merged 2020-10-19"
1733
+ [#2449]:https://github.com/puma/puma/pull/2449 "PR by @MSP-Greg, merged 2020-10-28"
1734
+ [#2362]:https://github.com/puma/puma/pull/2362 "PR by @ekohl, merged 2020-11-10"
1735
+ [#2485]:https://github.com/puma/puma/pull/2485 "PR by @elct9620, merged 2020-11-18"
1736
+ [#2489]:https://github.com/puma/puma/pull/2489 "PR by @MSP-Greg, merged 2020-11-27"
1737
+ [#2487]:https://github.com/puma/puma/pull/2487 "PR by @MSP-Greg, merged 2020-11-17"
1738
+ [#2477]:https://github.com/puma/puma/pull/2477 "PR by @MSP-Greg, merged 2020-11-16"
1739
+ [#2475]:https://github.com/puma/puma/pull/2475 "PR by @nateberkopec, merged 2020-11-02"
1740
+ [#2439]:https://github.com/puma/puma/pull/2439 "PR by @kuei0221, merged 2020-10-26"
1741
+ [#2460]:https://github.com/puma/puma/pull/2460 "PR by @cjlarose, merged 2020-10-27"
1742
+ [#2473]:https://github.com/puma/puma/pull/2473 "PR by @cjlarose, merged 2020-11-01"
1743
+ [#2479]:https://github.com/puma/puma/pull/2479 "PR by @cjlarose, merged 2020-11-10"
1744
+ [#2495]:https://github.com/puma/puma/pull/2495 "PR by @JuanitoFatas, merged 2020-11-27"
1745
+ [#2461]:https://github.com/puma/puma/pull/2461 "PR by @cjlarose, merged 2020-10-27"
1746
+ [#2454]:https://github.com/puma/puma/issues/2454 "Issue by @majksner, closed 2020-10-27"
1654
1747
  [#2432]:https://github.com/puma/puma/pull/2432 "PR by @MSP-Greg, merged 2020-10-25"
1655
1748
  [#2442]:https://github.com/puma/puma/pull/2442 "PR by @wjordan, merged 2020-10-22"
1656
1749
  [#2427]:https://github.com/puma/puma/pull/2427 "PR by @cjlarose, merged 2020-10-20"
@@ -1666,22 +1759,7 @@ be added back in a future date when a java Puma::MiniSSL is added.
1666
1759
  [#2412]:https://github.com/puma/puma/pull/2412 "PR by @MSP-Greg, merged 2020-10-06"
1667
1760
  [#2405]:https://github.com/puma/puma/pull/2405 "PR by @MSP-Greg, merged 2020-10-05"
1668
1761
  [#2408]:https://github.com/puma/puma/pull/2408 "PR by @fliiiix, merged 2020-10-03"
1669
- [#2389]:https://github.com/puma/puma/pull/2389 "PR by @MSP-Greg, merged 2020-09-29"
1670
- [#2432]:https://github.com/puma/puma/pull/2432 "PR by @MSP-Greg, merged 2020-10-25"
1671
- [#2442]:https://github.com/puma/puma/pull/2442 "PR by @wjordan, merged 2020-10-22"
1672
- [#2427]:https://github.com/puma/puma/pull/2427 "PR by @cjlarose, merged 2020-10-20"
1673
- [#2018]:https://github.com/puma/puma/issues/2018 "Issue by @gingerlime, closed 2020-10-20"
1674
- [#2435]:https://github.com/puma/puma/pull/2435 "PR by @wjordan, merged 2020-10-20"
1675
- [#2431]:https://github.com/puma/puma/pull/2431 "PR by @wjordan, merged 2020-10-16"
1676
- [#2212]:https://github.com/puma/puma/issues/2212 "Issue by @junaruga, closed 2020-10-16"
1677
- [#2409]:https://github.com/puma/puma/pull/2409 "PR by @fliiiix, merged 2020-10-03"
1678
- [#2448]:https://github.com/puma/puma/pull/2448 "PR by @MSP-Greg, merged 2020-10-25"
1679
- [#2450]:https://github.com/puma/puma/pull/2450 "PR by @MSP-Greg, merged 2020-10-25"
1680
- [#2419]:https://github.com/puma/puma/pull/2419 "PR by @MSP-Greg, merged 2020-10-09"
1681
- [#2279]:https://github.com/puma/puma/pull/2279 "PR by @wjordan, merged 2020-10-06"
1682
- [#2412]:https://github.com/puma/puma/pull/2412 "PR by @MSP-Greg, merged 2020-10-06"
1683
- [#2405]:https://github.com/puma/puma/pull/2405 "PR by @MSP-Greg, merged 2020-10-05"
1684
- [#2408]:https://github.com/puma/puma/pull/2408 "PR by @fliiiix, merged 2020-10-03"
1762
+ [#2374]:https://github.com/puma/puma/pull/2374 "PR by @cjlarose, merged 2020-09-29"
1685
1763
  [#2389]:https://github.com/puma/puma/pull/2389 "PR by @MSP-Greg, merged 2020-09-29"
1686
1764
  [#2381]:https://github.com/puma/puma/pull/2381 "PR by @joergschray, merged 2020-09-24"
1687
1765
  [#2271]:https://github.com/puma/puma/pull/2271 "PR by @wjordan, merged 2020-09-24"
@@ -1708,14 +1786,11 @@ be added back in a future date when a java Puma::MiniSSL is added.
1708
1786
  [#2288]:https://github.com/puma/puma/pull/2288 "PR by @FTLam11, merged 2020-06-02"
1709
1787
  [#1487]:https://github.com/puma/puma/pull/1487 "PR by @jxa, merged 2018-05-09"
1710
1788
  [#2143]:https://github.com/puma/puma/pull/2143 "PR by @jalevin, merged 2020-04-21"
1711
- [#2143]:https://github.com/puma/puma/pull/2143 "PR by @jalevin, merged 2020-04-21"
1712
- [#2143]:https://github.com/puma/puma/pull/2143 "PR by @jalevin, merged 2020-04-21"
1713
- [#2143]:https://github.com/puma/puma/pull/2143 "PR by @jalevin, merged 2020-04-21"
1714
- [#2143]:https://github.com/puma/puma/pull/2143 "PR by @jalevin, merged 2020-04-21"
1715
1789
  [#2169]:https://github.com/puma/puma/pull/2169 "PR by @nateberkopec, merged 2020-03-10"
1716
1790
  [#2170]:https://github.com/puma/puma/pull/2170 "PR by @nateberkopec, merged 2020-03-10"
1717
1791
  [#2076]:https://github.com/puma/puma/pull/2076 "PR by @drews256, merged 2020-02-27"
1718
1792
  [#2022]:https://github.com/puma/puma/pull/2022 "PR by @olleolleolle, merged 2019-11-11"
1793
+ [#2300]:https://github.com/puma/puma/pull/2300 "PR by @alexeevit, merged 2020-07-06"
1719
1794
  [#2269]:https://github.com/puma/puma/pull/2269 "PR by @MSP-Greg, merged 2020-08-31"
1720
1795
  [#2312]:https://github.com/puma/puma/pull/2312 "PR by @MSP-Greg, merged 2020-07-20"
1721
1796
  [#2338]:https://github.com/puma/puma/issues/2338 "Issue by @micahhainlinestitchfix, closed 2020-08-18"
@@ -1732,7 +1807,6 @@ be added back in a future date when a java Puma::MiniSSL is added.
1732
1807
  [#2198]:https://github.com/puma/puma/pull/2198 "PR by @eregon, merged 2020-03-24"
1733
1808
  [#2216]:https://github.com/puma/puma/pull/2216 "PR by @praboud-stripe, merged 2020-04-06"
1734
1809
  [#2122]:https://github.com/puma/puma/pull/2122 "PR by @wjordan, merged 2020-04-10"
1735
- [#2220]:https://github.com/puma/puma/pull/2220 "PR by @wjordan, merged 2020-04-14"
1736
1810
  [#2177]:https://github.com/puma/puma/issues/2177 "Issue by @GuiTeK, closed 2020-04-08"
1737
1811
  [#2221]:https://github.com/puma/puma/pull/2221 "PR by @wjordan, merged 2020-04-17"
1738
1812
  [#2233]:https://github.com/puma/puma/pull/2233 "PR by @ayufan, merged 2020-04-25"
@@ -1741,7 +1815,6 @@ be added back in a future date when a java Puma::MiniSSL is added.
1741
1815
  [#2267]:https://github.com/puma/puma/pull/2267 "PR by @wjordan, merged 2020-05-20"
1742
1816
  [#2287]:https://github.com/puma/puma/pull/2287 "PR by @eugeneius, merged 2020-05-31"
1743
1817
  [#2317]:https://github.com/puma/puma/pull/2317 "PR by @MSP-Greg, merged 2020-09-01"
1744
- [#2312]:https://github.com/puma/puma/pull/2312 "PR by @MSP-Greg, merged 2020-07-20"
1745
1818
  [#2319]:https://github.com/puma/puma/issues/2319 "Issue by @AlexWayfer, closed 2020-09-03"
1746
1819
  [#2326]:https://github.com/puma/puma/pull/2326 "PR by @rkistner, closed 2020-09-04"
1747
1820
  [#2299]:https://github.com/puma/puma/issues/2299 "Issue by @JohnPhillips31416, closed 2020-09-17"
@@ -1750,12 +1823,11 @@ be added back in a future date when a java Puma::MiniSSL is added.
1750
1823
  [#2111]:https://github.com/puma/puma/pull/2111 "PR by @wjordan, merged 2020-02-20"
1751
1824
  [#1980]:https://github.com/puma/puma/pull/1980 "PR by @nateberkopec, merged 2020-02-27"
1752
1825
  [#2189]:https://github.com/puma/puma/pull/2189 "PR by @jkowens, merged 2020-03-19"
1753
- [#2220]:https://github.com/puma/puma/pull/2220 "PR by @wjordan, merged 2020-04-14"
1754
1826
  [#2124]:https://github.com/puma/puma/pull/2124 "PR by @wjordan, merged 2020-04-14"
1755
1827
  [#2223]:https://github.com/puma/puma/pull/2223 "PR by @wjordan, merged 2020-04-20"
1756
1828
  [#2239]:https://github.com/puma/puma/pull/2239 "PR by @wjordan, merged 2020-05-15"
1829
+ [#2496]:https://github.com/puma/puma/pull/2496 "PR by @TheRusskiy, merged 2020-11-30"
1757
1830
  [#2304]:https://github.com/puma/puma/issues/2304 "Issue by @mpeltomaa, closed 2020-09-05"
1758
- [#2269]:https://github.com/puma/puma/pull/2269 "PR by @MSP-Greg, merged 2020-08-31"
1759
1831
  [#2132]:https://github.com/puma/puma/issues/2132 "Issue by @bmclean, closed 2020-02-28"
1760
1832
  [#2010]:https://github.com/puma/puma/pull/2010 "PR by @nateberkopec, merged 2019-10-07"
1761
1833
  [#2012]:https://github.com/puma/puma/pull/2012 "PR by @headius, merged 2019-10-07"
@@ -1783,8 +1855,6 @@ be added back in a future date when a java Puma::MiniSSL is added.
1783
1855
  [#1961]:https://github.com/puma/puma/pull/1961 "PR by @nateberkopec, merged 2019-09-11"
1784
1856
  [#1970]:https://github.com/puma/puma/pull/1970 "PR by @MSP-Greg, merged 2019-09-18"
1785
1857
  [#1946]:https://github.com/puma/puma/pull/1946 "PR by @nateberkopec, merged 2019-09-02"
1786
- [#1941]:https://github.com/puma/puma/pull/1941 "PR by @MSP-Greg, merged 2019-09-02"
1787
- [#1908]:https://github.com/puma/puma/pull/1908 "PR by @MSP-Greg, merged 2019-08-23"
1788
1858
  [#1831]:https://github.com/puma/puma/pull/1831 "PR by @spk, merged 2019-07-27"
1789
1859
  [#1816]:https://github.com/puma/puma/pull/1816 "PR by @ylecuyer, merged 2019-08-01"
1790
1860
  [#1844]:https://github.com/puma/puma/pull/1844 "PR by @ylecuyer, merged 2019-08-01"
@@ -1808,7 +1878,6 @@ be added back in a future date when a java Puma::MiniSSL is added.
1808
1878
  [#1872]:https://github.com/puma/puma/pull/1872 "PR by @MSP-Greg, merged 2019-07-30"
1809
1879
  [#1833]:https://github.com/puma/puma/issues/1833 "Issue by @julik, closed 2019-07-09"
1810
1880
  [#1888]:https://github.com/puma/puma/pull/1888 "PR by @ClikeX, merged 2019-08-06"
1811
- [#1842]:https://github.com/puma/puma/issues/1842 "Issue by @nateberkopec, closed 2019-09-18"
1812
1881
  [#1829]:https://github.com/puma/puma/pull/1829 "PR by @Fudoshiki, merged 2019-07-09"
1813
1882
  [#1832]:https://github.com/puma/puma/pull/1832 "PR by @MSP-Greg, merged 2019-07-08"
1814
1883
  [#1827]:https://github.com/puma/puma/pull/1827 "PR by @amrrbakry, merged 2019-06-27"
@@ -1844,7 +1913,6 @@ be added back in a future date when a java Puma::MiniSSL is added.
1844
1913
  [#1604]:https://github.com/puma/puma/pull/1604 "PR by @schneems, merged 2018-07-02"
1845
1914
  [#1579]:https://github.com/puma/puma/pull/1579 "PR by @schneems, merged 2018-06-14"
1846
1915
  [#1506]:https://github.com/puma/puma/pull/1506 "PR by @dekellum, merged 2018-05-09"
1847
- [#1487]:https://github.com/puma/puma/pull/1487 "PR by @jxa, merged 2018-05-09"
1848
1916
  [#1563]:https://github.com/puma/puma/pull/1563 "PR by @dannyfallon, merged 2018-05-01"
1849
1917
  [#1557]:https://github.com/puma/puma/pull/1557 "PR by @swrobel, merged 2018-05-09"
1850
1918
  [#1529]:https://github.com/puma/puma/pull/1529 "PR by @desnudopenguino, merged 2018-03-20"
@@ -1940,11 +2008,6 @@ be added back in a future date when a java Puma::MiniSSL is added.
1940
2008
  [#1138]:https://github.com/puma/puma/pull/1138 "PR by @steakknife, merged 2016-12-13"
1941
2009
  [#1118]:https://github.com/puma/puma/pull/1118 "PR by @hiroara, merged 2016-11-20"
1942
2010
  [#1075]:https://github.com/puma/puma/issues/1075 "Issue by @pvalena, closed 2016-09-06"
1943
- [#1118]:https://github.com/puma/puma/pull/1118 "PR by @hiroara, merged 2016-11-20"
1944
- [#1036]:https://github.com/puma/puma/issues/1036 "Issue by @matobinder, closed 2016-08-03"
1945
- [#1120]:https://github.com/puma/puma/pull/1120 "PR by @prathamesh-sonpatki, merged 2016-11-21"
1946
- [#1002]:https://github.com/puma/puma/issues/1002 "Issue by @mattyb, closed 2016-07-26"
1947
- [#1089]:https://github.com/puma/puma/issues/1089 "Issue by @AdamBialas, closed 2016-09-17"
1948
2011
  [#932]:https://github.com/puma/puma/issues/932 "Issue by @everplays, closed 2016-07-24"
1949
2012
  [#519]:https://github.com/puma/puma/issues/519 "Issue by @tmornini, closed 2016-07-25"
1950
2013
  [#828]:https://github.com/puma/puma/issues/828 "Issue by @Zapotek, closed 2016-07-24"
@@ -1955,7 +2018,6 @@ be added back in a future date when a java Puma::MiniSSL is added.
1955
2018
  [#925]:https://github.com/puma/puma/issues/925 "Issue by @lokenmakwana, closed 2016-07-24"
1956
2019
  [#911]:https://github.com/puma/puma/issues/911 "Issue by @veganstraightedge, closed 2016-07-24"
1957
2020
  [#620]:https://github.com/puma/puma/issues/620 "Issue by @javanthropus, closed 2016-07-25"
1958
- [#1027]:https://github.com/puma/puma/issues/1027 "Issue by @rosenfeld, closed 2016-07-24"
1959
2021
  [#778]:https://github.com/puma/puma/issues/778 "Issue by @niedhui, closed 2016-07-24"
1960
2022
  [#1021]:https://github.com/puma/puma/pull/1021 "PR by @sarahzrf, merged 2016-07-20"
1961
2023
  [#1022]:https://github.com/puma/puma/issues/1022 "Issue by @AKovtunov, closed 2017-08-16"
@@ -1983,7 +2045,6 @@ be added back in a future date when a java Puma::MiniSSL is added.
1983
2045
  [#788]:https://github.com/puma/puma/issues/788 "Issue by @herregroen, closed 2016-04-07"
1984
2046
  [#894]:https://github.com/puma/puma/issues/894 "Issue by @rafbm, closed 2016-04-07"
1985
2047
  [#937]:https://github.com/puma/puma/issues/937 "Issue by @huangxiangdan, closed 2016-04-07"
1986
- [#840]:https://github.com/puma/puma/issues/840 "Issue by @maxkwallace, closed 2016-04-07"
1987
2048
  [#945]:https://github.com/puma/puma/pull/945 "PR by @dekellum, merged 2016-04-07"
1988
2049
  [#946]:https://github.com/puma/puma/pull/946 "PR by @vipulnsward, merged 2016-04-07"
1989
2050
  [#947]:https://github.com/puma/puma/pull/947 "PR by @vipulnsward, merged 2016-04-07"
@@ -2113,7 +2174,7 @@ be added back in a future date when a java Puma::MiniSSL is added.
2113
2174
  [#646]:https://github.com/puma/puma/pull/646 "PR by @mkonecny, merged 2015-02-05"
2114
2175
  [#630]:https://github.com/puma/puma/issues/630 "Issue by @jelmd, closed 2015-01-20"
2115
2176
  [#622]:https://github.com/puma/puma/issues/622 "Issue by @sabamotto, closed 2015-01-20"
2116
- [#583]:https://github.com/puma/puma/issues/583 "Issue by @emq, closed 2015-01-20"
2177
+ [#583]:https://github.com/puma/puma/issues/583 "Issue by @rwojsznis, closed 2015-01-20"
2117
2178
  [#586]:https://github.com/puma/puma/issues/586 "Issue by @ponchik, closed 2015-01-20"
2118
2179
  [#359]:https://github.com/puma/puma/issues/359 "Issue by @natew, closed 2014-12-13"
2119
2180
  [#633]:https://github.com/puma/puma/issues/633 "Issue by @joevandyk, closed 2015-01-20"
data/README.md CHANGED
@@ -64,20 +64,30 @@ You can run your Sinatra application with Puma from the command line like this:
64
64
  $ ruby app.rb -s Puma
65
65
  ```
66
66
 
67
- Or you can configure your Sinatra application to always use Puma:
67
+ In order to actually configure Puma using a config file, like `puma.rb`, however, you need to use the `puma` executable. To do this, you must add a rackup file to your Sinatra app:
68
68
 
69
69
  ```ruby
70
- require 'sinatra'
71
- configure { set :server, :puma }
70
+ # config.ru
71
+ require './app'
72
+ run Sinatra::Application
73
+ ```
74
+
75
+ You can then start your application using:
76
+
77
+ ```
78
+ $ bundle exec puma
72
79
  ```
73
80
 
74
81
  ## Configuration
75
82
 
76
- Puma provides numerous options. Consult `puma -h` (or `puma --help`) for a full list of CLI options, or see [dsl.rb](https://github.com/puma/puma/blob/master/lib/puma/dsl.rb).
83
+ Puma provides numerous options. Consult `puma -h` (or `puma --help`) for a full list of CLI options, or see `Puma::DSL` or [dsl.rb](https://github.com/puma/puma/blob/master/lib/puma/dsl.rb).
77
84
 
78
85
  You can also find several configuration examples as part of the
79
86
  [test](https://github.com/puma/puma/tree/master/test/config) suite.
80
87
 
88
+ For debugging purposes, you can set the environment variable `PUMA_LOG_CONFIG` with a value
89
+ and the loaded configuration will be printed as part of the boot process.
90
+
81
91
  ### Thread Pool
82
92
 
83
93
  Puma uses a thread pool. You can set the minimum and maximum number of threads that are available in the pool with the `-t` (or `--threads`) flag:
@@ -136,12 +146,12 @@ before_fork do
136
146
  end
137
147
  ```
138
148
 
139
- Preloading can’t be used with phased restart, since phased restart kills and restarts workers one-by-one, and preload_app copies the code of master into the workers.
149
+ Preloading can’t be used with phased restart, since phased restart kills and restarts workers one-by-one, and `preload_app!` copies the code of master into the workers.
140
150
 
141
151
  ### Error handling
142
152
 
143
153
  If puma encounters an error outside of the context of your application, it will respond with a 500 and a simple
144
- textual error message (see `lowlevel_error` in [this file](https://github.com/puma/puma/blob/master/lib/puma/server.rb)).
154
+ textual error message (see `Puma::Server#lowlevel_error` or [server.rb](https://github.com/puma/puma/blob/master/lib/puma/server.rb)).
145
155
  You can specify custom behavior for this scenario. For example, you can report the error to your third-party
146
156
  error-tracking service (in this example, [rollbar](https://rollbar.com)):
147
157
 
@@ -194,7 +204,7 @@ $ puma -b 'ssl://127.0.0.1:9292?key=path_to_key&cert=path_to_cert&ssl_cipher_fil
194
204
  $ puma -b 'ssl://127.0.0.1:9292?keystore=path_to_keystore&keystore-pass=keystore_password&ssl_cipher_list=TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA'
195
205
  ```
196
206
 
197
- See https://www.openssl.org/docs/man1.0.2/apps/ciphers.html for cipher filter format and full list of cipher suites.
207
+ See https://www.openssl.org/docs/man1.1.1/man1/ciphers.html for cipher filter format and full list of cipher suites.
198
208
 
199
209
  Disable TLS v1 with the `no_tlsv1` option:
200
210
 
@@ -202,6 +212,23 @@ Disable TLS v1 with the `no_tlsv1` option:
202
212
  $ puma -b 'ssl://127.0.0.1:9292?key=path_to_key&cert=path_to_cert&no_tlsv1=true'
203
213
  ```
204
214
 
215
+ #### Controlling OpenSSL Verification Flags
216
+
217
+ To enable verification flags offered by OpenSSL, use `verification_flags` (not available for JRuby):
218
+
219
+ ```
220
+ $ puma -b 'ssl://127.0.0.1:9292?key=path_to_key&cert=path_to_cert&verification_flags=PARTIAL_CHAIN'
221
+ ```
222
+
223
+ You can also set multiple verification flags (by separating them with coma):
224
+
225
+ ```
226
+ $ puma -b 'ssl://127.0.0.1:9292?key=path_to_key&cert=path_to_cert&verification_flags=PARTIAL_CHAIN,CRL_CHECK'
227
+ ```
228
+
229
+ List of available flags: `USE_CHECK_TIME`, `CRL_CHECK`, `CRL_CHECK_ALL`, `IGNORE_CRITICAL`, `X509_STRICT`, `ALLOW_PROXY_CERTS`, `POLICY_CHECK`, `EXPLICIT_POLICY`, `INHIBIT_ANY`, `INHIBIT_MAP`, `NOTIFY_POLICY`, `EXTENDED_CRL_SUPPORT`, `USE_DELTAS`, `CHECK_SS_SIGNATURE`, `TRUSTED_FIRST`, `SUITEB_128_LOS_ONLY`, `SUITEB_192_LOS`, `SUITEB_128_LOS`, `PARTIAL_CHAIN`, `NO_ALT_CHAINS`, `NO_CHECK_TIME`
230
+ (see https://www.openssl.org/docs/manmaster/man3/X509_VERIFY_PARAM_set_hostflags.html#VERIFICATION-FLAGS).
231
+
205
232
  ### Control/Status Server
206
233
 
207
234
  Puma has a built-in status and control app that can be used to query and control Puma.
@@ -210,7 +237,7 @@ Puma has a built-in status and control app that can be used to query and control
210
237
  $ puma --control-url tcp://127.0.0.1:9293 --control-token foo
211
238
  ```
212
239
 
213
- Puma will start the control server on localhost port 9293. All requests to the control server will need to include control token (in this case, `token=foo`) as a query parameter. This allows for simple authentication. Check out [status.rb](https://github.com/puma/puma/blob/master/lib/puma/app/status.rb) to see what the status app has available.
240
+ Puma will start the control server on localhost port 9293. All requests to the control server will need to include control token (in this case, `token=foo`) as a query parameter. This allows for simple authentication. Check out `Puma::App::Status` or [status.rb](https://github.com/puma/puma/blob/master/lib/puma/app/status.rb) to see what the status app has available.
214
241
 
215
242
  You can also interact with the control server via `pumactl`. This command will restart Puma:
216
243
 
@@ -228,7 +255,7 @@ You can also provide a configuration file with the `-C` (or `--config`) flag:
228
255
  $ puma -C /path/to/config
229
256
  ```
230
257
 
231
- If no configuration file is specified, Puma will look for a configuration file at `config/puma.rb`. If an environment is specified, either via the `-e` and `--environment` flags, or through the `RACK_ENV` or the `RAILS_ENV` environment variables, Puma looks for configuration at `config/puma/<environment_name>.rb`.
258
+ If no configuration file is specified, Puma will look for a configuration file at `config/puma.rb`. If an environment is specified, either via the `-e` and `--environment` flags, or through the `RACK_ENV` or the `RAILS_ENV` environment variables, Puma first looks for configuration at `config/puma/<environment_name>.rb`, and then falls back to `config/puma.rb`.
232
259
 
233
260
  If you want to prevent Puma from looking for a configuration file in those locations, provide a dash as the argument to the `-C` (or `--config`) flag:
234
261
 
@@ -236,19 +263,19 @@ If you want to prevent Puma from looking for a configuration file in those locat
236
263
  $ puma -C "-"
237
264
  ```
238
265
 
239
- The other side-effects of setting the environment are whether to show stack traces (in `development` or `test`), and setting RACK_ENV may potentially affect middleware looking for this value to change their behavior. The default puma RACK_ENV value is `development`. You can see all config default values [here](https://github.com/puma/puma/blob/12d1706ddc71b89ed2ee26275e31c788e94ff541/lib/puma/configuration.rb#L170).
266
+ The other side-effects of setting the environment are whether to show stack traces (in `development` or `test`), and setting RACK_ENV may potentially affect middleware looking for this value to change their behavior. The default puma RACK_ENV value is `development`. You can see all config default values in `Puma::Configuration#puma_default_options` or [configuration.rb](https://github.com/puma/puma/blob/61c6213fbab/lib/puma/configuration.rb#L182-L204).
240
267
 
241
- Check out [dsl.rb](https://github.com/puma/puma/blob/master/lib/puma/dsl.rb) to see all available options.
268
+ Check out `Puma::DSL` or [dsl.rb](https://github.com/puma/puma/blob/master/lib/puma/dsl.rb) to see all available options.
242
269
 
243
270
  ## Restart
244
271
 
245
272
  Puma includes the ability to restart itself. When available (MRI, Rubinius, JRuby), Puma performs a "hot restart". This is the same functionality available in *Unicorn* and *NGINX* which keep the server sockets open between restarts. This makes sure that no pending requests are dropped while the restart is taking place.
246
273
 
247
- For more, see the [restart documentation](https://github.com/puma/puma/blob/master/docs/restart.md).
274
+ For more, see the [Restart documentation](docs/restart.md).
248
275
 
249
276
  ## Signals
250
277
 
251
- Puma responds to several signals. A detailed guide to using UNIX signals with Puma can be found in the [signals documentation](https://github.com/puma/puma/blob/master/docs/signals.md).
278
+ Puma responds to several signals. A detailed guide to using UNIX signals with Puma can be found in the [Signals documentation](docs/signals.md).
252
279
 
253
280
  ## Platform Constraints
254
281
 
@@ -256,6 +283,7 @@ Some platforms do not support all Puma features.
256
283
 
257
284
  * **JRuby**, **Windows**: server sockets are not seamless on restart, they must be closed and reopened. These platforms have no way to pass descriptors into a new process that is exposed to Ruby. Also, cluster mode is not supported due to a lack of fork(2).
258
285
  * **Windows**: Cluster mode is not supported due to a lack of fork(2).
286
+ * **Kubernetes**: The way Kubernetes handles pod shutdowns interacts poorly with server processes implementing graceful shutdown, like Puma. See the [kubernetes section of the documentation](docs/kubernetes.md) for more details.
259
287
 
260
288
  ## Known Bugs
261
289
 
@@ -278,8 +306,12 @@ It is common to use process monitors with Puma. Modern process monitors like sys
278
306
  provide continuous monitoring and restarts for increased
279
307
  reliability in production environments:
280
308
 
281
- * [docs/jungle](https://github.com/puma/puma/tree/master/docs/jungle) for rc.d
282
- * [docs/systemd](https://github.com/puma/puma/blob/master/docs/systemd.md)
309
+ * [rc.d](docs/jungle/rc.d/README.md)
310
+ * [systemd](docs/systemd.md)
311
+
312
+ Community guides:
313
+
314
+ * [Deploying Puma on OpenBSD using relayd and httpd](https://gist.github.com/anon987654321/4532cf8d6c59c1f43ec8973faa031103)
283
315
 
284
316
  ## Community Extensions
285
317
 
@@ -295,9 +327,7 @@ reliability in production environments:
295
327
 
296
328
  ## Contributing
297
329
 
298
- Find details for contributing in the [contribution guide].
299
-
300
- [contribution guide]: https://github.com/puma/puma/blob/master/CONTRIBUTING.md
330
+ Find details for contributing in the [contribution guide](CONTRIBUTING.md).
301
331
 
302
332
  ## License
303
333