ReviewOS

also looking at this

stacks/ts-cloud

fix(fleet): carry a site's TLS material when it moves

#179
Merged chrisbbreuer wants to merge feat/site-move-tls into main
4 files +328 -2
docs/cli.mdmodified+20-0
Changes to docs/cli.md
@@ -233,6 +233,26 @@ Like the tree snapshot, the dump is re-taken on a resume rather than skipped: on
233233from an earlier attempt predates whatever the source has committed since, and
234234shipping stale rows is worse than dumping twice.
235235
236#### TLS
237
238Certificates live in the gateway's cert directory (`/etc/rpx/certs` by default),
239which belongs to the box rather than to the site the same shape as an on-box
240database, and the same failure if left behind. The move carries the certificate
241and private key for the site's domain and every alias, **before** it routes the
242site and well before DNS: a hostname that resolves to a box holding no
243certificate for it is refused by every browser, which is a worse outcome than the
244site simply still being on the old box. Private keys are restored `0600`.
245
246Whether the target already has them is decided by checksum, not by whether a file
247exists an older certificate for the same hostname, expired or issued while the
248domain pointed somewhere else, is not the one being moved. A hostname the source
249has no certificate for is skipped rather than blocking: a site behind on-demand
250TLS may legitimately have none yet, and the target re-issues on first request.
251
252Renewal is not carried. The per-project renewal timer is written by the normal
253provisioning path, so the next `cloud deploy` against the target establishes it;
254until then the carried certificates stand on their own remaining validity.
255
236256The archive travels through the machine running the command rather than directly
237257between the boxes: a direct hop would need the target to hold a credential for
238258the source, which is the same credential-radius problem consolidation already