yahns 1.11.0 → 1.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitattributes +5 -0
- data/.gitignore +2 -2
- data/Documentation/.gitignore +5 -2
- data/Documentation/GNUmakefile +25 -6
- data/Documentation/yahns-rackup.pod +178 -0
- data/Documentation/yahns.pod +96 -0
- data/Documentation/yahns_config.pod +658 -0
- data/GIT-VERSION-GEN +6 -5
- data/GNUmakefile +3 -3
- data/HACKING +2 -2
- data/README +6 -6
- data/Rakefile +7 -2
- data/bin/yahns +3 -2
- data/bin/yahns-rackup +3 -2
- data/examples/yahns_rack_basic.conf.rb +7 -2
- data/extras/README +2 -2
- data/extras/autoindex.rb +3 -2
- data/extras/exec_cgi.rb +3 -2
- data/extras/proxy_pass.rb +6 -5
- data/extras/try_gzip_static.rb +4 -3
- data/lib/yahns.rb +15 -9
- data/lib/yahns/acceptor.rb +4 -3
- data/lib/yahns/cap_input.rb +2 -1
- data/lib/yahns/client_expire_generic.rb +3 -2
- data/lib/yahns/client_expire_tcpi.rb +3 -2
- data/lib/yahns/config.rb +23 -18
- data/lib/yahns/daemon.rb +3 -2
- data/lib/yahns/fdmap.rb +3 -2
- data/lib/yahns/http_client.rb +4 -7
- data/lib/yahns/http_context.rb +13 -10
- data/lib/yahns/http_response.rb +8 -5
- data/lib/yahns/log.rb +3 -2
- data/lib/yahns/max_body.rb +2 -1
- data/lib/yahns/max_body/rewindable_wrapper.rb +3 -2
- data/lib/yahns/max_body/wrapper.rb +10 -5
- data/lib/yahns/openssl_client.rb +3 -2
- data/lib/yahns/openssl_server.rb +3 -2
- data/lib/yahns/proxy_http_response.rb +8 -7
- data/lib/yahns/proxy_pass.rb +7 -5
- data/lib/yahns/queue.rb +3 -2
- data/lib/yahns/queue_egg.rb +3 -2
- data/lib/yahns/queue_epoll.rb +4 -3
- data/lib/yahns/queue_kqueue.rb +4 -3
- data/lib/yahns/queue_quitter.rb +3 -2
- data/lib/yahns/queue_quitter_pipe.rb +3 -2
- data/lib/yahns/rack.rb +5 -4
- data/lib/yahns/rackup_handler.rb +4 -2
- data/lib/yahns/sendfile_compat.rb +5 -8
- data/lib/yahns/server.rb +14 -3
- data/lib/yahns/server_mp.rb +4 -2
- data/lib/yahns/sigevent.rb +3 -2
- data/lib/yahns/sigevent_efd.rb +3 -2
- data/lib/yahns/sigevent_pipe.rb +3 -2
- data/lib/yahns/socket_helper.rb +4 -2
- data/lib/yahns/stream_file.rb +3 -2
- data/lib/yahns/stream_input.rb +5 -4
- data/lib/yahns/tcp_server.rb +3 -2
- data/lib/yahns/tee_input.rb +4 -2
- data/lib/yahns/tmpio.rb +2 -1
- data/lib/yahns/unix_server.rb +3 -2
- data/lib/yahns/wbuf.rb +3 -2
- data/lib/yahns/wbuf_common.rb +4 -2
- data/lib/yahns/wbuf_str.rb +3 -2
- data/lib/yahns/worker.rb +3 -2
- data/test/covshow.rb +3 -2
- data/test/helper.rb +3 -2
- data/test/server_helper.rb +3 -2
- data/test/test_bin.rb +3 -2
- data/test/test_buffer_tmpdir.rb +3 -2
- data/test/test_client_expire.rb +5 -4
- data/test/test_client_max_body_size.rb +4 -3
- data/test/test_config.rb +3 -2
- data/test/test_expect_100.rb +5 -4
- data/test/test_extras_autoindex.rb +3 -2
- data/test/test_extras_exec_cgi.rb +4 -3
- data/test/test_extras_exec_cgi.sh +2 -2
- data/test/test_extras_proxy_pass.rb +3 -2
- data/test/test_extras_try_gzip_static.rb +3 -2
- data/test/test_fdmap.rb +3 -2
- data/test/test_input.rb +4 -3
- data/test/test_mt_accept.rb +3 -2
- data/test/test_output_buffering.rb +4 -3
- data/test/test_proxy_pass.rb +15 -14
- data/test/test_rack.rb +3 -2
- data/test/test_rack_hijack.rb +3 -2
- data/test/test_reopen_logs.rb +3 -2
- data/test/test_response.rb +3 -2
- data/test/test_serve_static.rb +2 -2
- data/test/test_server.rb +15 -14
- data/test/test_ssl.rb +60 -9
- data/test/test_stream_file.rb +3 -2
- data/test/test_tmpio.rb +3 -2
- data/test/test_unix_socket.rb +3 -2
- data/test/test_wbuf.rb +3 -2
- data/yahns.gemspec +5 -2
- metadata +21 -6
- data/Documentation/yahns-rackup.txt +0 -152
- data/Documentation/yahns.txt +0 -72
- data/Documentation/yahns_config.txt +0 -584
data/test/test_rack.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
# Copyright (C) 2013-
|
2
|
-
# License:
|
1
|
+
# Copyright (C) 2013-2016 all contributors <yahns-public@yhbt.net>
|
2
|
+
# License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
|
3
|
+
# frozen_string_literal: true
|
3
4
|
require_relative 'helper'
|
4
5
|
require 'rack/lobster'
|
5
6
|
require 'yahns/rack'
|
data/test/test_rack_hijack.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
# Copyright (C) 2013-
|
2
|
-
# License:
|
1
|
+
# Copyright (C) 2013-2016 all contributors <yahns-public@yhbt.net>
|
2
|
+
# License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
|
3
|
+
# frozen_string_literal: true
|
3
4
|
require_relative 'server_helper'
|
4
5
|
|
5
6
|
class TestRackHijack < Testcase
|
data/test/test_reopen_logs.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
# Copyright (C) 2013-
|
2
|
-
# License:
|
1
|
+
# Copyright (C) 2013-2016 all contributors <yahns-public@yhbt.net>
|
2
|
+
# License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
|
3
|
+
# frozen_string_literal: true
|
3
4
|
require_relative 'server_helper'
|
4
5
|
require 'rack/commonlogger'
|
5
6
|
|
data/test/test_response.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
# Copyright (C) 2013-
|
2
|
-
# License:
|
1
|
+
# Copyright (C) 2013-2016 all contributors <yahns-public@yhbt.net>
|
2
|
+
# License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
|
3
|
+
# frozen_string_literal: true
|
3
4
|
require_relative 'server_helper'
|
4
5
|
|
5
6
|
class TestResponse < Testcase
|
data/test/test_serve_static.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
# Copyright (C) 2013-
|
2
|
-
# License:
|
1
|
+
# Copyright (C) 2013-2016 all contributors <yahns-public@yhbt.net>
|
2
|
+
# License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
|
3
3
|
require_relative 'server_helper'
|
4
4
|
require 'rack/file'
|
5
5
|
|
data/test/test_server.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
# Copyright (C) 2013-
|
2
|
-
# License:
|
1
|
+
# Copyright (C) 2013-2016 all contributors <yahns-public@yhbt.net>
|
2
|
+
# License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
|
3
|
+
# frozen_string_literal: true
|
3
4
|
require_relative 'server_helper'
|
4
5
|
|
5
6
|
class TestServer < Testcase
|
@@ -25,7 +26,7 @@ def test_single_process
|
|
25
26
|
# test pipelining
|
26
27
|
r = "GET / HTTP/1.1\r\nHost: example.com\r\n\r\n"
|
27
28
|
c.write(r + r)
|
28
|
-
buf =
|
29
|
+
buf = ''.dup
|
29
30
|
Timeout.timeout(10) do
|
30
31
|
until buf =~ /HI.+HI/m
|
31
32
|
buf << c.readpartial(4096)
|
@@ -34,7 +35,7 @@ def test_single_process
|
|
34
35
|
|
35
36
|
# trickle pipelining
|
36
37
|
c.write(r + "GET ")
|
37
|
-
buf =
|
38
|
+
buf = ''.dup
|
38
39
|
Timeout.timeout(10) do
|
39
40
|
until buf =~ /HI\z/
|
40
41
|
buf << c.readpartial(4096)
|
@@ -91,7 +92,7 @@ def input_body(btype)
|
|
91
92
|
buf = "PUT / HTTP/1.1\r\nContent-Length: 2\r\n\r\nHI"
|
92
93
|
c = get_tcp_client(host, port)
|
93
94
|
c.write(buf + buf)
|
94
|
-
buf =
|
95
|
+
buf = ''.dup
|
95
96
|
Timeout.timeout(10) do
|
96
97
|
until buf =~ /HI.+HI/m
|
97
98
|
buf << c.readpartial(4096)
|
@@ -110,7 +111,7 @@ def input_body(btype)
|
|
110
111
|
sleep(0.01) if b.chr == ":"
|
111
112
|
Thread.pass
|
112
113
|
end
|
113
|
-
buf =
|
114
|
+
buf = ''.dup
|
114
115
|
Timeout.timeout(10) do
|
115
116
|
until buf =~ /HIBYE.+HIBYE/m
|
116
117
|
buf << c.readpartial(4096)
|
@@ -427,7 +428,7 @@ def test_mp_hooks
|
|
427
428
|
worker_processes(1) do
|
428
429
|
atfork_child { puts "af #$$ worker is running" }
|
429
430
|
atfork_prepare { puts "af #$$ parent about to spawn" }
|
430
|
-
atfork_parent { puts "af #$$
|
431
|
+
atfork_parent { puts "af #$$ parent done spawning" }
|
431
432
|
end
|
432
433
|
}
|
433
434
|
stderr_path err.path
|
@@ -456,7 +457,7 @@ def test_mp_hooks
|
|
456
457
|
assert_equal("af #{pid} parent about to spawn", lines.shift)
|
457
458
|
|
458
459
|
# child/parent ordering is not guaranteed
|
459
|
-
assert_equal 1, lines.grep(/\Aaf #{pid}
|
460
|
+
assert_equal 1, lines.grep(/\Aaf #{pid} parent done spawning\z/).size
|
460
461
|
assert_equal 1, lines.grep(/\Aaf #{worker_pid} worker is running\z/).size
|
461
462
|
ensure
|
462
463
|
quit_wait(master_pid)
|
@@ -478,7 +479,7 @@ def test_mp_hooks_worker_nr
|
|
478
479
|
worker_processes(1) do
|
479
480
|
atfork_child { |nr| puts "af.#{nr} #$$ worker is running" }
|
480
481
|
atfork_prepare { |nr| puts "af.#{nr} #$$ parent about to spawn" }
|
481
|
-
atfork_parent { |nr| puts "af.#{nr} #$$
|
482
|
+
atfork_parent { |nr| puts "af.#{nr} #$$ parent done spawning" }
|
482
483
|
end
|
483
484
|
}
|
484
485
|
stderr_path err.path
|
@@ -502,7 +503,7 @@ def test_mp_hooks_worker_nr
|
|
502
503
|
|
503
504
|
# child/parent ordering is not guaranteed
|
504
505
|
assert_equal 1,
|
505
|
-
lines.grep(/\Aaf\.0 #{pid}
|
506
|
+
lines.grep(/\Aaf\.0 #{pid} parent done spawning\z/).size
|
506
507
|
assert_equal 1,
|
507
508
|
lines.grep(/\Aaf\.0 #{worker_pid} worker is running\z/).size
|
508
509
|
ensure
|
@@ -709,7 +710,7 @@ def _persistent_shutdown(nr_workers)
|
|
709
710
|
c = get_tcp_client(host, port)
|
710
711
|
c.write "GET / HTTP/1.1\r\nHost: example.com\r\n\r\n"
|
711
712
|
assert_equal c, c.wait(30)
|
712
|
-
buf =
|
713
|
+
buf = ''.dup
|
713
714
|
re = /\r\n\r\nOK\z/
|
714
715
|
Timeout.timeout(30) do
|
715
716
|
begin
|
@@ -781,7 +782,7 @@ def test_app_controls_close
|
|
781
782
|
|
782
783
|
# normal response
|
783
784
|
c.write "GET /keep-alive HTTP/1.1\r\nHost: example.com\r\n\r\n"
|
784
|
-
buf =
|
785
|
+
buf = ''.dup
|
785
786
|
Timeout.timeout(30) do
|
786
787
|
buf << c.readpartial(4096) until buf =~ /HI\z/
|
787
788
|
end
|
@@ -790,7 +791,7 @@ def test_app_controls_close
|
|
790
791
|
|
791
792
|
# we allow whatever in the response, but don't send it
|
792
793
|
c.write "GET /whatever HTTP/1.1\r\nHost: example.com\r\n\r\n"
|
793
|
-
buf =
|
794
|
+
buf = ''.dup
|
794
795
|
Timeout.timeout(30) do
|
795
796
|
buf << c.readpartial(4096) until buf =~ /HI\z/
|
796
797
|
end
|
@@ -798,7 +799,7 @@ def test_app_controls_close
|
|
798
799
|
assert_raises(Errno::EAGAIN,IO::WaitReadable) { c.read_nonblock(666) }
|
799
800
|
|
800
801
|
c.write "GET /close HTTP/1.1\r\nHost: example.com\r\n\r\n"
|
801
|
-
buf =
|
802
|
+
buf = ''.dup
|
802
803
|
Timeout.timeout(30) do
|
803
804
|
buf << c.readpartial(4096) until buf =~ /HI\z/
|
804
805
|
end
|
data/test/test_ssl.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
# Copyright (C)
|
2
|
-
# License:
|
1
|
+
# Copyright (C) 2013-2016 all contributors <yahns-public@yhbt.net>
|
2
|
+
# License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
|
3
|
+
# frozen_string_literal: true
|
3
4
|
require_relative 'server_helper'
|
4
5
|
require 'openssl'
|
5
6
|
class TestSSL < Testcase
|
@@ -62,29 +63,79 @@ def srv_ctx
|
|
62
63
|
|
63
64
|
def test_ssl_basic
|
64
65
|
err, cfg, host, port = @err, Yahns::Config.new, @srv.addr[3], @srv.addr[1]
|
66
|
+
insecure = TCPServer.new(ENV["TEST_HOST"] || "127.0.0.1", 0)
|
65
67
|
ctx = srv_ctx
|
68
|
+
raw = File.read(__FILE__)
|
66
69
|
pid = mkserver(cfg) do
|
70
|
+
ENV["YAHNS_FD"] += ",#{insecure.fileno.to_s}"
|
67
71
|
cfg.instance_eval do
|
68
|
-
ru = lambda
|
69
|
-
|
72
|
+
ru = lambda do |env|
|
73
|
+
case path_info = env['PATH_INFO']
|
74
|
+
when '/rack.url_scheme', '/HTTPS'
|
75
|
+
s = env[path_info[1..-1]] # remove leading slash
|
76
|
+
s = s.inspect if s.nil?
|
77
|
+
[ 200, {
|
78
|
+
'Content-Length' => s.bytesize.to_s,
|
79
|
+
'Content-Type'=>'text/plain',
|
80
|
+
}, [ s ] ]
|
81
|
+
when '/static'
|
82
|
+
f = File.open(__FILE__)
|
83
|
+
[ 200, {
|
84
|
+
'Content-Length' => f.size.to_s,
|
85
|
+
'Content-Type'=>'text/plain',
|
86
|
+
},
|
87
|
+
f ]
|
88
|
+
else
|
89
|
+
[ 200, {'Content-Length'=>'2'}, ['HI'] ]
|
90
|
+
end
|
91
|
+
end
|
92
|
+
app(:rack, ru) {
|
93
|
+
listen "#{host}:#{port}", ssl_ctx: ctx
|
94
|
+
listen "#{insecure.addr[3]}:#{insecure.addr[1]}"
|
95
|
+
}
|
70
96
|
logger(Logger.new(err.path))
|
71
97
|
end
|
72
98
|
end
|
73
99
|
client = ssl_client(host, port)
|
74
|
-
|
75
|
-
|
100
|
+
buf = ''.dup
|
101
|
+
{ '/' => 'HI',
|
102
|
+
'/rack.url_scheme' => 'https',
|
103
|
+
'/HTTPS' => 'on'
|
104
|
+
}.each do |path, exp|
|
105
|
+
client.write("GET #{path} HTTP/1.1\r\nHost: example.com\r\n\r\n")
|
106
|
+
buf.clear
|
107
|
+
re = /#{Regexp.escape(exp)}\z/
|
108
|
+
Timeout.timeout(60) do
|
109
|
+
buf << client.readpartial(111) until buf =~ re
|
110
|
+
end
|
111
|
+
head, body = buf.split("\r\n\r\n", 2)
|
112
|
+
assert_equal exp, body
|
113
|
+
assert_match %r{\AHTTP/1\.\d 200 OK\r\n}, head
|
114
|
+
end
|
115
|
+
|
116
|
+
Net::HTTP.start(insecure.addr[3], insecure.addr[1]) do |h|
|
117
|
+
res = h.get('/rack.url_scheme')
|
118
|
+
assert_equal 'http', res.body
|
119
|
+
res = h.get('/HTTPS')
|
120
|
+
assert_equal 'nil', res.body
|
121
|
+
end
|
122
|
+
|
123
|
+
# read static file
|
124
|
+
client.write("GET /static HTTP/1.1\r\nHost: example.com\r\n\r\n")
|
125
|
+
buf.clear
|
76
126
|
Timeout.timeout(60) do
|
77
|
-
buf << client.readpartial(
|
127
|
+
buf << client.readpartial(8192) until buf.include?(raw)
|
78
128
|
end
|
79
129
|
head, body = buf.split("\r\n\r\n", 2)
|
80
|
-
assert_equal "HI", body
|
81
130
|
assert_match %r{\AHTTP/1\.\d 200 OK\r\n}, head
|
131
|
+
assert_equal raw, body
|
82
132
|
|
83
133
|
client.write("GET / HTTP/1.0\r\n\r\n")
|
84
134
|
head, body = client.read.split("\r\n\r\n", 2)
|
85
135
|
assert_equal "HI", body
|
86
136
|
assert_match %r{\AHTTP/1\.\d 200 OK\r\n}, head
|
87
137
|
ensure
|
138
|
+
insecure.close if insecure
|
88
139
|
client.close if client
|
89
140
|
quit_wait(pid)
|
90
141
|
end
|
@@ -104,7 +155,7 @@ def test_ssl_hijack
|
|
104
155
|
when "remote_address\n"
|
105
156
|
s.puts(s.remote_address.inspect)
|
106
157
|
when "each\n"
|
107
|
-
line = ''
|
158
|
+
line = ''.dup
|
108
159
|
s.each do |l|
|
109
160
|
l.strip!
|
110
161
|
line << l
|
data/test/test_stream_file.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
# Copyright (C) 2013-
|
2
|
-
# License:
|
1
|
+
# Copyright (C) 2013-2016 all contributors <yahns-public@yhbt.net>
|
2
|
+
# License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
|
3
|
+
# frozen_string_literal: true
|
3
4
|
require_relative 'helper'
|
4
5
|
require 'timeout'
|
5
6
|
|
data/test/test_tmpio.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# -*- encoding: binary -*-
|
2
|
-
# Copyright (C) 2009-
|
3
|
-
# License:
|
2
|
+
# Copyright (C) 2009-2016 all contributors <yahns-public@yhbt.net>
|
3
|
+
# License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-2.0.txt)
|
4
|
+
# frozen_string_literal: true
|
4
5
|
require_relative 'helper'
|
5
6
|
|
6
7
|
class TestTmpIO < Testcase
|
data/test/test_unix_socket.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
# Copyright (C) 2013-
|
2
|
-
# License:
|
1
|
+
# Copyright (C) 2013-2016 all contributors <yahns-public@yhbt.net>
|
2
|
+
# License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
|
3
|
+
# frozen_string_literal: true
|
3
4
|
require_relative 'server_helper'
|
4
5
|
|
5
6
|
class TestUnixSocket < Testcase
|
data/test/test_wbuf.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
# Copyright (C) 2013-
|
2
|
-
# License:
|
1
|
+
# Copyright (C) 2013-2016 all contributors <yahns-public@yhbt.net>
|
2
|
+
# License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
|
3
|
+
# frozen_string_literal: true
|
3
4
|
require_relative 'helper'
|
4
5
|
require 'timeout'
|
5
6
|
|
data/yahns.gemspec
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
# Copyright (C) 2013-
|
2
|
-
# License:
|
1
|
+
# Copyright (C) 2013-2016 all contributors <yahns-public@yhbt.net>
|
2
|
+
# License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
manifest = File.read('.gem-manifest').split(/\n/)
|
5
5
|
s.name = %q{yahns}
|
@@ -22,6 +22,9 @@
|
|
22
22
|
# Matz Ruby release.
|
23
23
|
s.add_development_dependency(%q<minitest>, '>= 4.3', '< 6.0')
|
24
24
|
|
25
|
+
# for Rack::Utils::HeaderHash#each
|
26
|
+
s.add_development_dependency(%q<rack>, '>= 1.1')
|
27
|
+
|
25
28
|
s.homepage = "http://yahns.yhbt.net/README"
|
26
29
|
s.licenses = "GPL-3.0+"
|
27
30
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yahns
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- yahns hackers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: kgio
|
@@ -78,6 +78,20 @@ dependencies:
|
|
78
78
|
- - "<"
|
79
79
|
- !ruby/object:Gem::Version
|
80
80
|
version: '6.0'
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
name: rack
|
83
|
+
requirement: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '1.1'
|
88
|
+
type: :development
|
89
|
+
prerelease: false
|
90
|
+
version_requirements: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - ">="
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '1.1'
|
81
95
|
description: |-
|
82
96
|
A Free Software, multi-threaded, non-blocking network application server
|
83
97
|
designed for low _idle_ power consumption. It is primarily optimized
|
@@ -92,15 +106,16 @@ executables:
|
|
92
106
|
extensions: []
|
93
107
|
extra_rdoc_files: []
|
94
108
|
files:
|
109
|
+
- ".gitattributes"
|
95
110
|
- ".gitignore"
|
96
111
|
- ".olddoc.yml"
|
97
112
|
- COPYING
|
98
113
|
- Documentation/.gitignore
|
99
114
|
- Documentation/GNUmakefile
|
100
115
|
- Documentation/design_notes.txt
|
101
|
-
- Documentation/yahns-rackup.
|
102
|
-
- Documentation/yahns.
|
103
|
-
- Documentation/yahns_config.
|
116
|
+
- Documentation/yahns-rackup.pod
|
117
|
+
- Documentation/yahns.pod
|
118
|
+
- Documentation/yahns_config.pod
|
104
119
|
- GIT-VERSION-FILE
|
105
120
|
- GIT-VERSION-GEN
|
106
121
|
- GNUmakefile
|
@@ -221,7 +236,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
221
236
|
version: '0'
|
222
237
|
requirements: []
|
223
238
|
rubyforge_project:
|
224
|
-
rubygems_version: 2.5.
|
239
|
+
rubygems_version: 2.5.2
|
225
240
|
signing_key:
|
226
241
|
specification_version: 4
|
227
242
|
summary: sleepy, multi-threaded, non-blocking application server
|
@@ -1,152 +0,0 @@
|
|
1
|
-
% yahns-rackup(1) yahns user manual
|
2
|
-
|
3
|
-
# NAME
|
4
|
-
|
5
|
-
yahns-rackup - a rackup-like command to launch yahns
|
6
|
-
|
7
|
-
# SYNOPSIS
|
8
|
-
|
9
|
-
yahns-rackup [-E RACK_ENV] [-O worker_threads=NUM] [RACKUP_FILE]
|
10
|
-
|
11
|
-
# DESCRIPTION
|
12
|
-
|
13
|
-
A rackup(1)-like command to launch Rack applications using yahns.
|
14
|
-
It is expected to start in your application root (APP_ROOT).
|
15
|
-
|
16
|
-
# RACKUP FILE
|
17
|
-
|
18
|
-
This defaults to \"config.ru\" in APP_ROOT. It should be the same
|
19
|
-
file used by rackup(1) and other Rack launchers, it uses the
|
20
|
-
*Rack::Builder* DSL.
|
21
|
-
|
22
|
-
# YAHNS OPTIONS
|
23
|
-
-O client_timeout=SECONDS
|
24
|
-
: Defines the timeout expiring idle connections.
|
25
|
-
|
26
|
-
Increase this if your application takes longer to run than the
|
27
|
-
default timeout. Lower this if you run out of FDs.
|
28
|
-
|
29
|
-
Default: 15 (seconds)
|
30
|
-
|
31
|
-
-O listen=ADDRESS[,ADDRESS...]
|
32
|
-
: Listens on a given ADDRESS. ADDRESS may be in the form of
|
33
|
-
HOST:PORT or PATH, HOST:PORT is taken to mean a TCP socket
|
34
|
-
and PATH is meant to be a path to a UNIX domain socket.
|
35
|
-
Defaults to "0.0.0.0:9292" (all addresses on TCP port 9292).
|
36
|
-
Multiple addresses may be separated with commas.
|
37
|
-
|
38
|
-
-O stderr_path=PATHNAME
|
39
|
-
: Allow redirecting $stderr to a given path. Unlike doing this from
|
40
|
-
the shell, this allows the yahns process to know the path its
|
41
|
-
writing to and rotate the file if it is used for logging. The
|
42
|
-
file will be opened with the O_APPEND flag and writes
|
43
|
-
synchronized to the kernel (but not necessarily to _disk_) so
|
44
|
-
multiple processes can safely append to it.
|
45
|
-
|
46
|
-
If you are daemonizing and using the default logger, it is important
|
47
|
-
to specify this as errors will otherwise be lost to /dev/null.
|
48
|
-
Some applications/libraries may also triggering warnings that go to
|
49
|
-
stderr, and they will end up here.
|
50
|
-
|
51
|
-
Default: /dev/null if daemonized, controlling terminal if not
|
52
|
-
|
53
|
-
-O stdout_path=PATH
|
54
|
-
: Same as stderr_path, except for $stdout. Not many applications
|
55
|
-
write to $stdout, but any that do will have their output written here.
|
56
|
-
It is safe to point this to the same location a stderr_path.
|
57
|
-
Like stderr_path, this defaults to /dev/null when daemonized.
|
58
|
-
|
59
|
-
Default: /dev/null if daemonized, controlling terminal if not
|
60
|
-
|
61
|
-
-O worker_threads=INTEGER
|
62
|
-
: This controls the number of threads for application processing.
|
63
|
-
Each queue has its own thread pool. Increase this number if your
|
64
|
-
applications are able to use more threads effectively or if either
|
65
|
-
(or both) input/output buffering are disabled. Lower this number if
|
66
|
-
you do not need multi-thread concurrency at all.
|
67
|
-
|
68
|
-
Default: 7
|
69
|
-
|
70
|
-
# RACKUP OPTIONS
|
71
|
-
-D, \--daemonize
|
72
|
-
: Run daemonized in the background. The process is detached from
|
73
|
-
the controlling terminal and stdin is redirected to /dev/null.
|
74
|
-
Unless specified via stderr_path and stdout_path, stderr and stdout will
|
75
|
-
also be redirected to "/dev/null".
|
76
|
-
|
77
|
-
-E, \--env RACK_ENV
|
78
|
-
: Run under the given RACK_ENV. See the RACK ENVIRONMENT section
|
79
|
-
for more details.
|
80
|
-
|
81
|
-
-o, \--host HOST
|
82
|
-
: Listen on a TCP socket belonging to HOST, default is
|
83
|
-
"0.0.0.0" (all addresses).
|
84
|
-
If specified multiple times on the command-line, only the
|
85
|
-
last-specified value takes effect.
|
86
|
-
This option only exists for compatibility with the rackup(1) command,
|
87
|
-
use of "-l"/"\--listen" switch is recommended instead.
|
88
|
-
|
89
|
-
-p, \--port PORT
|
90
|
-
: Listen on the specified TCP PORT, default is 9292.
|
91
|
-
If specified multiple times on the command-line, only the last-specified
|
92
|
-
value takes effect.
|
93
|
-
This option only exists for compatibility with the rackup(1) command,
|
94
|
-
use of "-l"/"\--listen" switch is recommended instead.
|
95
|
-
|
96
|
-
# RUBY OPTIONS
|
97
|
-
-e, \--eval LINE
|
98
|
-
: Evaluate a LINE of Ruby code. This evaluation happens
|
99
|
-
immediately as the command-line is being parsed.
|
100
|
-
|
101
|
-
-d, \--debug
|
102
|
-
: Turn on debug mode, the $DEBUG variable is set to true.
|
103
|
-
|
104
|
-
-w, \--warn
|
105
|
-
: Turn on verbose warnings, the $VERBOSE variable is set to true.
|
106
|
-
|
107
|
-
-I, \--include PATH
|
108
|
-
: specify $LOAD_PATH. PATH will be prepended to $LOAD_PATH.
|
109
|
-
The \':\' character may be used to delimit multiple directories.
|
110
|
-
This directive may be used more than once. Modifications to
|
111
|
-
$LOAD_PATH take place immediately and in the order they were
|
112
|
-
specified on the command-line.
|
113
|
-
|
114
|
-
-r, \--require LIBRARY
|
115
|
-
: require a specified LIBRARY before executing the application. The
|
116
|
-
\"require\" statement will be executed immediately and in the order
|
117
|
-
they were specified on the command-line.
|
118
|
-
|
119
|
-
# SIGNALS
|
120
|
-
|
121
|
-
See yahns(1)
|
122
|
-
|
123
|
-
# FILES
|
124
|
-
|
125
|
-
See Rack documentation for a description of the rackup file format.
|
126
|
-
|
127
|
-
# ENVIRONMENT VARIABLES
|
128
|
-
|
129
|
-
The RACK_ENV variable is set by the aforementioned \-E switch.
|
130
|
-
If RACK_ENV is already set, it will be used unless \-E is used.
|
131
|
-
See rackup documentation for more details.
|
132
|
-
|
133
|
-
# CONTACT
|
134
|
-
|
135
|
-
All feedback welcome via plain-text mail to <yahns-public@yhbt.net>\
|
136
|
-
No subscription is necessary to post to the mailing list.
|
137
|
-
|
138
|
-
# COPYRIGHT
|
139
|
-
|
140
|
-
Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
|
141
|
-
License: GPLv3 or later <http://www.gnu.org/licenses/gpl-3.0.txt>
|
142
|
-
|
143
|
-
# SEE ALSO
|
144
|
-
|
145
|
-
yahns(1), yahns_config(5)
|
146
|
-
|
147
|
-
* *Rack::Builder* ri/RDoc
|
148
|
-
* [Rack RDoc][1]
|
149
|
-
* [Rackup HowTo][2]
|
150
|
-
|
151
|
-
[1]: http://rdoc.info/gems/r#/gems/rack/frames
|
152
|
-
[2]: http://wiki.github.com/rack/rack/tutorial-rackup-howto
|