yahns 1.14.1 → 1.18.0

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.
Files changed (66) hide show
  1. checksums.yaml +5 -5
  2. data/.document +2 -0
  3. data/.gitignore +0 -1
  4. data/.olddoc.yml +3 -2
  5. data/Documentation/GNUmakefile +1 -1
  6. data/Documentation/design_notes.txt +6 -3
  7. data/Documentation/yahns-rackup.pod +7 -3
  8. data/Documentation/yahns.pod +1 -1
  9. data/Documentation/yahns_config.pod +10 -10
  10. data/GIT-VERSION-FILE +1 -1
  11. data/GIT-VERSION-GEN +3 -3
  12. data/HACKING +13 -13
  13. data/NEWS +982 -829
  14. data/README +11 -12
  15. data/Rakefile +121 -5
  16. data/examples/https_proxy_pass.conf.rb +36 -0
  17. data/examples/logrotate.conf +1 -1
  18. data/examples/proxy_pass.ru +11 -0
  19. data/extras/autoindex.rb +20 -4
  20. data/extras/exec_cgi.rb +38 -24
  21. data/extras/proxy_pass.rb +7 -6
  22. data/extras/try_gzip_static.rb +4 -1
  23. data/lib/yahns/acceptor.rb +3 -3
  24. data/lib/yahns/chunk_body.rb +2 -1
  25. data/lib/yahns/config.rb +10 -5
  26. data/lib/yahns/daemon.rb +0 -1
  27. data/lib/yahns/http_client.rb +28 -18
  28. data/lib/yahns/http_response.rb +3 -4
  29. data/lib/yahns/openssl_client.rb +33 -11
  30. data/lib/yahns/proxy_http_response.rb +3 -1
  31. data/lib/yahns/proxy_pass.rb +68 -10
  32. data/lib/yahns/queue_epoll.rb +4 -0
  33. data/lib/yahns/queue_kqueue.rb +0 -6
  34. data/lib/yahns/queue_quitter_pipe.rb +4 -1
  35. data/lib/yahns/rackup_handler.rb +3 -7
  36. data/lib/yahns/server.rb +47 -27
  37. data/lib/yahns/server_mp.rb +3 -4
  38. data/lib/yahns/sigevent_efd.rb +0 -1
  39. data/lib/yahns/sigevent_pipe.rb +13 -6
  40. data/lib/yahns/socket_helper.rb +1 -1
  41. data/lib/yahns/stream_input.rb +3 -2
  42. data/lib/yahns/tee_input.rb +1 -3
  43. data/lib/yahns/version.rb +1 -1
  44. data/lib/yahns/wbuf.rb +10 -3
  45. data/lib/yahns/worker.rb +8 -0
  46. data/lib/yahns.rb +12 -7
  47. data/man/yahns-rackup.1 +17 -17
  48. data/man/yahns.1 +11 -15
  49. data/man/yahns_config.5 +31 -31
  50. data/test/helper.rb +6 -2
  51. data/test/server_helper.rb +20 -5
  52. data/test/test_bin.rb +33 -30
  53. data/test/test_config.rb +2 -2
  54. data/test/test_extras_exec_cgi.rb +24 -1
  55. data/test/test_extras_try_gzip_static.rb +1 -1
  56. data/test/test_mt_accept.rb +0 -2
  57. data/test/test_proxy_pass.rb +1 -2
  58. data/test/test_proxy_pass_no_buffering.rb +1 -1
  59. data/test/test_rack_env.rb +58 -0
  60. data/test/test_serve_static.rb +0 -1
  61. data/test/test_server.rb +1 -4
  62. data/test/test_ssl.rb +2 -0
  63. data/test/test_unix_socket.rb +1 -3
  64. data/test/test_wbuf.rb +1 -1
  65. data/yahns.gemspec +8 -5
  66. metadata +12 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 100f23910c77a7e45fdb98c841bf13a166eb0b63
4
- data.tar.gz: ea3c7b2801fa134773bc079f637ccf419b5e6ef5
2
+ SHA256:
3
+ metadata.gz: '0318100b814550d192110790944b552f4aba4a79e363f7a932c7a86c21335728'
4
+ data.tar.gz: b8af746d6ffe65df3121b06fa42effa8b29ff9c1b206c67daabfbe8774e47bf7
5
5
  SHA512:
6
- metadata.gz: 7ee178fa9b9b1122a4446353ca6c6f4744aa1589679deef510fe3afeae40f72f66b8ccb96b56476e2e67383b6cd17f10f23c1fedfd81ab588056944e5693fb83
7
- data.tar.gz: 1f7a89edf6427deeb0f01b26461c744fa56dc22edc5f84d14eacfb48a50618a5622dcc28e67041843d1ff5de2d6b40c4144b580f044e8770f1e453e268ab10a0
6
+ metadata.gz: cfcf4ef901f640e40c5343f33505eddae6ab32bc95a08c7225cb239cfff08b33266b737497481467588f9e8be70e88f4c2f4fa95d64312c02d19d813a3877bec
7
+ data.tar.gz: f21048f67209face645bef2a0f9018382b79aa93abd9d780ec05095a6557252ce1bc129e72fb04d74cd61c60caa75f64e7d147cc73297fad4c66394329b35125
data/.document ADDED
@@ -0,0 +1,2 @@
1
+ lib/yahns.rb
2
+ lib/yahns/proxy_pass.rb
data/.gitignore CHANGED
@@ -15,4 +15,3 @@
15
15
  .gem-manifest
16
16
  .tgz-manifest
17
17
  /doc
18
- /LATEST
data/.olddoc.yml CHANGED
@@ -1,7 +1,8 @@
1
1
  ---
2
2
  cgit_url: https://yhbt.net/yahns.git
3
- git_url: git://yhbt.net/yahns.git
3
+ git_url: https://yhbt.net/yahns.git
4
4
  rdoc_url: https://yhbt.net/yahns/
5
5
  ml_url: https://yhbt.net/yahns-public/
6
6
  public_email: yahns-public@yhbt.net
7
- private_email: yahns@yhbt.net
7
+ nntp_url:
8
+ - nntp://news.public-inbox.org/inbox.comp.lang.ruby.yahns
@@ -60,7 +60,7 @@ all :: txt
60
60
 
61
61
  %.txt : %.pod
62
62
  $(pod2text) $< $@+
63
- -touch -r $< $@+ 2>/dev/null # GNU-ism
63
+ touch -r $< $@+
64
64
  mv $@+ $@
65
65
 
66
66
  clean::
@@ -17,9 +17,12 @@ socket we have inside the kernel.
17
17
  Each listen queue has a dedicated thread pool running _blocking_
18
18
  accept(2) (or accept4(2)) syscall in a loop. We use dedicated threads
19
19
  and blocking accept to benefit from "wake-one" behavior in the Linux
20
- kernel. By default, this thread pool only has thread per-process, doing
20
+ kernel. By default, this thread pool only has one thread per-process, doing
21
21
  nothing but accepting sockets and injecting into to the event queue
22
- (used by epoll or kqueue).
22
+ (used by epoll or kqueue) so a worker thread pool can pick them up.
23
+
24
+ This design makes EPOLLEXCLUSIVE in Linux 4.5+ unnecessary to us,
25
+ our listen sockets are never registered with epoll or kqueue.
23
26
 
24
27
  worker thread pool
25
28
  ------------------
@@ -38,7 +41,7 @@ allows us to guarantee exclusive access to a client socket without
38
41
  additional locks managed in userspace.
39
42
 
40
43
  Idle threads will sit performing epoll_wait(2) (or kevent(2))
41
- indefinitely until a socket is reported as "ready" by the kernel.
44
+ indefinitely until a client socket is reported as "ready" by the kernel.
42
45
 
43
46
  queue flow
44
47
  ----------
@@ -40,6 +40,10 @@ and PATH is meant to be a path to a UNIX domain socket.
40
40
  Defaults to "0.0.0.0:9292" (all addresses on TCP port 9292).
41
41
  Multiple addresses may be separated with commas.
42
42
 
43
+ For systemd users, a special value of "inherit" may be specified
44
+ to inherit FDs using the LISTEN_FDS and LISTEN_PID environment
45
+ variables described in L<sd_listen_fds(3)>
46
+
43
47
  =item -O stderr_path=PATHNAME
44
48
 
45
49
  Allow redirecting $stderr to a given path. Unlike doing this from
@@ -162,13 +166,13 @@ See rackup documentation for more details.
162
166
  =head1 CONTACT
163
167
 
164
168
  All feedback welcome via plain-text mail to L<mailto:yahns-public@yhbt.net>
165
- No subscription is necessary to post to the mailing list.
166
- List archives are available at L<https://yhbt.net/yahns-public/>
169
+ No subscription is necessary to email us.
170
+ Mail archives are available at L<https://yhbt.net/yahns-public/>
167
171
 
168
172
  =head1 COPYRIGHT
169
173
 
170
174
  Copyright (C) 2013-2016 all contributors L<mailto:yahns-public@yhbt.net>
171
- License: GPL-3.0+ L<http://www.gnu.org/licenses/gpl-3.0.txt>
175
+ License: GPL-3.0+ L<https://www.gnu.org/licenses/gpl-3.0.txt>
172
176
 
173
177
  =head1 SEE ALSO
174
178
 
@@ -83,7 +83,7 @@ See L<yahns_config(5)> for documentation on the configuration file format.
83
83
  =head1 CONTACT
84
84
 
85
85
  All feedback welcome via plain-text mail to L<mailto:yahns-public@yhbt.net>
86
- No subscription is necessary to post to the mailing list.
86
+ No subscription is necessary to email us.
87
87
  Mail archives are available at L<https://yhbt.net/yahns-public/>
88
88
 
89
89
  =head1 COPYRIGHT
@@ -427,7 +427,7 @@ To enable TLS connections, you must configure this yourself.
427
427
  See documentation for OpenSSL::SSL::SSLContext
428
428
  for more information:
429
429
 
430
- L<http://docs.ruby-lang.org/en/trunk/OpenSSL/SSL/SSLContext.html>
430
+ L<https://docs.ruby-lang.org/en/trunk/OpenSSL/SSL/SSLContext.html>
431
431
 
432
432
  Default: none
433
433
 
@@ -436,22 +436,22 @@ An example which seems to work is:
436
436
  require 'openssl'
437
437
  ssl_ctx = OpenSSL::SSL::SSLContext.new
438
438
  ssl_ctx.cert = OpenSSL::X509::Certificate.new(
439
- IO.read('/etc/ssl/certs/example.crt')
439
+ File.read('/etc/ssl/certs/example.crt')
440
440
  )
441
441
  ssl_ctx.extra_chain_cert = [
442
442
  OpenSSL::X509::Certificate.new(
443
- IO.read('/etc/ssl/certs/chain.crt')
443
+ File.read('/etc/ssl/certs/chain.crt')
444
444
  )
445
445
  ]
446
446
  ssl_ctx.key = OpenSSL::PKey::RSA.new(
447
- IO.read('/etc/ssl/private/example.key')
447
+ File.read('/etc/ssl/private/example.key')
448
448
  )
449
449
 
450
450
  # use defaults provided by Ruby on top of OpenSSL,
451
- # but disable client certificate verification as it is rare:
451
+ # but disable client certificate verification as it is rare for servers:
452
452
  ssl_ctx.set_params(verify_mode: OpenSSL::SSL::VERIFY_NONE)
453
453
 
454
- # Built-in session cache (only works if worker_processes is nil or 1)
454
+ # Built-in session cache (only useful if worker_processes is nil or 1)
455
455
  ssl_ctx.session_cache_mode = OpenSSL::SSL::SSLContext::SESSION_CACHE_SERVER
456
456
 
457
457
  app(:rack, "/path/to/my/app/config.ru") do
@@ -656,18 +656,18 @@ compatibility.
656
656
 
657
657
  See the examples/ directory in the git source tree.
658
658
 
659
- git clone git://yhbt.net/yahns.git
659
+ git clone https://yhbt.net/yahns.git
660
660
 
661
661
  =head1 CONTACT
662
662
 
663
663
  All feedback welcome via plain-text mail to L<mailto:yahns-public@yhbt.net>
664
- No subscription is necessary to post to the mailing list.
665
- List archives are available at L<https://yhbt.net/yahns-public/>
664
+ No subscription is necessary to email us.
665
+ Mail archives are available at L<https://yhbt.net/yahns-public/>
666
666
 
667
667
  =head1 COPYRIGHT
668
668
 
669
669
  Copyright (C) 2013-2016 all contributors L<mailto:yahns-public@yhbt.net>
670
- License: GPL-3.0+ L<http://www.gnu.org/licenses/gpl-3.0.txt>
670
+ License: GPL-3.0+ L<https://www.gnu.org/licenses/gpl-3.0.txt>
671
671
 
672
672
  =head1 SEE ALSO
673
673
 
data/GIT-VERSION-FILE CHANGED
@@ -1 +1 @@
1
- VERSION = 1.14.1
1
+ VERSION = 1.18.0
data/GIT-VERSION-GEN CHANGED
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env ruby
2
- # Copyright (C) 2013-2016 all contributors <yahns-public@yhbt.net>
3
- # License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
2
+ # Copyright (C) all contributors <yahns-public@yhbt.net>
3
+ # License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
4
4
  # frozen_string_literal: true
5
5
  CONSTANT = "Yahns::VERSION"
6
6
  RVF = "lib/yahns/version.rb"
7
7
  GVF = "GIT-VERSION-FILE"
8
- DEF_VER = "v1.14.1"
8
+ DEF_VER = "v1.18.0"
9
9
  vn = DEF_VER.dup
10
10
 
11
11
  # First see if there is a version file (included in release tarballs),
data/HACKING CHANGED
@@ -2,14 +2,14 @@ development dependencies
2
2
  ------------------------
3
3
 
4
4
  * minitest RubyGem (version 4 or 5, standard in Ruby 2.0+)
5
- * curl - http://curl.haxx.se/ - we don't trust our own Ruby abilities :>
5
+ * curl - https://curl.haxx.se/ - we don't trust our own Ruby abilities :>
6
6
  * dd(1) - standard POSIX tool - to feed curl
7
- * ab - http://httpd.apache.org/ - for concurrent testing
7
+ * ab - https://httpd.apache.org/ - for concurrent testing
8
8
  * GNU make - https://www.gnu.org/software/make/
9
- * git - http://www.git-scm.com/
10
- * ruby - http://www.ruby-lang.org/en/
9
+ * git - https://www.git-scm.com/
10
+ * ruby - https://www.ruby-lang.org/en/
11
11
 
12
- git clone git://yhbt.net/yahns
12
+ git clone https://yhbt.net/yahns.git
13
13
 
14
14
  tests
15
15
  -----
@@ -42,14 +42,14 @@ installing from git
42
42
  contact
43
43
  -------
44
44
 
45
- We use git(7) and develop yahns on a public mailing list like git
46
- developers do. Please send patches via git-send-email(1) to the public
47
- mailing list at <yahns-public@yhbt.net>. Pull requests should be
48
- formatted using git-request-pull(1).
45
+ We use git(7) and develop yahns using email like git.git hackers do.
46
+ Please send patches via git-send-email(1) to us at <yahns-public@yhbt.net>.
47
+ Pull requests should be formatted using git-request-pull(1).
49
48
 
50
- Mailing list archives: https://yhbt.net/yahns-public/
51
- No subscription is necessary to post to the mailing list.
52
- Please remember to Cc: all recipients as subscription is optional.
49
+ All mail is archived publically at: https://yhbt.net/yahns-public/
50
+ Anonymous contributions will always be welcome.
51
+ No subscription is necessary to email us.
52
+ Please remember to reply-to-all as we do not encourage subscription.
53
53
 
54
54
  Copyright (C) 2013-2016 all contributors <yahns-public@yhbt.net>
55
- License: GPL-3.0+ <http://www.gnu.org/licenses/gpl-3.0.txt>
55
+ License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>