Commit Graph
3 Commits
Author SHA1 Message Date
CatoandClaude Fable 5.1 95c40a9cd8 refactor: rename the product from FleetCrown to Loki (#695)
The product, its assistant, the repo, the host and every unit on the box now
share one name. 638 files, ~3,000 mentions: UI copy, config, env keys
(FLEETCROWN_* -> LOKI_*), systemd units (fleetcrown-* -> loki-*), docs,
articles, the deploy workflow other repos reuse, and nine file names.

- Three article slugs carried the old name and had been shared; permanent
  redirects keep those links alive (next.config.ts).
- test-no-retired-name.sh now also forbids the old product name across the
  whole repo, so the rename cannot creep back through templates and examples.
- ASSISTANT_STACK collapses the product and the assistant into one entry,
  because they are now the same name.

Infra was cut over ahead of this merge: /opt/loki, loki-* units, the `loki`
database and role, loki.orangecat.ch (old host 308s to it; /api, /widget,
/embed keep proxying), GitHub repos bitbaum/loki and bitbaum/loki-releases.
The Resend sending domain stays fleetcrown.orangecat.ch until the new domain
is verified in DNS.


Claude-Session: https://claude.ai/code/session_016YJVAanfj8keVSXyZnTemh

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-13 16:13:10 -07:00
G c41747c112 fix(box): stop the alert storm, un-break the memory check, and stop the disk filling up (#164)
Four fixes to the box's self-monitoring, all root-caused rather than papered over.

**The 40-alert storm** was a shell return-code trap, not an incident: `alert_transition`
ended with `[ test ] && cmd`, exporting the test's result as the function's return
code, so `cmd && A || B` ran the recovery branch after a *successful* alert. Every
tick emitted DISK + RECOVERED and the state file never advanced. Now returns 0
unconditionally, with hysteresis (bad >85%, ok <80%) so the disk can't flap.

**The memory check could never fire** — `read` binds all trailing fields to the last
variable, so the parsed values were garbage. Dead since it was written. Rewritten with
awk against the real `free -m` field layout.

**The disk keeps filling** because of dev checkouts, not apps: ~13 repos under
`/home/ubuntu/dev` × ~1GB node_modules ≈ 12GB, growing ~1GB per repo added. All
deployed apps together are 190MB. New hourly `disk-gc` no-ops below 80% and reclaims
to 70% in cost order (caches → npm → releases beyond 2 → node_modules of repos idle
≥14d, coldest first), skipping anything with a live process and refusing paths outside
its root. Freed 3.8GB on first run; box 86% → 76%.

**Hetzner upgrade capacity is now visible.** The poller was already alerting on
Telegram but wrote nothing anyone could see; it now emits state that `/system` renders
as a Box capacity card. Every spec comes from the Hetzner API — bitbaum is a cx33
(4/8/80); cx43 doubles the disk to 160GB and is the real fix for the disk problem.

33 shell tests cover the logic that ships in the heredocs (extracted from the payload,
not a drifting copy), wired into `verify` via `npm run test:ops`.
2026-08-05 19:14:48 +02:00
GandMao Nakamoto ee7a68d82f feat(hetzner): watch for rescale-availability windows + back up whole monitoring stack (#76)
Falkenstein (fsn1) is capacity-blocked for cx-line rescales: the console lists
cx43/cx53 as valid targets ("supported"), but the API's available_for_migration
is empty, so a rescale actually fails. Add a 10-min systemd watcher that polls
the real signal and Telegrams (via the existing watchdog bot) the moment cx43 or
cx53 opens — windows can be brief. Transition-only, read-only API token in
/opt/monitoring/hcloud.env.

Also broaden the config/secrets backup: capture ALL of /opt/monitoring/*.{sh,env,conf}
+ the monitoring systemd units (was only targets.conf + telegram.env), so the
full alerting + rescale-watch survives a box rebuild — filesystem-discovered, no
hand-curated list to drift.

Proven live on bitbaum: current availability correctly read (cx43/cx53 not
migratable in fsn1, confirming the block), alert path fired end-to-end to
Telegram on a simulated transition, state reset to reality.

Co-authored-by: Mao Nakamoto <noreply@anthropic.com>
2026-07-22 11:51:55 +02:00