gross 1.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG +410 -0
- data/README.md +102 -0
- data/Rakefile +25 -0
- data/bin/thin +6 -0
- data/example/adapter.rb +32 -0
- data/example/async_app.ru +126 -0
- data/example/async_chat.ru +247 -0
- data/example/async_tailer.ru +100 -0
- data/example/config.ru +22 -0
- data/example/monit_sockets +20 -0
- data/example/monit_unixsock +20 -0
- data/example/myapp.rb +1 -0
- data/example/ramaze.ru +12 -0
- data/example/thin.god +80 -0
- data/example/thin_solaris_smf.erb +36 -0
- data/example/thin_solaris_smf.readme.txt +150 -0
- data/example/vlad.rake +72 -0
- data/ext/thin_parser/common.rl +59 -0
- data/ext/thin_parser/ext_help.h +14 -0
- data/ext/thin_parser/extconf.rb +6 -0
- data/ext/thin_parser/parser.c +1447 -0
- data/ext/thin_parser/parser.h +49 -0
- data/ext/thin_parser/parser.rl +152 -0
- data/ext/thin_parser/thin.c +435 -0
- data/lib/rack/adapter/loader.rb +75 -0
- data/lib/rack/adapter/rails.rb +178 -0
- data/lib/thin.rb +45 -0
- data/lib/thin/backends/base.rb +167 -0
- data/lib/thin/backends/swiftiply_client.rb +56 -0
- data/lib/thin/backends/tcp_server.rb +34 -0
- data/lib/thin/backends/unix_server.rb +56 -0
- data/lib/thin/command.rb +53 -0
- data/lib/thin/connection.rb +215 -0
- data/lib/thin/controllers/cluster.rb +178 -0
- data/lib/thin/controllers/controller.rb +189 -0
- data/lib/thin/controllers/service.rb +76 -0
- data/lib/thin/controllers/service.sh.erb +39 -0
- data/lib/thin/daemonizing.rb +180 -0
- data/lib/thin/headers.rb +40 -0
- data/lib/thin/logging.rb +174 -0
- data/lib/thin/request.rb +162 -0
- data/lib/thin/response.rb +117 -0
- data/lib/thin/runner.rb +238 -0
- data/lib/thin/server.rb +290 -0
- data/lib/thin/stats.html.erb +216 -0
- data/lib/thin/stats.rb +52 -0
- data/lib/thin/statuses.rb +44 -0
- data/lib/thin/version.rb +32 -0
- metadata +156 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 172ed64fc8e7e961d4cd61635cacab063077143a
|
4
|
+
data.tar.gz: 9f3836dd8f40d281312d3bcc071725523540451a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 8b02bc0457f620773d8f86fbb622065f1f01c7629159cf4cb71aaa9a9c51ae99034013e615d62fa7bcd9c839b1c1e57f4fec982b29f1cd1df147aa65ea678dec
|
7
|
+
data.tar.gz: b2b0f23a29748dd9be3ab53065692135d5a64301d1b0bb40a3080bf90680a4ea4f15e7163ad984f0f7fd8260559f148486be130c3f80e8bbcfbe870ed9fc2708
|
data/CHANGELOG
ADDED
@@ -0,0 +1,410 @@
|
|
1
|
+
== 1.7.2 Bachmanity
|
2
|
+
* Add config support for ssl_version and ssl_cipher_list [frameworked]
|
3
|
+
|
4
|
+
== 1.7.1 Muffin Mode
|
5
|
+
* Ruby 2.4 support (Fixnum deprecation) [nimish-mehta]
|
6
|
+
* Allow ERB templates in config files [markets]
|
7
|
+
|
8
|
+
== 1.7.0 Dunder Mifflin
|
9
|
+
* Rack 2 support
|
10
|
+
* Ensure Response body.close is called in the same thread
|
11
|
+
Fixes issues with ActiveRecord connection management [#307]
|
12
|
+
* Fix TCP/IP Backend reports incorrect port when asked to bind to 0 [meschbach]
|
13
|
+
* Work with ruby 2.3's --enable-frozen-string-literal [jeremyevans]
|
14
|
+
|
15
|
+
== 1.6.4 Gob Bluth
|
16
|
+
* Increase REQUEST_PATH to 2048 symbols [X2rdas]
|
17
|
+
* Fix warning in logger [tenderlove]
|
18
|
+
* Add :timeout option for Rack::Server.new [sugitak]
|
19
|
+
* When restarting, exit on a next tick so we can send response back to a client [rsamoilov]
|
20
|
+
* Check for empty PID files [z1dane]
|
21
|
+
* Update Event Machine version to 1.0.4, Ruby 2.2.0 fix [freemanoid]
|
22
|
+
|
23
|
+
== 1.6.3 Protein Powder
|
24
|
+
* Add HTTP 422 status code [rajcybage]
|
25
|
+
* Add warning about EM reactor still running when stopping.
|
26
|
+
* Remove version number from "Server" HTTP header. [benbasson]
|
27
|
+
* Adding `--ssl-disable-verify` to allow disabling of client cert requests when SSL enabled [brucek]
|
28
|
+
* Ensure Tempfiles created by a large request are closed and deleted. [Tonkpils]
|
29
|
+
|
30
|
+
== 1.6.2 Doc Brown
|
31
|
+
* No longer replace response's body on HEAD request. Ensuring body.close will be called.
|
32
|
+
* Remove `---ssl-verify` option as EventMachine doesn't verify the certificate.
|
33
|
+
* Fix env['rack.peer_cert'] to return SSL certifcate.
|
34
|
+
|
35
|
+
== 1.6.1 Death Proof
|
36
|
+
* Regression: Default logger to STDOUT when using outside of CLI.
|
37
|
+
* Regression: Downgrade Rack required version back to 1.0 to work w/ prior Rails versions.
|
38
|
+
|
39
|
+
== 1.6.0 Greek Yogurt
|
40
|
+
* Accept absolute URL in request line, eg.: 'GET http://site.com/he/lo HTTP/1.1'.
|
41
|
+
* HEAD request no longer return a body in the response.
|
42
|
+
* No longer stop EventMachine's reactor loop unless it was started by Thin.
|
43
|
+
* Make request env keys upcasing locale-agnostic.
|
44
|
+
* Use Ruby's `Logger` for logging. [Akshay Moghe].
|
45
|
+
The logger can now be set using `Thin::Logging.logger=`.
|
46
|
+
Tracing of request is handled by a second logger, `Thin::Logging.trace_logger=`.
|
47
|
+
* Add --threadpool-size option to configure EM's thread pool size (default: 20).
|
48
|
+
* Pipelining is no longer supported.
|
49
|
+
|
50
|
+
== 1.5.1 Straight Razor
|
51
|
+
* Fix issue when running as another user/group without a PID file.
|
52
|
+
* Allow overriding Connection & Server response headers.
|
53
|
+
* Update vlad example [Mathieu Lemoine]
|
54
|
+
* Keep connections in a Hash to speedup deletion [slivu]
|
55
|
+
* Force kill using already known pid. Prevents "thin stop" from leaving a process that removed its
|
56
|
+
pid file, but is still running (e.g. hung on some at_exit callback) [Michal Kwiatkowski]
|
57
|
+
|
58
|
+
== 1.5.0 Knife
|
59
|
+
* Fix compilation under Ubuntu 12.04 with -Werror=format-security option.
|
60
|
+
* Raise an error when no PID file.
|
61
|
+
* Prevent duplicate response headers.
|
62
|
+
* Make proper response on exception [MasterLambaster].
|
63
|
+
* Automatically close idling pipeline connections on server stop [MasterLambaster].
|
64
|
+
|
65
|
+
== 1.4.1 Chromeo Fix
|
66
|
+
* Fix error when sending USR1 signal and no log file is supplied.
|
67
|
+
|
68
|
+
== 1.4.0 Chromeo
|
69
|
+
* kill -USR1 $PID for log rotation [catwell].
|
70
|
+
* Fix HUP signal being reseted after deamonization [atotic].
|
71
|
+
* Fix error with nil addresses in Connection#socket_address.
|
72
|
+
|
73
|
+
== 1.3.2 Low-bar Squat
|
74
|
+
* Remove mack and halcyon Rack adapters from automatic detection.
|
75
|
+
|
76
|
+
== 1.3.1 Triple Espresso
|
77
|
+
* Fix service not working pre 1.9.
|
78
|
+
|
79
|
+
== 1.3.0 Double Espresso
|
80
|
+
* BREAKING CHANGE: Thin no longer ships with fat Windows binaries.
|
81
|
+
From now on, to install on Windows, install https://github.com/oneclick/rubyinstaller/wiki/Development-Kit.
|
82
|
+
* BREAKING CHANGE: Remove automatic Content-Length setting.
|
83
|
+
It is now the responsibility of the app (or a middleware) to set the Content-Length.
|
84
|
+
* Log errors to STDERR [textgoeshere]
|
85
|
+
* Shut down gracefully when receiving SIGTERM [ddollar]
|
86
|
+
|
87
|
+
Processes are allowed a chance to shut down gracefully when receiving
|
88
|
+
SIGTERM (http://en.wikipedia.org/wiki/SIGTERM).
|
89
|
+
|
90
|
+
On Heroku, when shutting down a process, we send a SIGTERM followed 10
|
91
|
+
seconds later with a SIGKILL, similar to the behavior of the init daemon
|
92
|
+
on most Unix systems. This patch will allow Heroku apps to shut down
|
93
|
+
gracefully when they need to be terminated / moved.
|
94
|
+
|
95
|
+
== 1.2.11 Bat-Shit Crazy
|
96
|
+
* Fix pure Ruby gem to not include binary.
|
97
|
+
|
98
|
+
== 1.2.10 I'm dumb (BAD RELEASE, DON'T USE)
|
99
|
+
* I really am (bad release fix)
|
100
|
+
|
101
|
+
== 1.2.9 Black Keys Extra Plus Wow (BAD RELEASE, DON'T USE)
|
102
|
+
* Improve fat binary loading.
|
103
|
+
|
104
|
+
== 1.2.8 Black Keys
|
105
|
+
* Allow the connection to remain open for 1xx statuses [timshadel]
|
106
|
+
|
107
|
+
Both the 100 and 101 status codes require that the connection to the
|
108
|
+
server remain open. The 100 status code is used to tell the client that
|
109
|
+
the server is still receiving its request, and will continue to read
|
110
|
+
request input on the connection. The 101 status code is used to upgrade
|
111
|
+
the existing connection to another protocol, and specifically is NOT
|
112
|
+
used to upgrade a separate connection. Therefore, the connection must
|
113
|
+
remain open after this response in order to facilitate that.
|
114
|
+
|
115
|
+
* Accept IE7 badly encoded URL (eg.: %uEEEE)
|
116
|
+
* Fix gemspec to work w/ Bundler [smparkes]
|
117
|
+
* Add SSL support [tmm1]
|
118
|
+
* Catch Errno::EPERM in Process.running? [Tony Kemp]
|
119
|
+
On some systems (e.g. OpenBSD) you receive an EPERM exception if
|
120
|
+
you try to Process.getpgid on a process you do not own (even if you
|
121
|
+
are root). But it does mean that the process exists, so return true.
|
122
|
+
* Fix Rails version check that select which Rack adapter to use. Was using CGI adapter in Rails 3.
|
123
|
+
* Ignore SIGHUP when no restart block is given
|
124
|
+
* Add SSL options to thin command line tool [goldmann]
|
125
|
+
|
126
|
+
--ssl Enables SSL
|
127
|
+
--ssl-key-file PATH Path to private key
|
128
|
+
--ssl-cert-file PATH Path to certificate
|
129
|
+
--ssl-verify Enables SSL certificate verification
|
130
|
+
|
131
|
+
* Expose peer SSL certificate in env (rack.peer_cert) [fd]
|
132
|
+
* Adjusting unix socket permissions to be more open [mbj]
|
133
|
+
|
134
|
+
== 1.2.7 No Hup
|
135
|
+
* Support multiple Ruby version (fat binaries under windows)
|
136
|
+
* Do not trap unsupported HUP signal on Windows
|
137
|
+
|
138
|
+
== 1.2.6 Crazy Delicious
|
139
|
+
* Make work with Rails 3 out-of-the-box.
|
140
|
+
* Auto-detect and load config.ru files on start. Makes Rails 3 work.
|
141
|
+
* Fix signals being ignored under 1.9 when daemonized.
|
142
|
+
|
143
|
+
== 1.2.5 This Is Not A Web Server
|
144
|
+
* Add rolling restart support (--onebyone option) [sikachu]
|
145
|
+
* Force external_encoding of request's body to ASCII_8BIT [jeremyz]
|
146
|
+
* Ensure Rack base API is used in Rails adapter only if version >= 2.3.2 [#111 state:resolved]
|
147
|
+
|
148
|
+
== 1.2.4 Flaming Astroboy
|
149
|
+
* Fix a few issues in thin to make it a better "gem citizen" [josh]
|
150
|
+
* Fix test for rack based Rails in adapter under Ruby >= 1.8.7 [#109 state:resolved]
|
151
|
+
* Fix Remote address spoofing vulnerability in Connection#remote_address [Alexey Borzenkov]
|
152
|
+
* Fix uninitialized constant ActionController::Dispatcher error with Rails 1.2.3 [Chris Anderton] [#103 state:resolved]
|
153
|
+
|
154
|
+
== 1.2.2 I Find Your Lack of Sauce Disturbing release
|
155
|
+
* Fix force kill under 1.9 [Alexey Chebotar]
|
156
|
+
* Fix regression when --only option is used w/ --socket.
|
157
|
+
* Add process name 'tag' functionality. Easier to distinguish thin daemons
|
158
|
+
from eachother in process listing [ctcherry]
|
159
|
+
|
160
|
+
== 1.2.1 Asynctilicious Ultra Supreme release
|
161
|
+
* Require Rack 1.0.0
|
162
|
+
* Require EventMachine 0.12.6
|
163
|
+
* Use Rails Rack based dispatcher when available
|
164
|
+
* Allow String for response body
|
165
|
+
* Require openssl before eventmachine to prevent crash in 1.9
|
166
|
+
|
167
|
+
== 1.2.0 Asynctilicious Supreme release
|
168
|
+
* Add support for Windows mingw Ruby distro [Juan C. Rodriguez]
|
169
|
+
* Add async response support, see example/async_*.ru [raggi]
|
170
|
+
|
171
|
+
== 1.1.1 Super Disco Power Plus release
|
172
|
+
* Fix bug when running with only options [hasimo]
|
173
|
+
|
174
|
+
== 1.1.0 Super Disco Power release
|
175
|
+
* Require EventMachine 0.12.4
|
176
|
+
* Remove Thin handler, now part of Rack 0.9.1
|
177
|
+
* Fix Rack protocol version to 0.1 in environment hash.
|
178
|
+
* Fix error when passing no_epoll option to a cluster.
|
179
|
+
* Omit parsing #defined strings [Jérémy Zurcher]
|
180
|
+
* Defaults SERVER_NAME to localhost like webrick does [#87 state:resolved]
|
181
|
+
* Namespace parser to prevent error when mongrel is required [cliffmoon]
|
182
|
+
* Set RACK_ENV based on environment option when loading rackup file [Curtis Summers] [#83 state:resolved]
|
183
|
+
* Fixes a warning RE relative_url_root when using a prefix with Rails 2.1.1 [seriph] [#85 state:resolved]
|
184
|
+
* --only can work as a sequence number (if < 80) or a port number (if >= 80) [jmay] [#81 state:resolved]
|
185
|
+
|
186
|
+
== 1.0.0 That's What She Said release
|
187
|
+
* Fixed vlad.rake to allow TCP or socket [hellekin]
|
188
|
+
* Updated Mack adapter to handle both <0.8.0 and >0.8.0 [Mark Bates]
|
189
|
+
* rails rack adapter uses File.readable_real? so it recognizes ACL permissions [Ricardo Chimal]
|
190
|
+
* Log a warning if Rack application returns nil body [Michael S. Klishin]
|
191
|
+
* Handle nil and Time header values correctly [#76 state:resolved] [tmm1]
|
192
|
+
* Add Content-Length header to response automatically when possible [#74 state:resolved] [dkubb]
|
193
|
+
* Runner now remembers -r, -D and -V parameters so that clustered servers inherit those and
|
194
|
+
`restart` keep your parameters.
|
195
|
+
* Make Set-Cookie header, in Rails adapter, compatible with current Rack spec [Pedro Belo]
|
196
|
+
[#73, state:resolved]
|
197
|
+
* Add --no-epoll option to disable epoll usage on Linux [#61 state:resolved]
|
198
|
+
* Add --force (-f) option to force stopping of a daemonized server [#72 state:resolved]
|
199
|
+
* Update halycon adapter loader [mtodd]
|
200
|
+
|
201
|
+
== 0.8.2 Double Margarita release
|
202
|
+
* Require EventMachine 0.12.0
|
203
|
+
* [bug] Fix timeout handling when running command
|
204
|
+
* [bug] Fix hanging when restarting and no process is running in single server move, fixes #67
|
205
|
+
* Added Mack adapter [markbates]
|
206
|
+
* Allow rackup .rb files by getting a conventionally named constant as the app [bmizerany]
|
207
|
+
|
208
|
+
== 0.8.1 Rebel Porpoise release
|
209
|
+
* [bug] Rescue all types of errors when processing request, fixes #62
|
210
|
+
* [bug] Use Swiftiply backend when -y option is specified, fixes #63 and #64
|
211
|
+
* Allow passing port as a string in Server.new
|
212
|
+
* Define deferred?(env) in your Rack application to set if a request is handled in a
|
213
|
+
thread (return true) or not (return false).
|
214
|
+
|
215
|
+
== 0.8.0 Dodgy Dentist release
|
216
|
+
* [bug] Fix server crash when header too large.
|
217
|
+
* Add --require (-r) option to require a library, before executing your script.
|
218
|
+
* Rename --rackup short option to -R, warn and load as rackup when file ends with .ru.
|
219
|
+
* List supported adapters in command usage.
|
220
|
+
* Add file adapter to built-in adapter, serve static files in current directory.
|
221
|
+
* Allow disabling signal handling in Server with :signals => false
|
222
|
+
* Make Server.new arguments more flexible, can now specify any of host, port, app or hash options.
|
223
|
+
* Add --backend option to specified which backend to use, closes #55
|
224
|
+
* [bug] Serve static file only on GET and HEAD requests in Rails adapter, fixes #58
|
225
|
+
* Add threaded option to run server in threaded mode, calling the application in a
|
226
|
+
thread allowing for concurrency in the Rack adapter, closes #46
|
227
|
+
* Guess which adapter to use from directory (chdir option)
|
228
|
+
or use specified one in 'adapter' option, re #47.
|
229
|
+
|
230
|
+
== 0.7.1 Fancy Pants release
|
231
|
+
* Clean stale PID files when starting as daemon, fixes #53 [Chu Yeow]
|
232
|
+
* Require EventMachine 0.11.0 for UNIX domain sockets. Until it's released, install from:
|
233
|
+
gem install eventmachine --source http://code.macournoyer.com
|
234
|
+
* Ruby 1.8.5 compatibility, closes #49 [Wincent Colaiuta]
|
235
|
+
* Move all EventMachine stuff out of Server, you can now create a Thin Backend that
|
236
|
+
does not depend on EventMachine.
|
237
|
+
* Rename Connector to Backend. Extend Thin::Backends::Base to implement your own.
|
238
|
+
* Fix high memory usage with big POST body, fixes #48
|
239
|
+
|
240
|
+
== 0.7.0 Spherical Cow release
|
241
|
+
* Add --max-persistent-conns option to sets the maximum number of persistent connections.
|
242
|
+
Set to 0 to disable Keep-Alive.
|
243
|
+
* INT signal now force stop and QUIT signal gracefully stops.
|
244
|
+
* Warn when descriptors table size can't be set as high as expected.
|
245
|
+
* Eval Rackup config file using top level bindings.
|
246
|
+
* Remove daemons gem dependency on Windows plateform, fixes #45.
|
247
|
+
* Change default timeout from 60 to 30 seconds.
|
248
|
+
* Add --max-conns option to sets the maximum number of file or socket descriptors that
|
249
|
+
your process may open, defaults to 1024.
|
250
|
+
* Tail logfile when stopping and restarting a demonized server, fixes #26.
|
251
|
+
* Wrap application in a Rack::CommonLogger adapter in debug mode.
|
252
|
+
* --debug (-D) option no longer set $DEBUG so logging will be less verbose
|
253
|
+
and Ruby won't be too strict, fixes #36.
|
254
|
+
* Deprecate Server#silent in favour of Logging.silent.
|
255
|
+
* Persistent connection (keep-alive) support.
|
256
|
+
* Fix -s option not being included in generated config file, fixes #37.
|
257
|
+
* Add Swiftiply support. Use w/ the --swiftiply (-y) option in the thin script,
|
258
|
+
closes #28 [Alex MacCaw]
|
259
|
+
|
260
|
+
== 0.6.4 Sexy Lobster release
|
261
|
+
* Fix error when stopping server on UNIX domain socket, fixes #42
|
262
|
+
* Rescue errors in Connection#get_peername more gracefully, setting REMOTE_ADDR to nil, fixes #43
|
263
|
+
|
264
|
+
== 0.6.3 Ninja Cookie release
|
265
|
+
* Add tasks for Vlad the Deployer in example/vlad.rake [cnantais]
|
266
|
+
* Add Ramaze Rackup config file in example dir [tmm1]
|
267
|
+
Use like this from you Ramaze app dir:
|
268
|
+
|
269
|
+
thin start -r /path/to/thin/example/ramaze.ru
|
270
|
+
|
271
|
+
* Add the --rackup option to load a Rack config file instead of the Rails adapter.
|
272
|
+
So you can use any framework with the thin script and start cluster and stuff like that.
|
273
|
+
A Rack config file is one that is usable through the rackup command and looks like this:
|
274
|
+
|
275
|
+
use Rack::CommonLogger
|
276
|
+
run MyCrazyRackAdapter.new(:uterly, 'cool')
|
277
|
+
|
278
|
+
Then use it with thin like this:
|
279
|
+
|
280
|
+
thin start --rackup config.ru
|
281
|
+
|
282
|
+
* thin config --chrdir ... -C thin/yml do not change current directory anymore, fixes #33.
|
283
|
+
* Add a better sample god config file in example/thin.god that loads all info from config
|
284
|
+
files in /etc/thin. Drop-in replacement for the thin runlevel service [Gump].
|
285
|
+
* Add support for specifying a custom Connector to the server and add more doc about Server
|
286
|
+
configuration.
|
287
|
+
* Add a script to run thin as a runlevel service that can start at startup, closes #31 [Gump]
|
288
|
+
Setup the service like this:
|
289
|
+
|
290
|
+
sudo thin install /etc/thin
|
291
|
+
|
292
|
+
This will install the boot script under /etc/init.d/thin. Then copy your config files to
|
293
|
+
/etc/thin. Works only under Linux.
|
294
|
+
* Set process name to 'thin server (0.0.0.0:3000)' when running as a daemon, closes #32.
|
295
|
+
* Make sure chdir option from config file is used when present.
|
296
|
+
* Raise an error when starting a server as a daemon and pid file already exist, fixes #27.
|
297
|
+
|
298
|
+
== 0.6.2 Rambo release
|
299
|
+
* Server now let current connections finish before stopping, fixes #18
|
300
|
+
* Fix uploading hanging bug when body is moved to a tempfile,
|
301
|
+
also delete the tempfile properly upon completion, fixes #25
|
302
|
+
* 'thin restart' now sends HUP signals rather then stopping & starting, closes #17
|
303
|
+
* HUP signal now launches a new process with the same options.
|
304
|
+
* Add PID and more info from the last request to the Stats adapter
|
305
|
+
mostly taken from Rack::ShowException.
|
306
|
+
* pid and log files in cluster are no longer required to be relative to the
|
307
|
+
app directory (chdir option), fixes #24
|
308
|
+
* Revert to using #each when building response headers under Ruby 1.8,
|
309
|
+
solves an issue w/ Camping adapter, fixes #22
|
310
|
+
* Restructure thin script options in 3 sections: server, daemon and cluster
|
311
|
+
* Add --only (-o) option to control only one server of a cluster.
|
312
|
+
* Stylize stats page and make the url configurable from the thin script.
|
313
|
+
* Raise error if attempting to use unix sockets on windows.
|
314
|
+
* Add example config files for http://www.tildeslash.com/monit usage.
|
315
|
+
Include the example file using "include /path/to/thin/monit/file" in your monitrc file.
|
316
|
+
The group settings let you do this to manage your clusters:
|
317
|
+
|
318
|
+
sudo monit -g blog restart all
|
319
|
+
|
320
|
+
There are examples of thin listening on sockets and thin listening on unix sockets.
|
321
|
+
|
322
|
+
== 0.6.1 Cheesecake release
|
323
|
+
* Remove socket file when server stops.
|
324
|
+
* Set back cluster to use 'thin' command to launch servers.
|
325
|
+
|
326
|
+
== 0.6.0 Big Pony release
|
327
|
+
* Add support for connection through UNIX domain socket.
|
328
|
+
Use the --socket (-S) option w/ the thin script to configure the socket filename.
|
329
|
+
Nginx support binding to a UNIX socket like this:
|
330
|
+
|
331
|
+
upstream backend {
|
332
|
+
server unix:/tmp/thin.0.sock;
|
333
|
+
server unix:/tmp/thin.1.sock;
|
334
|
+
server unix:/tmp/thin.2.sock;
|
335
|
+
}
|
336
|
+
|
337
|
+
Start your servers like this:
|
338
|
+
|
339
|
+
thin start -s3 -S/tmp/thin.sock
|
340
|
+
|
341
|
+
* Remove Server#listen! method. Use Server#start instead.
|
342
|
+
* Server can now yield a Rack::Builder to allow building an app in one call:
|
343
|
+
|
344
|
+
Server.start '0.0.0.0', 3000 do
|
345
|
+
use Rack::CommonLogger
|
346
|
+
use Rack::ShowExceptions
|
347
|
+
map "/lobster" do
|
348
|
+
use Rack::Lint
|
349
|
+
run Rack::Lobster.new
|
350
|
+
end
|
351
|
+
end
|
352
|
+
|
353
|
+
* Add a very basic stats page through Stats adapter, load w/ --stats and browse to /stats.
|
354
|
+
* Add --trace (-V) option to trace request/response and get backtrace w/out all Ruby debug stuff.
|
355
|
+
* Add --config (-C) option to load options from a config file in thin script [Matt Todd].
|
356
|
+
* Alter response headers to output directly to a string.
|
357
|
+
* Improve specs stability.
|
358
|
+
* Move request body to a Tempfile if too big (> 112 KB)
|
359
|
+
* Remove useless check for max header size in Request (already done in the parser)
|
360
|
+
|
361
|
+
== 0.5.4 Flying Mustard release
|
362
|
+
* Don't read the full body, use direct streaming when sending response.
|
363
|
+
See: Response#each
|
364
|
+
As a result, the Content-Length can not be calculated anymore.
|
365
|
+
You have to do set this in your adapter. All frameworks do it anyway.
|
366
|
+
It improve memory usage and boost speed for low concurrency.
|
367
|
+
Thanks to Kent Sibilev and Ezra for their help on that one.
|
368
|
+
* Add 'Server' response header
|
369
|
+
* Fix --user and --group option not changing daemon process privileges
|
370
|
+
|
371
|
+
== 0.5.3 Purple Yogurt release
|
372
|
+
* win32 pre-compiled gem now available
|
373
|
+
* change rake task configuration to allow win32 gem build
|
374
|
+
* Add prefix option to thin script to mount app under a given path.
|
375
|
+
|
376
|
+
== 0.5.2 Cheezburger release
|
377
|
+
* Add cluster support through the -s option in the thin script, start 3 thins like this:
|
378
|
+
thin start -s3 -p3000
|
379
|
+
3 thin servers will be started on port 3000, 3001, 3002, also the port number will be
|
380
|
+
injected in the pid and log filenames.
|
381
|
+
* Fix IOError when writing to logger when starting server as a daemon.
|
382
|
+
* Really change directory when the -c option is specified.
|
383
|
+
* Add restart command to thin script.
|
384
|
+
* Fix typos in thin script usage message and expand chdir path.
|
385
|
+
* Rename thin script options to be the same as mongrel_rails script [thronedrk]:
|
386
|
+
-o --host => -a --address
|
387
|
+
--log-file => --log
|
388
|
+
--pid-file => --pid
|
389
|
+
--env => --environment
|
390
|
+
|
391
|
+
== 0.5.1 LOLCAT release
|
392
|
+
* Add URL rewriting to Rails adapter so that page caching works and / fetches index.html if present.
|
393
|
+
* Fix bug in multiline response header parsing.
|
394
|
+
* Add specs for the Rails adapter.
|
395
|
+
* Fix Set-Cookie headers in Rails adapter to handle multiple values correctly.
|
396
|
+
* Fix Ruby 1.9 incompatibility in Response#headers= and Rakefile.
|
397
|
+
* Fix parser to be Ruby 1.9 compatible [Aman Gupta]
|
398
|
+
* Set gemspec to use EventMachine version 0.8.1 as it's the latest one having precompiled windows binaries.
|
399
|
+
[Francis Cianfrocca].
|
400
|
+
* Add -D option to thin script to set debugging on.
|
401
|
+
* Output incoming data and response when debugging is on.
|
402
|
+
|
403
|
+
== 0.5.0
|
404
|
+
* Full rewrite to use EventMachine, Rack and Mongrel parser
|
405
|
+
|
406
|
+
== 0.4.1
|
407
|
+
* Fix Rails environment option not being used in thin script.
|
408
|
+
|
409
|
+
== 0.4.0
|
410
|
+
* First alphaish release as a gem.
|
data/README.md
ADDED
@@ -0,0 +1,102 @@
|
|
1
|
+
# Thin
|
2
|
+
|
3
|
+
A small and fast Ruby web server
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
```
|
8
|
+
gem install thin
|
9
|
+
```
|
10
|
+
|
11
|
+
Or add `thin` to your `Gemfile`:
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
gem 'thin'
|
15
|
+
```
|
16
|
+
|
17
|
+
## Usage
|
18
|
+
|
19
|
+
A +thin+ script offers an easy way to start your Rack application:
|
20
|
+
|
21
|
+
```
|
22
|
+
thin start
|
23
|
+
```
|
24
|
+
|
25
|
+
Browse the `example` directory for sample applications.
|
26
|
+
|
27
|
+
## Usage with Rails Action Cable
|
28
|
+
|
29
|
+
To use Thin with Action Cable, add the following to your `Gemfile`:
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
gem 'faye-websocket'
|
33
|
+
gem 'thin' # If not already done
|
34
|
+
```
|
35
|
+
|
36
|
+
Create a `config/initializers/thin_action_cable.rb`:
|
37
|
+
|
38
|
+
```ruby
|
39
|
+
Rails.application.config.action_cable.use_faye = true
|
40
|
+
Faye::WebSocket.load_adapter 'thin'
|
41
|
+
```
|
42
|
+
|
43
|
+
### CLI
|
44
|
+
|
45
|
+
Use a rackup (config.ru) file and bind to localhost port 8080:
|
46
|
+
|
47
|
+
```
|
48
|
+
thin -R config.ru -a 127.0.0.1 -p 8080 start
|
49
|
+
```
|
50
|
+
|
51
|
+
Store the server process ID, log to a file and daemonize:
|
52
|
+
|
53
|
+
```
|
54
|
+
thin -p 9292 -P tmp/pids/thin.pid -l logs/thin.log -d start
|
55
|
+
```
|
56
|
+
|
57
|
+
Thin is quite flexible in that many options can be specified at the command line (see `thin -h` for more).
|
58
|
+
|
59
|
+
### Configuration files
|
60
|
+
|
61
|
+
You can create a configuration file using `thin config -C config/thin.yml`.
|
62
|
+
|
63
|
+
You can then use it with all commands, such as: `thin start -C config/thin.yml`.
|
64
|
+
|
65
|
+
Here is an example config file:
|
66
|
+
|
67
|
+
```yaml
|
68
|
+
---
|
69
|
+
user: www-data
|
70
|
+
group: www-data
|
71
|
+
pid: tmp/pids/thin.pid
|
72
|
+
timeout: 30
|
73
|
+
wait: 30
|
74
|
+
log: log/thin.log
|
75
|
+
max_conns: 1024
|
76
|
+
require: []
|
77
|
+
environment: production
|
78
|
+
max_persistent_conns: 512
|
79
|
+
servers: 1
|
80
|
+
threaded: true
|
81
|
+
no-epoll: true
|
82
|
+
daemonize: true
|
83
|
+
socket: tmp/sockets/thin.sock
|
84
|
+
chdir: /path/to/your/apps/root
|
85
|
+
tag: a-name-to-show-up-in-ps aux
|
86
|
+
```
|
87
|
+
|
88
|
+
## License
|
89
|
+
|
90
|
+
Ruby License, http://www.ruby-lang.org/en/LICENSE.txt.
|
91
|
+
|
92
|
+
## Credits
|
93
|
+
|
94
|
+
The parser was originally from Mongrel http://mongrel.rubyforge.org by Zed Shaw.
|
95
|
+
Mongrel is copyright 2007 Zed A. Shaw and contributors. It is licensed under
|
96
|
+
the Ruby license and the GPL2.
|
97
|
+
|
98
|
+
Thin is copyright Marc-Andre Cournoyer <macournoyer@gmail.com>
|
99
|
+
|
100
|
+
Get help at http://groups.google.com/group/thin-ruby/
|
101
|
+
Report bugs at https://github.com/macournoyer/thin/issues
|
102
|
+
and major security issues directly to me at macournoyer@gmail.com.
|