docs(plans,archive,vps): archive completed SQLite metadata DB plan, add active/deferred plans, and update VPS deployment guide to v2.0.19
This commit is contained in:
1 parent
ed75c20322
commit
c3461ab629
16 files changed
+583
-17
No files matched your search
@@ -4,12 +4,13 @@
|
||||
- **Target Domain:** `https://hyperstitionstud.io` (and `https://www.hyperstitionstud.io` -> `308` redirect)
|
||||
- **Upstream Git Forge:** `git.libre.audio` (`https://git.libre.audio/seasharp/<repo-slug>.git`)
|
||||
- **Bundled Deployment Automation (`hyperstitionstudio-core/deploy/`):**
|
||||
- `deploy/sync-vps-repos.sh` — Pulls from `git.libre.audio`, automatically supplies untracked `haiperdohp-jemaytreeah/.gitignore` runtime files (`config.js`, `db.json`, `db_lite.json`) if absent, runs `hs-doctor` and 6-gate Knowledge Graph verification, syncs per-repo install directories into RAM (`/var/www/hyperstitionstud.io/repos`), creates relative route symlinks (`/`, `/learn`, `/graph`, `/encyclopedia`, `/zoology`, `/archive`, `/calc`, `/ci`, `/schemas`), pre-compresses `.br` (Brotli-11) and `.gz` (Gzip-9) sidecars, and idempotently syncs `Caddyfile` + `systemd` units.
|
||||
- `deploy/Caddyfile` — Production Caddy 2 configuration (`HTTP/3 QUIC` + `precompressed br gzip` + direct per-repo `handle_path` routing + `/mcp` reverse proxy to `127.0.0.1:8095`).
|
||||
- `deploy/sync-vps-repos.sh` — Pulls from `git.libre.audio`, automatically supplies untracked `haiperdohp-jemaytreeah/.gitignore` runtime files (`config.js`, `db.json`, `db_lite.json`) if absent, runs `hs-doctor` and 6-gate Knowledge Graph verification, syncs per-repo install directories into RAM (`/var/www/hyperstitionstud.io/repos`), creates relative route symlinks (`/`, `/learn`, `/quant`, `/graph`, `/encyclopedia`, `/zoology`, `/archive`, `/calc`, `/ci`, `/schemas`), pre-compresses `.br` (Brotli-11) and `.gz` (Gzip-9) sidecars, and idempotently syncs `Caddyfile`, `systemd` units, and `/etc/logrotate.d/hyperstition-sqlite-meta`.
|
||||
- `deploy/Caddyfile` — Production Caddy 2 configuration (`HTTP/3 QUIC` + `precompressed br gzip` + direct per-repo `handle_path` routing + `/mcp` and `/api/v1/*` reverse proxy to `127.0.0.1:8095`).
|
||||
- `deploy/hyperstition-tmpfs-sync.service` — `systemd` unit that hydrates `/var/www/hyperstitionstud.io/repos` on VPS boot before Caddy starts.
|
||||
- `deploy/hyperstition-mcp.service` — `systemd` unit running `hs-mcp --transport http --host 127.0.0.1 --port 8095` in strict read-only mode.
|
||||
- `deploy/test-first-deployment.sh` — Automated 32-route + `/mcp` HTTP verification harness (verifies all portal, `/learn/`, graph, encyclopedia, `haiperdohp-jemaytreeah` `.gitignore` files `config.js`/`db_lite.json`/`db.json`, CI, schema, and `/mcp` JSON-RPC routes).
|
||||
- **Bundled CLI Entrypoints (`hyperstitionstudio-core/pyproject.toml`):** `hs-doctor`, `hs-citations`, `hs-pdf-build`, `hs-kg-build`, `hs-quant-harvest` (`--mode us-closing-bell` default), `hs-mcp`, and `hs-sync-version`.
|
||||
- `deploy/hyperstition-mcp.service` — `systemd` unit running `hs-mcp --transport http --host 127.0.0.1 --port 8095` in strict read-only mode while populating `/tmp/hyperstition-api-telemetry.db` (`HYPERSTITION_SQLITE_MAX_MB=100`).
|
||||
- `deploy/logrotate.d/hyperstition-sqlite-meta` — Quiescent `logrotate.d` rule (`size 100M` default, `rotate 12`, `compress`, `delaycompress`, configurable via `HYPERSTITION_SQLITE_MAX_MB` / `HYPERSTITION_SQLITE_MAX_BYTES`) that compresses a consistent point-in-time SQLite snapshot (`<db>.1.gz` .. `<db>.12.gz`) and truncates the active SQLite REST/MCP API metadata database via `hs-db-build --truncate-quiescent --compress-archive` (`BEGIN EXCLUSIVE` + `PRAGMA wal_checkpoint(TRUNCATE)` + `VACUUM` + `PRAGMA integrity_check`).
|
||||
- `deploy/test-first-deployment.sh` — Automated static route + `/mcp` + `/api/v1/*` + SQLite `logrotate.d` quiescent truncation verification harness.
|
||||
- **Bundled CLI Entrypoints (`hyperstitionstudio-core/pyproject.toml`):** `hs-doctor`, `hs-citations`, `hs-pdf-build`, `hs-kg-build`, `hs-quant-harvest` (`--mode us-closing-bell` default), `hs-mcp`, `hs-sync-version`, and `hs-db-build`.
|
||||
|
||||
---
|
||||
|
||||
@@ -103,7 +104,7 @@ curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --d
|
||||
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list >/dev/null
|
||||
sudo chmod a+r /usr/share/keyrings/caddy-stable-archive-keyring.gpg /etc/apt/sources.list.d/caddy-stable.list
|
||||
|
||||
sudo apt update && sudo apt install -y git python3 python3-venv python3-pip brotli rsync curl caddy fonts-dejavu-core
|
||||
sudo apt update && sudo apt install -y git python3 python3-venv python3-pip brotli rsync curl logrotate caddy fonts-dejavu-core
|
||||
|
||||
sudo tee /etc/sysctl.d/99-hyperstition-fastnet.conf >/dev/null <<'EOF'
|
||||
net.core.default_qdisc = fq
|
||||
@@ -164,11 +165,14 @@ python3 -m venv .venv
|
||||
# 1. Hydrate /var/www/hyperstitionstud.io/repos and pre-compress (.br / .gz)
|
||||
/srv/hyperstitionstud.io/repos/hyperstitionstudio-core/deploy/sync-vps-repos.sh --no-pull
|
||||
|
||||
# 2. Install systemd boot-time tmpfs hydration unit & read-only MCP HTTP server unit (127.0.0.1:8095)
|
||||
# 2. Install systemd boot-time tmpfs hydration unit, read-only MCP HTTP server unit (127.0.0.1:8095), and quiescent SQLite logrotate rule
|
||||
sudo cp /srv/hyperstitionstud.io/repos/hyperstitionstudio-core/deploy/hyperstition-tmpfs-sync.service \
|
||||
/etc/systemd/system/hyperstition-tmpfs-sync.service
|
||||
sudo cp /srv/hyperstitionstud.io/repos/hyperstitionstudio-core/deploy/hyperstition-mcp.service \
|
||||
/etc/systemd/system/hyperstition-mcp.service
|
||||
sudo cp /srv/hyperstitionstud.io/repos/hyperstitionstudio-core/deploy/logrotate.d/hyperstition-sqlite-meta \
|
||||
/etc/logrotate.d/hyperstition-sqlite-meta
|
||||
sudo chmod 0644 /etc/logrotate.d/hyperstition-sqlite-meta
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable hyperstition-tmpfs-sync.service
|
||||
sudo systemctl enable --now hyperstition-mcp.service
|
||||
@@ -215,13 +219,14 @@ 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 Automatic Idempotent `Caddyfile` & `systemd` Sync (Default vs. `--no-caddy`)
|
||||
### 5.3 Automatic Idempotent `Caddyfile`, `systemd` & `logrotate.d` Sync (Default vs. `--no-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`:
|
||||
Every run of `sync-vps-repos.sh` (unless `--no-caddy` or `--no-services` is passed) automatically compares `deploy/Caddyfile` against `/etc/caddy/Caddyfile`, `deploy/*.service` against `/etc/systemd/system/*.service`, and `deploy/logrotate.d/hyperstition-sqlite-meta` against `/etc/logrotate.d/hyperstition-sqlite-meta` 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.
|
||||
4. If `/etc/logrotate.d/hyperstition-sqlite-meta` is missing or differs from `deploy/logrotate.d/hyperstition-sqlite-meta`, it installs the rule with `0644` permissions so the SQLite REST/MCP metadata database (`/tmp/hyperstition-api-telemetry.db`) is quiescently truncated at the configurable `100 MB` limit (`size 100M`, `HYPERSTITION_SQLITE_MAX_MB=100`).
|
||||
- **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