Repository navigation
Commit 6cf5154
dev2-edge: pit.world and the Moshpit names on Caddy, every other site on nginx (#199)
* dev2-edge: pit.world and the Moshpit names on Caddy, every other site on nginx
nginx's stream module takes :443 and routes by TLS server name (ssl_preread):
pit.world, *.pit.world and the Moshpit names in dev2/edge/edge.json go to Caddy on
127.0.0.1:8453, everything else to nginx's https servers on 127.0.0.1:8444, both
with a PROXY protocol header so client addresses survive.
- dev2/dev2-edge: render / apply / route on|off / rollback / sweep / status
- dev2/edge/edge-box: the box side; apply backs up /etc/nginx, sweeps every name
twice, checks Caddy answers like nginx on its own port before any traffic moves,
switches with one nginx reload, sweeps again and rolls back on any change
- caddy-edge-certs (+ .path/.timer): Caddy loads bundles of the certificates
certbot, pit-proxy-cert and moshpit-renew already renew; Caddy issues nothing
- nginx-edge-listen (+ nginx.service drop-in, .path): rewrites any `listen 443`
a tool writes later (install.sh, setup-origin.sh, certbot --nginx), which would
otherwise pass nginx -t and then silently fail to bind on reload
- dev2-site vhost renders the 8444 form when the edge is on
- test/dev2-edge.test.ts
Rehearsed on dev3 against a copy of dev2's nginx config: 287 names same status
before/after, SNI routing, client IP in nginx and Caddy upstreams, websockets,
http->https, no dropped requests across the switch and the rollback, renewal
pickup, stray listen 443 repair, rollback restores /etc/nginx byte for byte.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* edge-box: backup tarball stays root 0600 (it holds the private keys)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* edge-box: only restore a backup apply made, only run a shipped bundle; route waits for the reload
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* edge-box: backups live in one fixed place
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* edge-box: the last-backup pointer is a fixed path
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* edge-box: a re-apply reloads a running Caddy instead of restarting it
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>1 parent 166e1bc commit 6cf5154
16 files changed
Lines changed: 1515 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
0 commit comments