Route shell FAB and loki:open to /loki with composer prefill; retire the
chat-only modal. Add fleet list/create NL fast paths, project picker chips
for ambiguous dispatches, and a db helper to inspect recent conversations.
Co-authored-by: Cursor <cursoragent@cursor.com>
Merge SLH into surf-your-life on prod, drop orphaned box DB, remove SLH from
hetzner manifest, and wire Bitbaum user_projects dir for local dispatch.
Co-authored-by: Cursor <cursoragent@cursor.com>
Merge Cockpit and empty dupes into canonical entities, delete infra/stub
rows, and ship retire-stale-projects.ts plus merge helpers for future hygiene.
Co-authored-by: Cursor <cursoragent@cursor.com>
Self-hosted on Hetzner is the only reality now; the leftover references were
stale at best and a security hole at worst. Thorough sweep across code, config,
scripts, docs, and comments (84+ files). Self-hosted supabase.orangecat.ch is
kept; historical migration records stay accurate.
Functional / security fixes:
- cron-auth: prod detection was process.env.VERCEL (unset on the box!), so the
fail-closed 'CRON_SECRET unset -> 503' gate never fired in production. Now
keys on NODE_ENV=production. (security)
- auth trustHost: dropped the dead process.env.VERCEL===1 branch.
- AppFooter: read the baked-in build SHA instead of VERCEL_GIT_COMMIT_SHA/ENV.
- project bootstrap: removed 'neon projects create' + the Vercel deploy brief;
DB option is now self-hosted Postgres, deploy guidance is the self-hosted flow.
- db-url: removed the legacy NEON_DATABASE_URL* fallbacks (+ updated its test).
Infra / removals:
- deleted .github/workflows/vercel-deploy.yml and scripts/db/dump-from-{neon,supabase}.sh.
- stripped NEON_* env fallbacks from db dump/restore/sync scripts.
User-facing:
- desktop offline overlay no longer blames a 'Vercel hiccup'; privacy page +
PRIVACY_POLICY subprocessors now say Hetzner self-hosted / self-hosted Postgres.
Plus ~50 comment/doc rewrites (Vercel -> the cloud host/the box; Neon -> Postgres).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Thorough cleanup after a full investigation of "so many things are wrong".
DEPLOYMENT — the "This deployment is temporarily paused" ghost. The canonical
host already moved to fleetcrown.orangecat.ch (Hetzner); the message came from
leftover references to the paused fleetcrown.vercel.app deployment:
- vercel.json: drop the `alias: ["fleetcrown.vercel.app"]` (the paused domain).
- scripts/fleet: install-cli POSTs to fleetcrown.orangecat.ch, not the dead URL.
- package.json: `ship` just pushes (the pre-push hook deploys to Hetzner);
replace `wait:vercel` with `deploy` → scripts/deploy-hetzner.sh.
- delete scripts/wait-for-vercel.sh and orphaned desktop/.vercel/.
- repoint stale Vercel URLs in scripts/db/*.md and the local VAPID_SUBJECT.
(Fleet Runner already targets orangecat.ch in source — the user's "paused"
view is a stale installed build; the current v0.8.0 build/.deb is in desktop/dist.)
ICON — the browser-tab icon was blank/wrong:
- public/icon.svg drew the spiral at ~23% of the canvas with 0.7/0.95 opacity,
so it vanished at 16px. Rescaled to fill ~62% at full contrast (shape
unchanged, matches BrandMark.tsx).
- delete the stale src/app/favicon.ico (still the Next.js starter triangle);
metadata already declares /icon.svg, so browsers now show the brand mark.
CONTROL honesty:
- Autopilot badge no longer shows a pulsing "Building" on every autopilot-on
project (the default), which made idle projects look actively worked. It's now
a static "Auto"/"Paused" policy chip; the pulse is reserved for real `working`.
- /activity stats (promptsSent/runsStarted) now come from real count(*)
aggregates instead of the 200-capped row arrays (showed "200" when the true
30-day count was 277).
- "Previous automated run" shows a crashed `running` row (no terminal write,
>30min old) as "interrupted" instead of a live-looking "running" tag.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The desktop runner code was already correct (APP_URL → orangecat.ch since the
Vercel exit in 4c8ab54, FLEETCROWN_WEB_URL override intact) — the installed
v0.7.9 binary is just stale, built before that. But import-from-local.sh
(publicly served at /import-from-local.sh) still defaulted FC_API to the dead
fleetcrown.vercel.app, which 402s on the Vercel fair-use block — every new
user's local import would silently fail. Repoint it and two ops/test scripts
to fleetcrown.orangecat.ch. Rebuilt desktop bundle verified: orangecat ×9,
vercel ×0.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Pre-this-commit, the Hetzner DB had ALL 26 historical migrations applied
(via drizzle-kit push during the v0.6 cutover, task #15) but ZERO rows in
drizzle.__drizzle_migrations because push doesn't write the ledger. As a
result drizzle-kit migrate would have tried to re-apply every migration
from scratch on its first run — failing on the first CREATE TABLE for an
already-existing table, OR worse, silently producing drift if any IF NOT
EXISTS / IF EXISTS guards saved the run.
This commit closes that gap permanently.
NEW scripts/db/bootstrap-migration-ledger.ts (175 lines):
Reads all drizzle/NNNN_*.sql files. Computes sha256 of each (drizzle's
canonical hash format). Modes:
--dry-run (default) Print the SQL it would apply
--emit-sql Print to stdout (pipe to psql)
--write-journal Update drizzle/meta/_journal.json locally
--apply Run against DATABASE_URL via psql -f
Idempotent (uses ON CONFLICT DO NOTHING). Safe to re-run.
APPLIED to prod (postgresqlbridge.orangecat.ch):
CREATE SCHEMA IF NOT EXISTS drizzle;
CREATE TABLE IF NOT EXISTS drizzle.__drizzle_migrations (id, hash, created_at);
CREATE UNIQUE INDEX __drizzle_migrations_hash_idx ON (hash);
INSERT one row per migration (26 total) with computed sha256.
Verified: SELECT count(*) FROM drizzle.__drizzle_migrations → 26.
WROTE drizzle/meta/_journal.json:
26 entries, monotonic 'when' timestamps starting 2026-01-01.
Future 'drizzle-kit generate' calls will append entries on top;
'drizzle-kit migrate' will see existing entries' hashes match the
ledger and skip them, applying only new migrations.
GOING FORWARD:
Schema changes: edit src/db/schema/*.ts → drizzle-kit generate → review
the new drizzle/NNNN_*.sql → drizzle-kit migrate to apply.
No more direct 'drizzle-kit push' to prod (kept available for dev DBs).
No more manual 'psql -f drizzle/NNNN_*.sql' shenanigans.
Tech debt this resolves:
- Drift detection: works now. drizzle-kit migrate exits 0 if and only
if the ledger matches the file hashes.
- CI: future deploy pipelines can run drizzle-kit migrate as a step
and have confidence in the result.
- Team scaling: someone other than me can apply migrations without
'how does this DB actually get migrated' tribal knowledge.
Verified: tsc clean, 19/19 control-presenter tests pass. Prod DB
unaffected outside the new drizzle schema.
Same job, one more source. Now the toolkit handles:
- FleetCrown out of Neon (`dump-from-neon.sh`)
- OrangeCat out of Supabase (`dump-from-supabase.sh`)
- Both consolidated onto one self-hosted Postgres box
scripts/db/dump-from-supabase.sh
Mirrors dump-from-neon.sh's interface. Supabase-specific guards:
- Refuses pooler URLs (port 6543 / pooler.supabase.com) because
pg_dump fails midway through transaction-pooled connections.
- Defaults to --schema=public only. Supabase's auth/storage/realtime/
extensions schemas would create dangling-role FK errors on a vanilla
Postgres target. FULL_DUMP=1 dumps everything when self-hosting
gotrue too (bigger project for another day).
- Same .sql + .manifest.txt output shape as the Neon script;
restore-to-target.sh accepts either without modification.
scripts/db/BOTH_PRODUCTS_ONE_HOST.md
Layers two databases (`fleetcrown`, `orangecat`) on a single Postgres
instance with separate roles and per-role pg_hba.conf lines. Covers:
- role + database setup
- pg_hba rules: each role authenticates only to its own DB
- migration sequence: FleetCrown first (it's broken), OrangeCat
second (still functional on Supabase)
- auth-stays-on-Supabase recommendation for OrangeCat (cheap, no
gotrue self-host needed at this scale)
- shared backup cron with off-box rsync mirror
- PgBouncer add-on for when connection count balloons
- explicit "when to split the box" thresholds (sustained 70% CPU,
<95% cache hit ratio, p95 latency >50ms)
scripts/db/README.md
Updated header + file table to mention both products. Migration
cookbook now has separate Step 1 entries for Neon vs Supabase and
points at BOTH_PRODUCTS_ONE_HOST.md for the dual-product path.
Capacity sanity for the curious: a Hetzner CX22 (€4.51/mo, 2 vCPU, 4 GB
RAM, 40 GB SSD) is over-provisioned by ~3 orders of magnitude for both
products at today's scale (single-user each). Upgrade in-place to CX32
when sustained CPU exceeds 70% — that's many months out.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Grab-and-place migration kit so we can move off Neon (which capped our
data transfer earlier today) on ~30 min notice when the quota resets or
we upgrade the plan just long enough to dump.
scripts/db/dump-from-neon.sh
pg_dump + emit a manifest of pg_stat_user_tables row counts. Plain SQL
format (auditable, diff-friendly). Halts the script if SOURCE_DATABASE_URL
is missing.
scripts/db/restore-to-target.sh
psql --single-transaction --set ON_ERROR_STOP=on against the new host.
Refuses to overwrite a target that already has users rows (set
RECREATE_DB=1 to force). After restore, compares pg_stat_user_tables
row counts against the source manifest and halts if any table
mismatches — keeps a botched migration from making it to "flip Vercel."
scripts/db/SETUP_HETZNER.md
Runbook from "open Hetzner account" to "Vercel deployed + smoke passes"
for a CX22 (~€4.5/mo). Covers Postgres 17 install, SSL, ufw, fail2ban,
pg_hba, env swap, smoke. ~30 min end-to-end.
scripts/db/SETUP_ORACLE_FREE.md
Same shape for Oracle Always-Free ARM (4 OCPU / 24 GB / free forever).
Calls out the gotchas: dual firewall (Oracle Security List + iptables),
ARM-specific Postgres package source, idle-reclamation risk.
scripts/db/README.md
6-step end-to-end migration cookbook tying the scripts and runbooks
together. Why pg_dump over Drizzle migrations: data move, not schema
sync. Why keep the Neon dump cold for 30 days post-migration.
Today the toolkit can't actually run end-to-end because Neon's quota is
blocking pg_dump. That'll clear on monthly reset (or with a one-month
plan upgrade just long enough to dump). When it does, the full migration
is a coffee break, not a project.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- desktop build clean, tsc clean, lint 0, home/ 89/89
- advances desktop-2/3: dispatches now produce durable events in ~/.fleetcrown/events.jsonl with proper runId/sentinel so stop-hooks and web control plane treat them as first-class
- still no embedded watcher (idle via co-running home/watcher.ts for now)
Refs: desktop-app.md phases, Cockpit.roadmap T1/T2, prior landing 2d98638
Finishes the Oracle migration plumbing started in ec6f423. Three pieces:
1. scripts/db/oracle-await-cutover.sh — polls
~/.config/cockpit/oracle-migration.env every 15s for ORACLE_HOST
(timeout 7200s by default), then runs oracle-cutover.sh with
SKIP_DUMP=1 once the IP is set. Lets the operator launch this
before creating the VM in the Oracle console; cutover fires
automatically the moment the public IP lands in the config.
2. scripts/db/oracle-cutover.sh — SKIP_DUMP=1 reuses an existing
pre-oracle-cutover.sql.gz instead of re-dumping prod, so the await
loop doesn't double-dump on every retry; env -u NODE_ENV wraps
`npm run build` and `vercel deploy`/`vercel redeploy` so the
ambient NODE_ENV=production from systemd or .env files can't
poison the build's mode resolution.
3. package.json — adds db:oracle-await alias.
Vendor-neutral DATABASE_URL helpers, dump/restore/sync tooling, and one-command
Oracle migration after a single console VM step. Publishes the studio-stack
thoughts article and hardens build (dynamic layout, resilient sitemap).
Co-authored-by: Cursor <cursoragent@cursor.com>