neo-thruster 0.1.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.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +107 -0
- data/exe/thrust +11 -0
- data/lib/thruster/version.rb +3 -0
- data/lib/thruster.rb +4 -0
- metadata +52 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: f83f4dee4deb806517d5c881fe95934173d25c8f59ce37d7ba3c501b78090240
|
|
4
|
+
data.tar.gz: eeba2100d4f70b955f7ebef1d37a4728de24ba2f6710c625b201666f80b39502
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 9f0d330f68fc385d3d5fc2e8d453601178f271fbc4bc6b3cccef8dfa879418615dadfd11b367f928389646ee56d791c7b27ce1d94ec4c51ecc1bda1f92a73a53
|
|
7
|
+
data.tar.gz: 2da38fcd29725b533bdfeb0492f4d395916818b39f7c960379e880a1cb569c90864d4259bf4a12694d497603f051c4e5f2b18f691301b7984f7fd735a1b6b0bf
|
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,107 @@
|
|
|
1
|
+
# About this fork
|
|
2
|
+
|
|
3
|
+
This is a fork of the original [thruster](https://github.com/basecamp/thruster)
|
|
4
|
+
proxy by the folks at Basecamp. The primary motivation to do this was to add
|
|
5
|
+
support for ZSTD compression, at the moment only GZip is supported.
|
|
6
|
+
|
|
7
|
+
The original README is below.
|
|
8
|
+
|
|
9
|
+
# Thruster
|
|
10
|
+
|
|
11
|
+
Thruster is an HTTP/2 proxy for simple production-ready deployments of Rails
|
|
12
|
+
applications. It runs alongside the Puma webserver to provide a few additional
|
|
13
|
+
features that help your app run efficiently and safely on the open Internet:
|
|
14
|
+
|
|
15
|
+
- HTTP/2 support
|
|
16
|
+
- Automatic TLS certificate management with Let's Encrypt
|
|
17
|
+
- Basic HTTP caching of public assets
|
|
18
|
+
- X-Sendfile support and compression, to efficiently serve static files
|
|
19
|
+
|
|
20
|
+
Thruster aims to be as zero-config as possible. It has no configuration file,
|
|
21
|
+
and most features are automatically enabled with sensible defaults. The goal is
|
|
22
|
+
that simply running your Puma server with Thruster should be enough to get a
|
|
23
|
+
production-ready setup.
|
|
24
|
+
|
|
25
|
+
The only exception to this is TLS provisioning: in order for Thruster to
|
|
26
|
+
provision TLS certificates, it needs to know which domain those certificates
|
|
27
|
+
should be for. So to use TLS, you need to set the `TLS_DOMAIN` environment
|
|
28
|
+
variable. If you don't set this variable, Thruster will run in HTTP-only mode.
|
|
29
|
+
|
|
30
|
+
Thruster also wraps the Puma process so that you can use it without managing
|
|
31
|
+
multiple processes yourself. This is particularly useful when running in a
|
|
32
|
+
containerized environment, where you typically won't have a process manager
|
|
33
|
+
available to coordinate the processes. Instead you can use Thruster as your
|
|
34
|
+
`CMD`, and it will manage Puma for you.
|
|
35
|
+
|
|
36
|
+
Thruster was originally created for the [ONCE](https://once.com) project, where
|
|
37
|
+
we wanted a no-fuss way to serve a Rails application from a single container,
|
|
38
|
+
directly on the open Internet. We've since found it useful for simple
|
|
39
|
+
deployments of other Rails applications.
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
## Installation
|
|
43
|
+
|
|
44
|
+
Thruster is distributed as a Ruby gem. Because Thruster is written in Go, we
|
|
45
|
+
provide several pre-built platform-specific binaries. Installing the gem will
|
|
46
|
+
automatically fetch the appropriate binary for your platform.
|
|
47
|
+
|
|
48
|
+
To install it, add it to your application's Gemfile:
|
|
49
|
+
|
|
50
|
+
```ruby
|
|
51
|
+
gem 'thruster'
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Or install it globally:
|
|
55
|
+
|
|
56
|
+
```sh
|
|
57
|
+
$ gem install thruster
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
## Usage
|
|
62
|
+
|
|
63
|
+
To run your Puma application inside Thruster, prefix your usual command string
|
|
64
|
+
with `thrust`. For example:
|
|
65
|
+
|
|
66
|
+
```sh
|
|
67
|
+
$ thrust bin/rails server
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Or with automatic TLS:
|
|
71
|
+
|
|
72
|
+
```sh
|
|
73
|
+
$ TLS_DOMAIN=myapp.example.com thrust bin/rails server
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
## Custom configuration
|
|
78
|
+
|
|
79
|
+
In most cases, Thruster should work out of the box with no additional
|
|
80
|
+
configuration. But if you need to customize its behavior, there are a few
|
|
81
|
+
environment variables that you can set.
|
|
82
|
+
|
|
83
|
+
| Variable Name | Description | Default Value |
|
|
84
|
+
|-----------------------|---------------------------------------------------------|---------------|
|
|
85
|
+
| `TLS_DOMAIN` | Comma-separated list of domain names to use for TLS provisioning. If not set, TLS will be disabled. | None |
|
|
86
|
+
| `TARGET_PORT` | The port that your Puma server should run on. Thruster will set `PORT` to this value when starting your server. | 3000 |
|
|
87
|
+
| `CACHE_SIZE` | The size of the HTTP cache in bytes. | 64MB |
|
|
88
|
+
| `MAX_CACHE_ITEM_SIZE` | The maximum size of a single item in the HTTP cache in bytes. | 1MB |
|
|
89
|
+
| `X_SENDFILE_ENABLED` | Whether to enable X-Sendfile support. Set to `0` or `false` to disable. | Enabled |
|
|
90
|
+
| `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` |
|
|
91
|
+
| `STORAGE_PATH` | The path to store Thruster's internal state. Provisioned TLS certificates will be stored here, so that they will not need to be requested every time your application is started. | `./storage/thruster` |
|
|
92
|
+
| `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` |
|
|
93
|
+
| `HTTP_PORT` | The port to listen on for HTTP traffic. | 80 |
|
|
94
|
+
| `HTTPS_PORT` | The port to listen on for HTTPS traffic. | 443 |
|
|
95
|
+
| `HTTP_IDLE_TIMEOUT` | The maximum time in seconds that a client can be idle before the connection is closed. | 60 |
|
|
96
|
+
| `HTTP_READ_TIMEOUT` | The maximum time in seconds that a client can take to send the request headers and body. | 30 |
|
|
97
|
+
| `HTTP_WRITE_TIMEOUT` | The maximum time in seconds during which the client must read the response. | 30 |
|
|
98
|
+
| `ACME_DIRECTORY` | The URL of the ACME directory to use for TLS certificate provisioning. | `https://acme-v02.api.letsencrypt.org/directory` (Let's Encrypt production) |
|
|
99
|
+
| `EAB_KID` | The EAB key identifier to use when provisioning TLS certificates, if required. | None |
|
|
100
|
+
| `EAB_HMAC_KEY` | The Base64-encoded EAB HMAC key to use when provisioning TLS certificates, if required. | None |
|
|
101
|
+
| `FORWARD_HEADERS` | Whether to forward X-Forwarded-* headers from the client. | Disabled when running with TLS; enabled otherwise |
|
|
102
|
+
| `DEBUG` | Set to `1` or `true` to enable debug logging. | Disabled |
|
|
103
|
+
|
|
104
|
+
To prevent naming clashes with your application's own environment variables,
|
|
105
|
+
Thruster's environment variables can optionally be prefixed with `THRUSTER_`.
|
|
106
|
+
For example, `TLS_DOMAIN` can also be written as `THRUSTER_TLS_DOMAIN`. Whenever
|
|
107
|
+
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
|
data/lib/thruster.rb
ADDED
metadata
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: neo-thruster
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Kevin McConnell
|
|
8
|
+
- Shivam Mishra
|
|
9
|
+
autorequire:
|
|
10
|
+
bindir: exe
|
|
11
|
+
cert_chain: []
|
|
12
|
+
date: 2025-01-23 00:00:00.000000000 Z
|
|
13
|
+
dependencies: []
|
|
14
|
+
description: A fork of thruster - A zero-config HTTP/2 proxy for lightweight production
|
|
15
|
+
deployments with zstd support
|
|
16
|
+
email: hey@shivam.dev
|
|
17
|
+
executables:
|
|
18
|
+
- thrust
|
|
19
|
+
extensions: []
|
|
20
|
+
extra_rdoc_files: []
|
|
21
|
+
files:
|
|
22
|
+
- MIT-LICENSE
|
|
23
|
+
- README.md
|
|
24
|
+
- exe/thrust
|
|
25
|
+
- lib/thruster.rb
|
|
26
|
+
- lib/thruster/version.rb
|
|
27
|
+
homepage: https://github.com/scmmishra/neo-thruster
|
|
28
|
+
licenses:
|
|
29
|
+
- MIT
|
|
30
|
+
metadata:
|
|
31
|
+
homepage_uri: https://github.com/scmmishra/neo-thruster
|
|
32
|
+
rubygems_mfa_required: 'true'
|
|
33
|
+
post_install_message:
|
|
34
|
+
rdoc_options: []
|
|
35
|
+
require_paths:
|
|
36
|
+
- lib
|
|
37
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
38
|
+
requirements:
|
|
39
|
+
- - ">="
|
|
40
|
+
- !ruby/object:Gem::Version
|
|
41
|
+
version: '0'
|
|
42
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
43
|
+
requirements:
|
|
44
|
+
- - ">="
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: '0'
|
|
47
|
+
requirements: []
|
|
48
|
+
rubygems_version: 3.5.11
|
|
49
|
+
signing_key:
|
|
50
|
+
specification_version: 4
|
|
51
|
+
summary: Zero-config HTTP/2 proxy
|
|
52
|
+
test_files: []
|