anycable-thruster 0.1.3-x86_64-darwin
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +129 -0
- data/exe/thrust +11 -0
- data/exe/x86_64-darwin/thrust +0 -0
- data/lib/anycable/thruster/version.rb +16 -0
- data/lib/thruster/version.rb +3 -0
- data/lib/thruster.rb +4 -0
- metadata +55 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2052f2736d4e6e2c4b6e4e86272aab6527bacf51683ff6f50688d5c09e8b9e96
|
4
|
+
data.tar.gz: 53dc6979963191d54207f70e7d8067ec96690fba3d972a6df73b8dd25aa5ec6a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 500e4efe584e6ab6eb9da1b42c364ef61a441261231e4d3041f794fc5529f56c014f3992cde43335b5845c2329d8e1fd1b185a2e1eb015b02db1d995f697224c
|
7
|
+
data.tar.gz: 7a66c8c09df857879777b69d5d1acfd7f32eada4fa5410845ae504fc2fa0b9bb288cabb99a317ee693fd68aca90be72940dfdd6cdc8b00d03e17090eb39a5a00
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 37signals, LLC
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,129 @@
|
|
1
|
+
# Thruster (AnyCabled)
|
2
|
+
|
3
|
+
> [!IMPORTANT]
|
4
|
+
> This is a fork of Basecamp's [thruster](https://github.com/basecamp/thruster) that embeds [AnyCable](https://anycable.io) right into the `thrust` proxy server.
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
|
8
|
+
To add AnyCable Thruster to your Ruby/Rails project, simply replace the original `thruster` gem with `anycable-thruster`:
|
9
|
+
|
10
|
+
```diff
|
11
|
+
- gem "thruster"
|
12
|
+
+ gem "anycable-thruster"
|
13
|
+
```
|
14
|
+
|
15
|
+
That's it! Everything else stays the same as with a regular Thruster.
|
16
|
+
|
17
|
+
## AnyCable configuration
|
18
|
+
|
19
|
+
AnyCable is enabled by default and accepts WebSocket requests at the `/cable` path. You can disable AnyCable and use Thruster as is by setting the `DISABLE_ANYCABLE` environment variable to `1` to `true`.
|
20
|
+
|
21
|
+
To configure AnyCable server, you can use `ANYCABLE_XXX` env variables as usual or pass command-line options via the `ANYCABLE_OPT` enviroment variable. For example, the following two commands are equivalent:
|
22
|
+
|
23
|
+
```sh
|
24
|
+
ANYCABLE_DEBUG=true thrust bin/rails s
|
25
|
+
|
26
|
+
ANYCABLE_OPT="-debug" thrust bin/rails s
|
27
|
+
```
|
28
|
+
|
29
|
+
----
|
30
|
+
|
31
|
+
> [!NOTE]
|
32
|
+
> This is the original Thruster readme without any modifications.
|
33
|
+
|
34
|
+
Thruster is an HTTP/2 proxy for simple production-ready deployments of Rails
|
35
|
+
applications. It runs alongside the Puma webserver to provide a few additional
|
36
|
+
features that help your app run efficiently and safely on the open Internet:
|
37
|
+
|
38
|
+
- HTTP/2 support
|
39
|
+
- Automatic SSL certificate management with Let's Encrypt
|
40
|
+
- Basic HTTP caching of public assets
|
41
|
+
- X-Sendfile support and compression, to efficiently serve static files
|
42
|
+
|
43
|
+
Thruster aims to be as zero-config as possible. It has no configuration file,
|
44
|
+
and most features are automatically enabled with sensible defaults. The goal is
|
45
|
+
that simply running your Puma server with Thruster should be enough to get a
|
46
|
+
production-ready setup.
|
47
|
+
|
48
|
+
The only exception to this is SSL provisioning: in order for Thruster to
|
49
|
+
provision SSL certificates, it needs to know which domain those certificates
|
50
|
+
should be for. So to use SSL, you need to set the `SSL_DOMAIN` environment
|
51
|
+
variable. If you don't set this variable, Thruster will run in HTTP-only mode.
|
52
|
+
|
53
|
+
Thruster also wraps the Puma process so that you can use it without managing
|
54
|
+
multiple processes yourself. This is particularly useful when running in a
|
55
|
+
containerized environment, where you typically won't have a process manager
|
56
|
+
available to coordinate the processes. Instead you can use Thruster as your
|
57
|
+
`CMD`, and it will manage Puma for you.
|
58
|
+
|
59
|
+
Thruster was originally created for the [ONCE](https://once.com) project, where
|
60
|
+
we wanted a no-fuss way to serve a Rails application from a single container,
|
61
|
+
directly on the open Internet. We've since found it useful for simple
|
62
|
+
deployments of other Rails applications.
|
63
|
+
|
64
|
+
|
65
|
+
## Installation
|
66
|
+
|
67
|
+
Thruster is distributed as a Ruby gem. Because Thruster is written in Go, we
|
68
|
+
provide several pre-built platform-specific binaries. Installing the gem will
|
69
|
+
automatically fetch the appropriate binary for your platform.
|
70
|
+
|
71
|
+
To install it, add it to your application's Gemfile:
|
72
|
+
|
73
|
+
```ruby
|
74
|
+
gem 'thruster'
|
75
|
+
```
|
76
|
+
|
77
|
+
Or install it globally:
|
78
|
+
|
79
|
+
```sh
|
80
|
+
$ gem install thruster
|
81
|
+
```
|
82
|
+
|
83
|
+
|
84
|
+
## Usage
|
85
|
+
|
86
|
+
To run your Puma application inside Thruster, prefix your usual command string
|
87
|
+
with `thrust`. For example:
|
88
|
+
|
89
|
+
```sh
|
90
|
+
$ thrust bin/rails server
|
91
|
+
```
|
92
|
+
|
93
|
+
Or with automatic SSL:
|
94
|
+
|
95
|
+
```sh
|
96
|
+
$ SSL_DOMAIN=myapp.example.com thrust bin/rails server
|
97
|
+
```
|
98
|
+
|
99
|
+
|
100
|
+
## Custom configuration
|
101
|
+
|
102
|
+
In most cases, Thruster should work out of the box with no additional
|
103
|
+
configuration. But if you need to customize its behavior, there are a few
|
104
|
+
environment variables that you can set.
|
105
|
+
|
106
|
+
| Variable Name | Description | Default Value |
|
107
|
+
|-----------------------|---------------------------------------------------------------------------------|---------------|
|
108
|
+
| `SSL_DOMAIN` | The domain name to use for SSL provisioning. If not set, SSL will be disabled. | None |
|
109
|
+
| `TARGET_PORT` | The port that your Puma server should run on. Thruster will set `PORT` to this value when starting your server. | 3000 |
|
110
|
+
| `CACHE_SIZE` | The size of the HTTP cache in bytes. | 64MB |
|
111
|
+
| `MAX_CACHE_ITEM_SIZE` | The maximum size of a single item in the HTTP cache in bytes. | 1MB |
|
112
|
+
| `X_SENDFILE_ENABLED` | Whether to enable X-Sendfile support. Set to `0` or `false` to disable. | Enabled |
|
113
|
+
| `MAX_REQUEST_BODY` | The maximum size of a request body in bytes. Requests larger than this size will be refused; `0` means no maximum size is enforced. | `0` |
|
114
|
+
| `STORAGE_PATH` | The path to store Thruster's internal state. Provisioned SSL certificates will be stored here, so that they will not need to be requested every time your application is started. | `./storage/thruster` |
|
115
|
+
| `BAD_GATEWAY_PAGE` | Path to an HTML file to serve when the backend server returns a 502 Bad Gateway error. If there is no file at the specific path, Thruster will serve an empty 502 response instead. Because Thruster boots very quickly, a custom page can be a useful way to show that your application is starting up. | `./public/502.html` |
|
116
|
+
| `HTTP_PORT` | The port to listen on for HTTP traffic. | 80 |
|
117
|
+
| `HTTPS_PORT` | The port to listen on for HTTPS traffic. | 443 |
|
118
|
+
| `HTTP_IDLE_TIMEOUT` | The maximum time in seconds that a client can be idle before the connection is closed. | 60 |
|
119
|
+
| `HTTP_READ_TIMEOUT` | The maximum time in seconds that a client can take to send the request headers. | 30 |
|
120
|
+
| `HTTP_WRITE_TIMEOUT` | The maximum time in seconds during which the client must read the response. | 30 |
|
121
|
+
| `ACME_DIRECTORY` | The URL of the ACME directory to use for SSL certificate provisioning. | `https://acme-v02.api.letsencrypt.org/directory` (Let's Encrypt production) |
|
122
|
+
| `EAB_KID` | The EAB key identifier to use when provisioning SSL certificates, if required. | None |
|
123
|
+
| `EAB_HMAC_KEY` | The Base64-encoded EAB HMAC key to use when provisioning SSL certificates, if required. | None |
|
124
|
+
| `DEBUG` | Set to `1` or `true` to enable debug logging. | Disabled |
|
125
|
+
|
126
|
+
To prevent naming clashes with your application's own environment variables,
|
127
|
+
Thruster's environment variables can optionally be prefixed with `THRUSTER_`.
|
128
|
+
For example, `SSL_DOMAIN` can also be written as `THRUSTER_SSL_DOMAIN`. Whenever
|
129
|
+
a prefixed variable is set, it will take precedence over the unprefixed version.
|
data/exe/thrust
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
#! /usr/bin/env ruby
|
2
|
+
|
3
|
+
PLATFORM = [ :cpu, :os ].map { |m| Gem::Platform.local.send(m) }.join("-")
|
4
|
+
EXECUTABLE = File.expand_path(File.join(__dir__, PLATFORM, "thrust"))
|
5
|
+
|
6
|
+
if File.exist?(EXECUTABLE)
|
7
|
+
exec(EXECUTABLE, *ARGV)
|
8
|
+
else
|
9
|
+
STDERR.puts("ERROR: Unsupported platform: #{PLATFORM}")
|
10
|
+
exit 1
|
11
|
+
end
|
Binary file
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require_relative "../../thruster/version"
|
2
|
+
|
3
|
+
module AnyCable
|
4
|
+
module Thruster
|
5
|
+
VERSION = "0.1.3"
|
6
|
+
|
7
|
+
# Very basic validation to ensure the versions are in sync
|
8
|
+
if ::Thruster::VERSION.split(".").take(2) != VERSION.split(".").take(2)
|
9
|
+
raise "Minor or major version mismatch"
|
10
|
+
end
|
11
|
+
|
12
|
+
if ::Thruster::VERSION.split(".")[2].to_i > VERSION.split(".")[2].to_i
|
13
|
+
raise "Patch version mismatch: must be greater or equal to Thruster's patch version"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/lib/thruster.rb
ADDED
metadata
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: anycable-thruster
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.3
|
5
|
+
platform: x86_64-darwin
|
6
|
+
authors:
|
7
|
+
- Kevin McConnell
|
8
|
+
- Vladimir Dementyev
|
9
|
+
- Igor Platonov
|
10
|
+
autorequire:
|
11
|
+
bindir: exe
|
12
|
+
cert_chain: []
|
13
|
+
date: 2024-04-04 00:00:00.000000000 Z
|
14
|
+
dependencies: []
|
15
|
+
description: A zero-config HTTP/2 proxy for lightweight production deployments with
|
16
|
+
AnyCable real-time server included
|
17
|
+
email: anycable@evilmartians.io
|
18
|
+
executables:
|
19
|
+
- thrust
|
20
|
+
extensions: []
|
21
|
+
extra_rdoc_files: []
|
22
|
+
files:
|
23
|
+
- MIT-LICENSE
|
24
|
+
- README.md
|
25
|
+
- exe/thrust
|
26
|
+
- exe/x86_64-darwin/thrust
|
27
|
+
- lib/anycable/thruster/version.rb
|
28
|
+
- lib/thruster.rb
|
29
|
+
- lib/thruster/version.rb
|
30
|
+
homepage: https://github.com/anycable/thruster
|
31
|
+
licenses:
|
32
|
+
- MIT
|
33
|
+
metadata:
|
34
|
+
homepage_uri: https://github.com/anycable/thruster
|
35
|
+
rubygems_mfa_required: 'true'
|
36
|
+
post_install_message:
|
37
|
+
rdoc_options: []
|
38
|
+
require_paths:
|
39
|
+
- lib
|
40
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '0'
|
45
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '0'
|
50
|
+
requirements: []
|
51
|
+
rubygems_version: 3.4.20
|
52
|
+
signing_key:
|
53
|
+
specification_version: 4
|
54
|
+
summary: Zero-config HTTP/2 proxy with embedded AnyCable
|
55
|
+
test_files: []
|