shuttlebay 0.2.0 → 0.2.1
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 +4 -4
- data/Cargo.lock +14 -7
- data/docs/guide.md +47 -6
- data/ext/shuttlebay/Cargo.toml +2 -2
- data/lib/shuttlebay/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3e58d1e24092ae4ba3e6a37a5ad342d55497d1ac4dc13eaef5cf2751f3f33f7d
|
|
4
|
+
data.tar.gz: f24f366d0b6e785e8c5a7e65806586de4e246f1116e69e421a6ca84c08d9607e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2d26f2bb11c9f9494133822a9a05485c1111af4a89c360407f74134611c72a1e06ee74ff1bbe1047c2568e7fb7921258ae18bd9bfe627302d87bea237adaa683
|
|
7
|
+
data.tar.gz: ebabfa9fc4c2a6bf9a791e93affb9b110da1d0ca09b8119c30beca81e08b21ae65bc0e7f2c68b921cf0039680bc6f3e2548bd232c99ff19df2cc770239d1d6c9
|
data/Cargo.lock
CHANGED
|
@@ -79,6 +79,12 @@ version = "0.3.4"
|
|
|
79
79
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
80
80
|
checksum = "e4eba85ea1d0a966a983acd07deee566e67395d2d96b6fb39e62b5a833f1eb0b"
|
|
81
81
|
|
|
82
|
+
[[package]]
|
|
83
|
+
name = "harel-machines"
|
|
84
|
+
version = "0.3.0"
|
|
85
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
86
|
+
checksum = "c55c0689200ba712a0c4360a54ec8bac72ba928bc3229e558b1ebb1ea01a49d7"
|
|
87
|
+
|
|
82
88
|
[[package]]
|
|
83
89
|
name = "itertools"
|
|
84
90
|
version = "0.13.0"
|
|
@@ -319,7 +325,7 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
|
|
|
319
325
|
|
|
320
326
|
[[package]]
|
|
321
327
|
name = "shuttlebay"
|
|
322
|
-
version = "0.
|
|
328
|
+
version = "0.2.0"
|
|
323
329
|
dependencies = [
|
|
324
330
|
"magnus",
|
|
325
331
|
"mothership-docking-protocol",
|
|
@@ -330,9 +336,9 @@ dependencies = [
|
|
|
330
336
|
|
|
331
337
|
[[package]]
|
|
332
338
|
name = "state-machines"
|
|
333
|
-
version = "0.
|
|
339
|
+
version = "0.35.0"
|
|
334
340
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
335
|
-
checksum = "
|
|
341
|
+
checksum = "f2fb3f0428a4a79e7929cacf1186fea42291446987807a5136daae4161c13fcf"
|
|
336
342
|
dependencies = [
|
|
337
343
|
"state-machines-core",
|
|
338
344
|
"state-machines-macro",
|
|
@@ -340,16 +346,17 @@ dependencies = [
|
|
|
340
346
|
|
|
341
347
|
[[package]]
|
|
342
348
|
name = "state-machines-core"
|
|
343
|
-
version = "0.
|
|
349
|
+
version = "0.15.0"
|
|
344
350
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
345
|
-
checksum = "
|
|
351
|
+
checksum = "1d027fb20a763004675f678951c6c9537d9dbc2b26056c37d41cefb014e55daf"
|
|
346
352
|
|
|
347
353
|
[[package]]
|
|
348
354
|
name = "state-machines-macro"
|
|
349
|
-
version = "0.
|
|
355
|
+
version = "0.35.0"
|
|
350
356
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
351
|
-
checksum = "
|
|
357
|
+
checksum = "c16c56f4525fd7923580b96d7066341d3b10e772aa2e679e0c65b04881ba9439"
|
|
352
358
|
dependencies = [
|
|
359
|
+
"harel-machines",
|
|
353
360
|
"proc-macro2",
|
|
354
361
|
"quote",
|
|
355
362
|
"syn 3.0.9",
|
data/docs/guide.md
CHANGED
|
@@ -196,18 +196,59 @@ covers the rest.
|
|
|
196
196
|
## 8. TLS and HTTP/2
|
|
197
197
|
|
|
198
198
|
Behind a CDN or Kamal proxy, they terminate TLS and speak HTTP/2 to browsers;
|
|
199
|
-
Mothership listens on plain HTTP behind them
|
|
200
|
-
|
|
199
|
+
Mothership listens on plain HTTP behind them, and nothing here is needed.
|
|
200
|
+
|
|
201
|
+
To terminate TLS in Mothership itself (guardship 0.2.1 and later), get a
|
|
202
|
+
certificate first, then add a TLS bind.
|
|
203
|
+
|
|
204
|
+
**The certificate.** Mothership serves `public/`, so certbot's webroot mode
|
|
205
|
+
works while the app runs on plain HTTP:
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
mkdir -p public/.well-known/acme-challenge # create it before certbot runs
|
|
209
|
+
certbot certonly --webroot -w ./public -d example.com -d www.example.com
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Create `.well-known` beforehand: Mothership skips the filesystem for
|
|
213
|
+
top-level names it has not seen in `public/` (it re-lists the directory
|
|
214
|
+
about once a second), so one certbot creates on the spot can miss the
|
|
215
|
+
validation request. One certificate can name every domain (`-d` repeated).
|
|
216
|
+
|
|
217
|
+
**The binds.**
|
|
201
218
|
|
|
202
219
|
```toml
|
|
203
220
|
[mothership.bind]
|
|
204
221
|
http = "0.0.0.0:80"
|
|
205
|
-
https = { addr = "0.0.0.0:443", tls = { cert = "/etc/letsencrypt/live/
|
|
222
|
+
https = { addr = "0.0.0.0:443", tls = { cert = "/etc/letsencrypt/live/example.com/fullchain.pem", key = "/etc/letsencrypt/live/example.com/privkey.pem" } }
|
|
223
|
+
|
|
224
|
+
[[bays.http]]
|
|
225
|
+
name = "web"
|
|
226
|
+
# command, args, workers, threads as before
|
|
227
|
+
routes = [
|
|
228
|
+
{ bind = "http", pattern = "/.*" },
|
|
229
|
+
{ bind = "https", pattern = "/.*" },
|
|
230
|
+
]
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
```ruby
|
|
234
|
+
# config/environments/production.rb
|
|
235
|
+
config.force_ssl = true # redirects HTTP to HTTPS, sends HSTS, secures cookies
|
|
206
236
|
```
|
|
207
237
|
|
|
208
|
-
Browsers
|
|
209
|
-
`rack.url_scheme = "https"
|
|
210
|
-
|
|
238
|
+
- Browsers get HTTP/2 (negotiated over ALPN). On the TLS bind the app sees
|
|
239
|
+
`rack.url_scheme = "https"` and `HTTPS=on`, so `force_ssl` and
|
|
240
|
+
`request.ssl?` work with no `assume_ssl` or forwarded headers.
|
|
241
|
+
- Renewals are picked up without a restart, within 30 s of certbot writing
|
|
242
|
+
them. A renewal that does not load is logged; the old one keeps serving.
|
|
243
|
+
- Let's Encrypt keys are readable by root only: run with access to them, or
|
|
244
|
+
have a certbot `--deploy-hook` copy the pair where the app's user can read
|
|
245
|
+
it. Ports 80 and 443 need `setcap cap_net_bind_service=+ep` on the binary,
|
|
246
|
+
`AmbientCapabilities=CAP_NET_BIND_SERVICE` under systemd, or a container.
|
|
247
|
+
|
|
248
|
+
From guardship 0.3, Mothership can also redirect HTTP to HTTPS itself
|
|
249
|
+
(`http = { addr = "0.0.0.0:80", https_redirect = true }`, ACME challenges
|
|
250
|
+
left on HTTP) and serve a certificate per domain on one bind
|
|
251
|
+
(`tls = [{ cert, key }, ...]`, picked by SNI); see the Mothership README.
|
|
211
252
|
|
|
212
253
|
## 9. Docker and Kamal
|
|
213
254
|
|
data/ext/shuttlebay/Cargo.toml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "shuttlebay"
|
|
3
|
-
version = "0.2.
|
|
3
|
+
version = "0.2.1" # x-release-please-version
|
|
4
4
|
edition.workspace = true
|
|
5
5
|
rust-version.workspace = true
|
|
6
6
|
license.workspace = true
|
|
@@ -28,4 +28,4 @@ magnus = { version = "0.9", features = ["bytes"] }
|
|
|
28
28
|
rb-sys = "0.9.130"
|
|
29
29
|
mothership-docking-protocol = "0.3.0"
|
|
30
30
|
serde_json = "1.0"
|
|
31
|
-
state-machines = "0.
|
|
31
|
+
state-machines = "0.35"
|
data/lib/shuttlebay/version.rb
CHANGED