Files
loki/scripts/hetzner/fleet-keys.conf
CatoandClaude Fable 5.2 8b3727e464 ops(fleet-env): retire a key everywhere in one command; GEMINI_API_KEY is no longer a fleet key; ai-kit 1.26 (#1704)
* ops(fleet-env): retire a key everywhere in one command; GEMINI_API_KEY is no longer a fleet key; ai-kit 1.26

GEMINI_API_KEY sat in /opt/fleet/env as a free tier. The Google project had
billing and every app read the key: about $567 on 10-11 Nov 2026. On
2026-11-13 it was still set there, with eight apps on an ai-kit that puts
Google in the free chain.

- fleet-env.sh where KEY: every env file on the box that sets KEY, by
  fingerprint. retire KEY: its line in /opt/fleet/env and in every app env
  becomes a dated comment (the value is kept), and the app units restart one
  at a time so none keeps the value it started with.
- fleet-keys.conf drops GEMINI_API_KEY, so seed never brings it back.
- fleet-env.yml offers where and retire with a key input.
- @bitbaum/ai-kit ^1.26.0: Google out of the free chain, paid AI off unless
  an app opts in, daily caps.

test-fleet-env.sh covers where, retire (value kept, other lines untouched,
no value printed, seed does not restore) and the refusal of a non-credential.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtUQb9BM11ycpApwGq

* test(ops): four .env cases that need an unreadable file are not run as root

chmod 000 is how the section makes a .env unreadable, and root reads any
file. In an agent's sandbox (uid 0) the four cases could only fail, on main
too, and stopped every push that touched scripts/hetzner. They print as not
run; CI and a developer's machine run them as an ordinary user.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtUQb9BM11ycpApwGq

* ops(launch): every app on the box writes to one AI usage log; ai-kit 1.27.0

launch.sh.tmpl exports AI_USAGE_DIR=/opt/fleet/ai-usage where that
directory exists and AI_APP_ID from the app's directory name, unless the
app's own .env sets them. @bitbaum/ai-kit 1.27.0 then writes one line per
model call there (app, vendor, model, outcome; never content). fleet-env.yml
creates the directory. Kivvi canaries 1.27.0, so the rollout gate no longer
passes 1.26.0.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtUQb9BM11ycpApwGq

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-13 11:26:30 +01:00

27 lines
1.3 KiB
Plaintext

# Keys every app on the box may use, held ONCE in /opt/fleet/env.
#
# One per line. These are the fleet's shared accounts — the AI vendors' free
# tiers, the web-search backends and the shared mail account — not anything
# that belongs to one app. An app's own NON-EMPTY value still wins for any of
# them (it is read after /opt/fleet/env), so an app with its own key keeps it.
# An empty line (`RESEND_API_KEY=`) does not erase the fleet value; an app
# switches a fleet key off with FLEET_KEYS_OFF="KEY ..." in its .env.
#
# Read by: fleet-env.sh (seeds and shows the file), launch.sh.tmpl (runtime),
# selfhost-deploy.yml (build) and api-key-check.sh (is each key alive).
GROQ_API_KEY
# GEMINI_API_KEY is NOT a fleet key. It sat here as a "free tier" on a Google
# project that had billing, every app read it, and the fleet spent about $567
# on 10-11 Nov 2026. Google bills per call; an app that wants it holds its own
# key and opts in (@bitbaum/ai-kit `spend`). `fleet-env.sh retire` took it out.
OPENROUTER_API_KEY
TOGETHER_API_KEY
CEREBRAS_API_KEY
MISTRAL_API_KEY
BRAVE_API_KEY
TAVILY_API_KEY
RESEND_API_KEY
# Generated, not seeded: signs mail the gateway (mailgate/) delivers to apps,
# and every app verifies it (@bitbaum/mail-kit). `fleet-env.sh secret` makes it.
MAIL_INBOUND_SECRET