anycable-thruster 0.1.15 → 0.1.17

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 18fbd7e8d08ce3c579071a23d3dd35bab707be4d66ed798c633c496d257df44b
4
- data.tar.gz: 07b4ab0660e59744b8810da255f7b5fbc0c0ee5d985c6e79fd2865c9c2a66e53
3
+ metadata.gz: d4e7b83f7777b0383ca0e5f70ed2114514867f3ff1f265426b6a576719630444
4
+ data.tar.gz: 9e43e3088c84e18ef1cc4f1decf6ec61b5a20200e4d47ae09e5564d015100a46
5
5
  SHA512:
6
- metadata.gz: 76d023b24b747afbf09ab2e2789ba3d348011aa099923ebea986513665767f5735704bee1d184032493aa7d59978e738e59d37e4fc670a3c3ca94c0a7fdbab96
7
- data.tar.gz: 4670effecaf946d11a8b9e755e49f658febbb28a5505b05bfb1ed441904a933f4dc45fed89ff5d42081e2546206c3ef1342391801ed76949ff13a176b4700c30
6
+ metadata.gz: a398e270e90f3597afcc6bd3507fda1cf396a5f0a32405fed7df775b29d07a3ee4820f47bb63a13084a70b94e900e242be6a5970bf9b7b4cc698387a173124fa
7
+ data.tar.gz: 1fab977314bbf561fd4592118c8f5fc65424d0d678d314ad390fbee69f1ae9e76711b0288583ef9749730094fa9dd56bba5e118a135c2d635dd73d84b30abca9
data/README.md CHANGED
@@ -26,6 +26,40 @@ ANYCABLE_DEBUG=true thrust bin/rails s
26
26
  ANYCABLE_OPT="-debug" thrust bin/rails s
27
27
  ```
28
28
 
29
+ ## Using a custom AnyCable binary
30
+
31
+ AnyCable Thruster can launch an external AnyCable-compatible binary (e.g., **AnyCable Pro**) instead of the one bundled with the gem.
32
+ Set `ANYCABLE_THRUSTER_BIN_PATH` to either a **full path** or a **command name** (looked up in `$PATH`).
33
+ If the variable is not set, Thruster falls back to the bundled per-platform binary.
34
+
35
+ ### Local usage
36
+
37
+ If you have `anycable-thruster` available in your `$PATH`:
38
+
39
+ ```sh
40
+ # Thruster will exec the given binary and pass through all CLI args
41
+ ANYCABLE_THRUSTER_BIN_PATH=anycable-thruster thrust bin/rails server
42
+
43
+ #You may also use an absolute path if you prefer:
44
+ ANYCABLE_THRUSTER_BIN_PATH=/usr/local/bin/anycable-thruster thrust bin/rails server
45
+ ```
46
+
47
+ ### Heroku (with the AnyCable Go buildpack)
48
+
49
+ **Configure the AnyCable Go buildpack to fetch the Thruster binary:**
50
+ - `HEROKU_ANYCABLE_GO_BINARY_NAME=anycable-thruster`
51
+
52
+ In Procfile:
53
+
54
+ ```
55
+ # resolves via PATH
56
+ web: ANYCABLE_THRUSTER_BIN_PATH=anycable-thruster thrust bin/rails server
57
+
58
+ # resolve absolute path at runtime
59
+ # web: ANYCABLE_THRUSTER_BIN_PATH=$(which anycable-thruster) thrust bin/rails server
60
+ ```
61
+
62
+ For full buildpack options see the buildpack [README](https://github.com/anycable/heroku-anycable-go).
29
63
  ----
30
64
 
31
65
  > [!NOTE]
@@ -104,25 +138,27 @@ configuration. But if you need to customize its behavior, there are a few
104
138
  environment variables that you can set.
105
139
 
106
140
  | Variable Name | Description | Default Value |
107
- |-----------------------|---------------------------------------------------------|---------------|
108
- | `TLS_DOMAIN` | Comma-separated list of domain names to use for TLS provisioning. If not set, TLS 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 TLS 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 and body. | 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 TLS certificate provisioning. | `https://acme-v02.api.letsencrypt.org/directory` (Let's Encrypt production) |
122
- | `EAB_KID` | The EAB key identifier to use when provisioning TLS certificates, if required. | None |
123
- | `EAB_HMAC_KEY` | The Base64-encoded EAB HMAC key to use when provisioning TLS certificates, if required. | None |
124
- | `FORWARD_HEADERS` | Whether to forward X-Forwarded-* headers from the client. | Disabled when running with TLS; enabled otherwise |
125
- | `DEBUG` | Set to `1` or `true` to enable debug logging. | Disabled |
141
+ |-----------------------------|---------------------------------------------------------|---------------|
142
+ | `TLS_DOMAIN` | Comma-separated list of domain names to use for TLS provisioning. If not set, TLS will be disabled. | None |
143
+ | `TARGET_PORT` | The port that your Puma server should run on. Thruster will set `PORT` to this value when starting your server. | 3000 |
144
+ | `CACHE_SIZE` | The size of the HTTP cache in bytes. | 64MB |
145
+ | `MAX_CACHE_ITEM_SIZE` | The maximum size of a single item in the HTTP cache in bytes. | 1MB |
146
+ | `GZIP_COMPRESSION_ENABLED` | Whether to enable gzip compression for static assets. Set to `0` or `false` to disable. | Enabled |
147
+ | `X_SENDFILE_ENABLED` | Whether to enable X-Sendfile support. Set to `0` or `false` to disable. | Enabled |
148
+ | `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` |
149
+ | `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` |
150
+ | `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` |
151
+ | `HTTP_PORT` | The port to listen on for HTTP traffic. | 80 |
152
+ | `HTTPS_PORT` | The port to listen on for HTTPS traffic. | 443 |
153
+ | `HTTP_IDLE_TIMEOUT` | The maximum time in seconds that a client can be idle before the connection is closed. | 60 |
154
+ | `HTTP_READ_TIMEOUT` | The maximum time in seconds that a client can take to send the request headers and body. | 30 |
155
+ | `HTTP_WRITE_TIMEOUT` | The maximum time in seconds during which the client must read the response. | 30 |
156
+ | `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) |
157
+ | `EAB_KID` | The EAB key identifier to use when provisioning TLS certificates, if required. | None |
158
+ | `EAB_HMAC_KEY` | The Base64-encoded EAB HMAC key to use when provisioning TLS certificates, if required. | None |
159
+ | `FORWARD_HEADERS` | Whether to forward X-Forwarded-* headers from the client. | Disabled when running with TLS; enabled otherwise |
160
+ | `LOG_REQUESTS` | Log all requests. Set to `0` or `false` to disable request logging | Enabled |
161
+ | `DEBUG` | Set to `1` or `true` to enable debug logging. | Disabled |
126
162
 
127
163
  To prevent naming clashes with your application's own environment variables,
128
164
  Thruster's environment variables can optionally be prefixed with `THRUSTER_`.
data/exe/thrust CHANGED
@@ -1,11 +1,26 @@
1
1
  #! /usr/bin/env ruby
2
2
 
3
- PLATFORM = [ :cpu, :os ].map { |m| Gem::Platform.local.send(m) }.join("-")
3
+ ENV_KEY = "ANYCABLE_THRUSTER_BIN_PATH"
4
+ CUSTOM_ANYCABLE_PATH = ENV[ENV_KEY].to_s
5
+
6
+ if CUSTOM_ANYCABLE_PATH != ""
7
+ begin
8
+ exec(CUSTOM_ANYCABLE_PATH, *ARGV)
9
+ rescue Errno::ENOENT
10
+ warn("ERROR: #{ENV_KEY}=#{CUSTOM_ANYCABLE_PATH.inspect} not found in PATH or as a file.")
11
+ exit 1
12
+ rescue SystemCallError => e
13
+ warn("ERROR: #{ENV_KEY}=#{CUSTOM_ANYCABLE_PATH.inspect} failed: #{e.class}: #{e.message}")
14
+ exit 1
15
+ end
16
+ end
17
+
18
+ PLATFORM = %i[cpu os].map { |m| Gem::Platform.local.send(m) }.join("-")
4
19
  EXECUTABLE = File.expand_path(File.join(__dir__, PLATFORM, "thrust"))
5
20
 
6
21
  if File.exist?(EXECUTABLE)
7
22
  exec(EXECUTABLE, *ARGV)
8
23
  else
9
- STDERR.puts("ERROR: Unsupported platform: #{PLATFORM}")
24
+ warn("ERROR: Unsupported platform: #{PLATFORM}")
10
25
  exit 1
11
26
  end
@@ -2,7 +2,7 @@ require_relative "../../thruster/version"
2
2
 
3
3
  module AnyCable
4
4
  module Thruster
5
- VERSION = "0.1.15"
5
+ VERSION = "0.1.17"
6
6
 
7
7
  # Very basic validation to ensure the versions are in sync
8
8
  if ::Thruster::VERSION.split(".").take(2) != VERSION.split(".").take(2)
@@ -1,3 +1,3 @@
1
1
  module Thruster
2
- VERSION = "0.1.10"
2
+ VERSION = "0.1.15"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anycable-thruster
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.15
4
+ version: 0.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin McConnell
@@ -9,7 +9,7 @@ authors:
9
9
  - Igor Platonov
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2025-04-21 00:00:00.000000000 Z
12
+ date: 1980-01-02 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: A zero-config HTTP/2 proxy for lightweight production deployments with
15
15
  AnyCable real-time server included
@@ -45,7 +45,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
45
45
  - !ruby/object:Gem::Version
46
46
  version: '0'
47
47
  requirements: []
48
- rubygems_version: 3.6.5
48
+ rubygems_version: 3.6.9
49
49
  specification_version: 4
50
50
  summary: Zero-config HTTP/2 proxy with embedded AnyCable
51
51
  test_files: []