docs(vps): document default idempotent Caddyfile/systemd sync and --no-caddy flag in Section 5.3 (v2.0.12)
This commit is contained in:
1 parent
1316dc1b8f
commit
a559d74527
2 files changed
+14
-12
No files matched your search
@@ -213,11 +213,13 @@ Sync the updated working tree(s) into the RAM mount and regenerate the `.br` / `
|
||||
```
|
||||
*(Note: If a remote tag was force-updated earlier and `git fetch --tags` rejects it with `would clobber existing tag` before `hyperstitionstudio-core` has pulled commit `b767f8a`, run `git -C /srv/hyperstitionstud.io/repos/hyperstitionstudio-core fetch --force origin main --tags && git -C /srv/hyperstitionstud.io/repos/hyperstitionstudio-core merge --ff-only origin/main` once first).*
|
||||
|
||||
### 5.3 Caddy Reload & Browser Cache Rules
|
||||
### 5.3 Automatic Idempotent `Caddyfile` & `systemd` Sync (Default vs. `--no-caddy`)
|
||||
|
||||
- **No Caddy reload is required** for content updates (`HTML`, `JS`, `JSON`, `PDFs`, `PNGs`)—Caddy serves the updated `.br`/`.gz`/raw files from `/var/www/hyperstitionstud.io/repos/` immediately as soon as `sync-vps-repos.sh` finishes.
|
||||
- **Only reload Caddy** if `/srv/hyperstitionstud.io/repos/hyperstitionstudio-core/deploy/Caddyfile` itself changed:
|
||||
```bash
|
||||
sudo cp /srv/hyperstitionstud.io/repos/hyperstitionstudio-core/deploy/Caddyfile /etc/caddy/Caddyfile && sudo systemctl reload caddy
|
||||
```
|
||||
- **Idempotent by Default (`DO_CADDY=1`):**
|
||||
Every run of `sync-vps-repos.sh` (unless `--no-caddy` or `--no-services` is passed) automatically compares `deploy/Caddyfile` against `/etc/caddy/Caddyfile` and `deploy/*.service` against `/etc/systemd/system/*.service` using `cmp -s`:
|
||||
1. If `/etc/caddy/Caddyfile` is already byte-identical to `deploy/Caddyfile`, it prints `[5/5] /etc/caddy/Caddyfile is already identical to deploy/Caddyfile (no reload needed)` and performs zero unnecessary reloads.
|
||||
2. If `deploy/Caddyfile` changed, it validates the new config first via `sudo caddy validate --config ... --adapter caddyfile`, copies it to `/etc/caddy/Caddyfile`, and executes a zero-downtime `sudo systemctl reload caddy`.
|
||||
3. If `hyperstition-tmpfs-sync.service` or `hyperstition-mcp.service` changed, it updates `/etc/systemd/system/`, runs `sudo systemctl daemon-reload`, and ensures `hyperstition-mcp.service` is active.
|
||||
- **Negating Service/Caddy Sync (`--no-caddy` / `--no-services`):**
|
||||
Pass `--no-caddy` (e.g., `sync-vps-repos.sh --no-pull --no-caddy`) to sync only the RAM-backed webroot files and `.br`/`.gz` sidecars without touching `/etc/caddy/Caddyfile` or `systemd`.
|
||||
- **Browser Cache Note:** `HTML`/`JS`/`JSON` routes carry `Cache-Control: public, max-age=300` (5 minutes); press `Ctrl+Shift+R` (`Cmd+Shift+R` on macOS) in your browser to bypass the 5-minute client cache immediately after syncing.
|
||||
Reference in new issue
Block a user