From 7e13eca8adbd06897edc1517b2699849feef01e2 Mon Sep 17 00:00:00 2001 From: shoemoney Date: Wed, 24 Jun 2026 17:47:51 -0500 Subject: [PATCH] =?UTF-8?q?docs:=20production=20TLS=20+=20safe-upgrade=20g?= =?UTF-8?q?uide;=20extract=20safe-stateful-redeploy=20skill=20=F0=9F=93=9A?= =?UTF-8?q?=F0=9F=9B=A1=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit README: hub deploy section gains a Production collapsible — front the hub with a reverse proxy for TLS (client_max_body_size 0 + proxy_buffering off for SSE), and the never-YOLO upgrade pipeline (dry-run on a copy → smoke → backup → rollback). General pattern, no private hostnames (repo is public). --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index 3ec9708..d1e3184 100644 --- a/README.md +++ b/README.md @@ -311,6 +311,24 @@ docker compose exec hub devbox-hub token --data /data # mint a join token The image is a tiny (~32 MB) static, non-root Alpine build — `Dockerfile` + `docker-compose.yml` at the repo root. +
+🔒 Production: TLS + safe upgrades + +**Put the hub behind TLS.** The hub speaks plain HTTP and the bearer token + your file bytes cross the wire in the clear — front it with a reverse proxy (nginx / Caddy / Nginx Proxy Manager) and terminate TLS there (the API is bearer-authed). Two settings a *sync* hub needs in the proxy: + +```nginx +location / { + proxy_pass http://:8088; + client_max_body_size 0; # large blob uploads — never cap them + proxy_buffering off; # stream the /v1/events SSE to clients + proxy_read_timeout 3600s; # long-lived event stream +} +``` +Devices then `devbox join https://hub.example.com ` — Go's client does TLS natively. + +**Upgrade safely.** The hub DB is the canonical index to every share's history, so don't hot-swap the binary. `deploy/redeploy-hub.sh` runs the never-YOLO pipeline: **migration dry-run on a *copy* of live data** (`scripts/verify-hub-migration.sh`) → **auth smoke** the new binary in a throwaway instance (`scripts/hub-auth-smoke.sh`) → back up binary + DB → swap → verify the new code is live → **auto-rollback** on any failure. (`--gc-every ` self-maintains so blobs don't accumulate.) +
+ --- ## 🚀 Quick Start