1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00
Commit graph

29 commits

Author SHA1 Message Date
Will Jordan
55a9864eaf Fix errors on test_halt_unix
Prevent `IOError: closed stream` by stopping control during halt.
Add test assertion to ensure no errors in stderr output.
2020-05-19 11:32:02 -07:00
Nate Berkopec
636732c447
Remove daemonization (#2170)
* Remove daemonization

* Fix t2 integration
2020-03-10 12:08:34 -06:00
Nate Berkopec
8d3db816fa
Remove TCP mode (#2169) 2020-03-10 09:50:50 -06:00
Will Jordan
964747031f
Refactor listener closing code (#2112)
* Simplify Runner#start_control URL parsing
Reuse logic from Binder#parse.

* Parameterize log message

* Ensure control server Unix socket is closed on shutdown
Remove Binder#close_unix_paths

Co-authored-by: Nate Berkopec <nate.berkopec@gmail.com>
2020-03-03 14:09:08 -06:00
Will Jordan
a948c165ae
Simplify Runner#start_control URL parsing (#2111)
* Simplify Runner#start_control URL parsing
Reuse logic from Binder#parse.

* Parameterize log message
2020-02-20 06:40:17 -06:00
Daniel Colson
f5ccd03b26 Add SSL support for the control app (#2046)
* Extract class for building SSL context

This commit extracts the `MiniSSL::Context` creation into its own
`MiniSSL::ContextBuilder` class along the same lines as in [#1989].

This will allow us to reuse this code for adding SSL support to the
control app (issue [#2015]). Since we will need the `MiniSSL` require
and check in both places, I moved that into the `ContextBuilder` class
as well.

[#1989]: https://github.com/puma/puma/pull/1989
[#2015]: https://github.com/puma/puma/pull/2015

* Add SSL support for the control app

This starts to address [#2015]. I think we will need to add SSL support
to the control cli as well.

[#2015]: https://github.com/puma/puma/issues/2015
2019-10-21 09:35:15 +08:00
Nate Berkopec
b18250f1b5
Status app: privatize auth, no more explicit returns 2019-09-20 12:45:56 +02:00
Yoann Lecuyer
a3e18cb3a6 Instrument start time (#1844)
* Instrument started_at

* clean diff
2019-08-01 12:25:15 -07:00
Jesús Burgos Maciá
d39fe92a2d Fixes the bug that wouldn't allow no_token be set to true (#1803)
* Fix crash when no_token is set

* Use a more meaningful name instead of an empty string

* Adds a test to ensure `{ no_token: true }` works

* Adds an explanation for the usage of a String

Just to justify the use of a String instead of a Symbol.

* Removes thread that would start the server

This removes the part of the test that would start the server. The
reason why the thread was being created originally in the PR was to
ensure that the server was booting even with `{ no_token: true }`.

I believe we don't need to test the full server boot but just ensure
that we won't pass a Symbol to OptionParser. In particular the test
ensures that the token will be set to `'none'` when `no_token: true`.

There're already other tests testing that the server boots.
2019-05-28 09:37:34 -04:00
schneems
88e51fb08e Freeze all the strings!
Reduces runtime allocation by freezing string literals by default.

We could also remove a ton of manual `.freeze` calls, however the ruby supported version is 2.2 and the magic comment only targets 2.3+.
2018-09-17 11:41:14 -05:00
Stefan Wrobel
bcbe811333 leak_stack_on_error in test environment (#1557)
Fixes #1554
2018-05-09 11:45:41 -06:00
schneems
c26ebe6101 Doc Puma::Runner, Puma::Single, and Puma::Cluster 2018-05-01 15:44:08 -05:00
Eileen M. Uchitelle
01699742a8 Add early hints feature (#1403)
This commit adds the early hints lambda to the headers hash. Users can
call it to emit the early hints headers. For example:

```
class Server
  def call env
    if env["REQUEST_PATH"] == "/"
      env['rack.early_hints'].call("Link" => "</style.css>; rel=preload; as=style\n</script.js>; rel=preload")
      [200, { "X-Hello" => "World" }, ["Hello world!"]]
    else
      [200, { "X-Hello" => "World" }, ["NEAT!"]]
    end
  end
end

run Server.new
```

In this example, the server sends stylesheet and javascript early hints
if the proxy supports it, it will send H2 pushes to the client.

Of course not every proxy server supports early hints, so to enable the
early hints feature with puma you have to pass the configuration variable,
`--early-hints`.

If `ENV['rack.early_hints']` is not set then early hints is not
supported by the webserver. Early hints is off by default.
2017-10-04 06:30:16 -06:00
Ahmed El-Masry
1b5d5b534a Don't use Dir.exists? as it's deprecated and use Dir.exist? instead (#1294) 2017-05-15 05:40:29 -07:00
Manabu Ejima
2deefc5452 Raise error when stdout or stderr is not writable 2016-12-15 01:45:10 +09:00
Evan Phoenix
5fdf337790 Move puma.rb to just autoloads. Fixes #1063 2016-09-05 11:29:16 -07:00
Evan Phoenix
eb6468d558 Handle HUP as a stop unless there is IO redirection. Fixes #911 2016-07-24 15:24:42 -07:00
Evan Phoenix
2982fb396e Show RUBY_ENGINE_VERSION if available. Fixes #923 2016-03-05 21:48:44 -08:00
Evan Phoenix
f788af0c8f Continue API cleanup, preparing for 3.0 2016-02-06 19:00:29 -08:00
Ben Osheroff
8356182079 allow umask for unix:/// style control urls
this lets us rely on unix permissions to control access to the
control_url.
2016-01-15 09:32:04 -08:00
Alex Chaffee
855d98622b better error logging during startup
When puma is daemonized (or maybe always?) it swallows exceptions that happen during startup. This patch makes the log message slightly more useful.

Should we log the entire stacktrace too? Clutter vs. info...
2014-09-16 09:29:31 -04:00
Evan Phoenix
99e6fd19dc Show the ruby version in use 2014-01-25 14:26:59 -08:00
Evan Phoenix
4ea35190ec Add experimental tcp mode (aka lopez express mode) 2013-08-07 16:39:08 -07:00
Evan Phoenix
816c67d2e9 Add ability to drain accept socket on shutdown 2013-07-15 14:29:10 -07:00
Evan Phoenix
c68ea5e46b Move starting control server to after daemonization 2013-07-08 22:36:50 -07:00
Evan Phoenix
9338e50499 Bump to 2.3.0 2013-07-05 22:16:46 -07:00
Evan Phoenix
e70a370e2d More cleanup 2013-07-05 21:13:29 -07:00
Evan Phoenix
f2e11d1b52 A bit more cleanup 2013-07-05 17:09:18 -07:00
Evan Phoenix
c48b804d8f Refactor modes, fix control server to always work 2013-07-05 16:08:13 -07:00