Commit Graph
285 Commits
Author SHA1 Message Date
CatoandClaude 0bdf3d79b4 feat(ops): prove a real password reset, and Loki's OrangeCat token (#1546)
prove now also runs a real password reset on every switched product: the
product's own forgot-password page, the mail in a real inbox (a
throwaway mail.tm address), its link, a new password set on the
product's reset page, and that password signing in. On Loki, after the
real OrangeCat sign-in, the token it left in Loki's accounts is checked
against OrangeCat's userinfo, as publish needs. Nothing printed names an
address, a link, a password or a token.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-02 09:21:56 +01:00
CatoandClaude Opus 5.5 18d34dff0a fix(notify): OpenClaw jobs send only what has one tap; close the review's critical/high findings (#1542)
* fix(openclaw): every scheduled job sends only what has one tap, else NO_REPLY

On 2026-11-02 the chat still carried OpenClaw's own messages that fail the
owner's test: "Invoice / Payment Alert … if credit card is on file, no
action needed", "Gateway was not running. Restarted automatically. All good
now." The scheduled jobs' prompts live only on the box, so:

- contract.md: one short block appended (between markers, replaced on each
  install) to every enabled job except the day plan: send only what needs
  him, each item with the ONE link that does it, never status or counts, and
  reply exactly NO_REPLY when nothing passes — OpenClaw's documented silent
  token, which suppresses delivery.
- The installer lists, by path only, every file on the box that calls the
  Telegram API or says "restarted automatically", so the remaining sender is
  found from the public log without printing anything private.
- Notices carry no machine name ("orangecat-cat · …"); the source stays on
  the list row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtzUbLhg3oqt4X1NaN

* docs(telegram): register the day-plan installer (it only searches for senders)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtzUbLhg3oqt4X1NaN

* fix(notify): close the review's critical and high findings

An independent review of the messaging system found real defects; these
are the ones that lose an urgent message, send a wrong one, or wake him:

- Intrusions could be dropped: the caps held urgent notices, every SSH
  password login shared one dedupe key, and /api/notify/box answered 200
  when nothing was recorded, so the box never used its direct fallback.
  Urgent notices skip the caps, intrusion lines are keyed on the whole line,
  and the route answers 503 when an urgent line was not delivered.
- A link chosen by an email could become a trusted one-tap button. Buttons
  now open only own domains, Gmail, Google Calendar, GitHub or Hetzner.
- Long titles/labels or a fourth button dropped real notices into the list;
  they are clipped instead. Only a missing or unsafe action refuses.
- SSH login from a new address and edits to authorized_keys/sudoers/shadow/
  PAM/ld.so.preload are intrusion signs (both lists, kept equal by test);
  the button opens /today, where the notice is listed; the title names the box.
- Customers' escalations and capped goals reached the owner's chat
  (selfTelegramTarget); they now use telegramTargetFor. The gateway-down
  message went once per fleet account; it is sent once.
- The notify routes accept bearer tokens only (no browser session/CSRF).
- countDeliveries ignored rows older than a week; it no longer does.
- Night silence (22:00–07:00 Zurich) for the direct senders too: lib-alert's
  fallback, ivy-health, fleet-uptime, deploy-hetzner. ivy-health names what
  broke and offers Redeploy only when Loki's app is the failure, Box doctor
  otherwise, and reads the chat id from the box's telegram.env.
- Prompts: the day plan no longer asks for approve links it cannot get or a
  page it cannot open, never uses links found inside emails, and says when a
  source failed. The summaries he asked for (reflection, digests, scorecard,
  evening wrap) get a digest contract instead of being silenced; jobs with no
  text prompt are left untouched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtzUbLhg3oqt4X1NaN

* feat(day-plan): one morning message; the email scanner twice a day

Approved by the owner 2026-11-02. The day plan now carries a half-line on
each person he meets today, and the separate 07:30 "Meeting People Brief"
is switched off. The email deadline scanner runs at 08:00 and 17:00 instead
of four times a day.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtzUbLhg3oqt4X1NaN

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-02 08:46:52 +01:00
CatoandClaude Opus 5.5 f8da012c95 feat(notify): Telegram only with a one-tap action — one gateway for every bot (#1540)
* fix(alerts): stop paging on transient systemd-run units; send digests silently

The 5-minute host sweep announced every failed one-off systemd-run unit
(run-p<pid>-i<id>) as its own incident. Each has a fresh name, so no
per-unit cooldown held and the phone rang every five minutes.

The sweep now resets those units and never announces them, and the
STILL FAILING / RECOVERED digests are delivered with disable_notification.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtzUbLhg3oqt4X1NaN

* fix(alerts): quiet by default, ring only for down/intrusion; stop deploy and cron echoes

- lib-alert: all box alerts deliver silently except DOWN/deploy failure/
  intrusion-class messages (_alert_silent)
- host sweep: failed appcron oneshots are the OnFailure notifier's, not repeated
- security check: files a deploy rewrites by design are journal-only

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtzUbLhg3oqt4X1NaN

* ci(box): install the alerting scripts on the box when they change

The alert fixes only take effect once install-host-alerts.sh and
install-security-watch.sh run on the box, and nothing ran them.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtzUbLhg3oqt4X1NaN

* feat(notify): one tap or not at all — every bot reaches the owner through one gateway

The owner's Telegram held ~1,200 unread messages and rang every five minutes
with lines he could do nothing with ("STILL FAILING: run-p…", "SENSITIVE
FILE(S) CHANGED … if this was a deploy, ignore", "built nothing"). New rule,
enforced in code: a message reaches the phone only with a button that does
the thing; everything else is recorded on /today or /system.

- telegram-send: refuses a message without a URL button (NOT_ACTIONABLE);
  adds silent delivery and sendTelegramVoice.
- lib/notify: one gateway (deliverNotice) with the policy — at most 3
  buttons, one incident one message with backed-off reminders, 3/source/hour
  and 12/day caps, sound only for "now" and never 22:00–07:00 Zurich. Voice
  notes for paid plans; a monthly "voice notes come with Personal" notice
  with its pay button for free accounts.
- Routes: /api/notify (token holders, `loki.sh notify`), /api/notify/box
  (the box's lib-alert), /api/orangecat/notify (OrangeCat's bots, signed).
- Box: lib-alert posts every line to Loki's list instead of Telegram; only an
  intrusion goes straight to the phone when Loki is unreachable, with a Box
  doctor button. ivy-health pages only "down and restart failed" with
  Redeploy; clean deploy rollbacks are not paged; fleet-uptime pages only for
  Loki or 3+ apps down; sleeping apps are no longer conformance findings.
- App senders: each kept one now carries its button (Triage it, Review it,
  Watch the fix, Write to them, Restart the gateway, Decide on Control …);
  telemetry/runner/model-id pings and run successes leave Telegram.
- Day plan: the morning brief's prompt is in the repo
  (scripts/openclaw/day-plan) and installed on merge, which also switches off
  jobs that only post swap/memory warnings.
- Workflows install the box alerting, ivy-health, the day plan and OpenClaw's
  photo/video understanding on merge instead of by hand.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtzUbLhg3oqt4X1NaN

* feat(telegram): every sender is silent between 22:00 and 07:00 unless it says otherwise

Feedback, studio briefs and the other direct senders skipped the notify
gateway's quiet hours. A send that does not ask for sound now arrives
silently at night in the owner's zone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtzUbLhg3oqt4X1NaN

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-02 07:04:45 +01:00
CatoandClaude 33e6a4b8dc fix(app-secrets): restart an app only when it is running (#1538)
On 2026-11-01 an `ensure` for keller wrote its OrangeCat client and then
failed the run: keller-app exists (registered 2026-10-29) but keller has
never been deployed, so there is no release to start, and the restart
exited 1. apps.conf lists keller as a prospect; it is meant to stay off.

The restart now asks `systemctl is-active` instead of `systemctl cat`. A
unit that is not running is left alone and the run reports that its next
start reads the new values, the same promise as for an app with no unit.
A running app is restarted exactly as before. test-app-secrets.sh pins
the stopped-unit case (26 pass).


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 23:39:49 +01:00
CatoandClaude d719ff00ca fix(app-secrets): no fixed switch-on of the shared sign-in; only signin-on (#1537)
#1531 added SIGNIN_ISSUER/SIGNIN_CLIENT_ID literal rows for petvity and
surf-your-life, and #1533's merge of main carried them in. Any `ensure` for
those apps would show the Morulia button while Morulia lists no provider.
The rows go (the pairs stay), and a test now fails on any registry row that
sets either name: signin-on, which refuses without a provider, is the only
writer. Same intent as #1536, which no longer applies cleanly after #1533.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 22:35:08 +01:00
CatoandClaude f6954978d7 fix(box): accountkit-switch rollback refuses to empty the only copy of a credential (#1535)
rollback empties the shared auth_* tables, which was safe while they held
only copies of the product's own rows. Once a product renders AccountKit's
own screens (petvity and surf-your-life now do), those tables hold the only
copy of every password set through AccountKit, every passkey and every second
factor. rollback now counts those first and refuses on any, naming the safe
path: revert the product's screens pull request.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 22:14:32 +01:00
CatoandClaude 2c0d8b737d feat(app-secrets): every sign-in page is a Morulia and an OrangeCat client (#1533)
Three things, all in the one registry that writes secrets nobody holds:

- morulia pair rows for the 13 apps bitbaum/morulia#21 adds (every fleet app
  with a sign-in page, fleet docs/auth-parity-2026-11-01.md), so `ensure
  morulia` gives each its SIGNIN_CLIENT_SECRET.
- a new kind, oc-client:<id>, for "Sign in with OrangeCat" in the ten apps
  that had no OrangeCat client. It writes ORANGECAT_OAUTH_CLIENT_ID/_SECRET
  into the app's env first, then the secret's sha256 into OrangeCat's
  oauth_clients row (created switched off by orangecat's deploy) and switches
  it on. A row holding a secret the app lacks is reported, never replaced.
  Nothing is printed but names and states.
- an action, signin-on <app|all>: adds SIGNIN_ISSUER and SIGNIN_CLIENT_ID
  beside the paired secret and restarts the app. It refuses while Morulia's
  /api/health lists no provider, so the button can never lead to an empty
  page. Ready for when the provider keys are in.

test-app-secrets.sh: 25 checks (11 new), including that neither a secret nor
its hash is printed.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 22:13:30 +01:00
CatoandClaude 24e27d25fa feat(box): the shared sign-in for petvity and surf-your-life (#1531)
Both apps move onto AccountKit's own sign-in screens, which offer Morulia once
SIGNIN_ISSUER, SIGNIN_CLIENT_ID and SIGNIN_CLIENT_SECRET are set. The client
secret is a pair with Morulia's SIGNIN_CLIENT_SECRET_<ID> (bitbaum/morulia
lib/clients.ts rows); the issuer and id are literals.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 21:21:26 +01:00
CatoandClaude Opus 5.5 bf448e39f2 ops(register): follow main from a shallow checkout (#1526)
* ops(register): a refused follow says where the two histories meet

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9

* ops(register): follow main from a shallow checkout

The box's loki checkout is a shallow clone (52 grafts). A fetch into it
stops at the old boundary, so HEAD (c65ead0f6, 2026-10-07, an ancestor
of main) and main shared no history there and the follow refused with
335 'local' commits. Deepen the fetch past HEAD's date, then judge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 19:38:01 +01:00
CatoandClaude a85a2d15ee fix(ops): show every refusal code the OrangeCat proof lands on (#1525)
Claude-Session: https://claude.ai/code/session_019MDtmud6zcK4rStBGmYSML

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 19:32:54 +01:00
CatoandClaude 81f920a108 chore(register): the leftover signin database is gone (#1523)
Dropped with drop-db.yml (run 41335134500): 0 users, 0 sessions; its
rows were one schema-history row and the 7 OIDC client registrations
morulia holds for itself. The role went with it. The morulia row's
comment no longer says the database is on the box.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 19:26:33 +01:00
CatoandClaude Opus 5.5 cc8672d665 ops(db): drop-db counts the rows before it drops (#1522)
* ops(db): drop-db counts the rows before it drops

The dry run said tables and size, not whether anything is in them.
signin has 13 tables and 8 MB; 'it holds no users' is now a count in
the log (exact, one count(*) per table, summed), not an assumption.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9

* ops(db): name the tables that hold rows, with their counts

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 19:25:16 +01:00
CatoandClaude ddbd95303d ops(register): bring the box's register to main; retire a site main already removed (#1520)
register-drift reported orangecat-2 only in the box's register, and six
rows main had since corrected: the box's loki checkout sat on a
2026-10-07 commit, because only register-site.sh ever fast-forwards it.

- box-register.yml + box-register-follow.sh: the same adoption, on its
  own. Fast-forward only, from the public repository URL; refuses while
  the box holds a row main lacks, a local commit, or a change beyond
  apps.conf. Plan by default; keeps the old register in the home dir.
- retire-site.sh, delete: also removes the row from the box's register.
  Run from the workflow it removed it from the runner's copy only, which
  is how orangecat-2 (retired 2026-10-17) stayed on the box.
- retire-site.sh, offline and delete: stop the wake socket too. A site
  that sleeps when idle kept its socket listening on its port, and any
  local request woke the app again.
- retire-site.sh: --no-github (no repository, workflow or secret step)
  and --keep-data (delete keeps /opt and the checkout); RETIRE_LOOK=1
  prints what is on the box before the plan.
- retire-site.yml: github and keep_data inputs, the look, and a site
  that only the box's register still has is judged by that row.

Tests: test-box-register-follow.sh (new, in test:ops) and
test-retire-site.sh (12 more checks).


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 19:19:15 +01:00
CatoandClaude c84a57a62e fix(ops): name the product's refusal code when the OrangeCat proof is refused (#1519)
Claude-Session: https://claude.ai/code/session_019MDtmud6zcK4rStBGmYSML

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 19:13:06 +01:00
CatoandClaude f4418172a8 ops(register): name the columns a drifted row differs in (#1518)
register-drift.sh said only port and status for a differing row, so
biaslens, kivvi and vitareba (same port, same status on both sides) were
reported with nothing to go on. It now names every column that differs,
with both values. The workflow also prints the box checkout's branch,
distance from main and changed paths, as context for a red run.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 19:08:12 +01:00
CatoandClaude Opus 5.5 089235bb46 fix(register): biaslens has a host database (#1517)
* fix(register): biaslens has a host database

The box's register says biaslens's db column is biaslens; main said '-'.
The box is right: register-site.sh provisioned the database there, and
biaslens.orangecat.ch/api/health reports its accounts ready, which needs
DATABASE_URL. With '-' every deploy skipped the app's schema step. Found
by register-drift (only biaslens's db column differed).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9

* docs(register): say which deploys read main's biaslens row

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 19:07:01 +01:00
CatoandClaude 9597e1f75d ops(db): a dispatch-only workflow that drops one leftover host database (#1516)
Nothing dropped a host database: retire-site.sh keeps a site's data by
design, so signin, renamed to morulia, left its empty database behind.
drop-db.yml drops exactly one, and refuses unless the register and the
box both say nothing can still mean it:

- droppable-db.sh, against main's register and the box's checkout of it:
  not a system database, no row named after it, no row's db column
  using it;
- drop-db-on-box.sh, on the box: not a template, no env file under /opt
  naming it in DATABASE_URL, no open connection. Then the database, and
  the role of the same name if Postgres lets it go.

An empty confirm is a dry run; confirm must repeat the name to drop.
Names, counts and sizes only in the log. Tested in test:ops
(test-drop-db.sh).


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 19:05:50 +01:00
CatoandClaude 5a1c34981d feat(ops): prove the account journeys live on a switched product (#1515)
A prove action for accountkit-switch.yml, with throwaway accounts deleted
again: two sessions, a row change read on the next request, a password
write ending every session (old refused, new accepted), sign-out and
deletion. Where the product offers OrangeCat, a real browser sign-in
with a throwaway OrangeCat account through OrangeCat's sign-in and
consent and back. This replaces the approved test identity the switch
docs waited on.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 18:56:01 +01:00
CatoandClaude 281540c4bf feat(ops): an AccountKit switch per product, with a live proof and rollback (#1510)
Five products stage AccountKit beside Auth.js behind AUTH_RUNTIME. This is
the switch, from GitHub over the deploy's SSH, one product per run:

- survey: counts only, including people whose only way in is a social
  provider AccountKit cannot reach yet (they would be locked out);
- switch: refuses while that count is above zero; imports under locks with
  the product's own accountkit-import.sql, ensures a 32-character
  BETTER_AUTH_SECRET, sets AUTH_RUNTIME=accountkit, restarts, then proves
  on the public site that AccountKit answers and a throwaway account signs
  in, reads its session and signs out (deleted after); any failure rolls
  back;
- rollback: AUTH_RUNTIME off, restart on Auth.js, mirrors dropped, shared
  tables emptied.

The log is public: counts and verdicts only. test-accountkit-switch.sh joins
test:ops.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 17:15:29 +01:00
CatoandClaude 6628a951d4 ops(register): remove the retired signin row (#1505)
retire-site.sh --mode delete cleared signin from the box on 2026-11-01
(run 41293394217): unit, vhost, /opt/signin, checkout and watchdog
target. The rename guard skipped every GitHub step, so bitbaum/morulia
kept its workflows and deploy key. Port 4040 is free again. The host
database `signin` is still there; the morulia comment says so.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 10:42:34 +01:00
CatoandClaude 6859c7271e ops(register): the shared sign-in is morulia; signin is archived (#1504)
bitbaum/signin was renamed to bitbaum/morulia (fleet #413) before any app
used it. The service moves to morulia.orangecat.ch:

- apps.conf: a morulia row (port 4041, db morulia, live). The signin row
  is archived so no sync regenerates it; it goes once retire-site --mode
  delete has cleared the box.
- app-secrets.sh: the registry entry is morulia, SIGNIN_URL is
  https://morulia.orangecat.ch, same seven pair lines. With morulia's
  side empty and each app holding its SIGNIN_CLIENT_SECRET, ensure copies
  the app's value over; nothing is regenerated.
- retire-site.sh: a renamed repository still answers under its old name,
  so retiring signin would have disabled morulia's workflows, removed its
  deploy key and, with --repo archive, archived it. Every GitHub step is
  now skipped when the repository belongs to another name. Tested.
- provision-db tests and examples name morulia.

The SIGNIN_* env names stay: they are generic.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 10:21:06 +01:00
CatoandClaude 38b0fa78df fix(ci-gate): a run started by hand or by a clock is not CI (#1498)
A nightly or dispatched data load runs on main's SHA. When solon's law-text
load could not read a few scanned PDFs it failed, and the gate read that as
red CI and blocked four deploys of a commit whose verify was green. Only runs
a push or a pull request started now count; a dispatched run can neither
block nor outvote the push run's verdict. Pinned in test-ci-gate.sh.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 06:51:56 +01:00
CatoandClaude 49f0771666 ops(register): a daily check that the box's register matches main (#1493)
register-site.sh writes a new row into the box's checkout first and
opens a PR to carry it to main. When that PR stalls, the two registers
disagree without anyone being told, and main hands the port out again:
biaslens and signin both on 4038 (#1404, #1492). register-drift.yml
reads the box's apps.conf over the deploy SSH each day and fails on a
box-only or differing row (names and ports only); a main-only row is
reported as the box checkout lagging.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-31 20:46:03 +01:00
CatoandClaude 8b40759825 fix(register): signin moves to 4040; biaslens and keller rows reach main (#1492)
signin was registered on 4038, which biaslens already held on the box:
register-site.sh wrote biaslens's row (4038) and keller's (4039) into
the box's checkout on 2026-10-22 and 2026-10-29, and the PRs that carry
them to main (#1404, #1469) never merged. The upstream register did not
know either port, so #1481 handed 4038 out again. Caddy now sends
signin.orangecat.ch to biaslens, and signin's own wake socket could not
bind.

Both rows are added exactly as the box wrote them, so the register's
unique-port check covers them, and signin takes 4040, the next port no
row holds.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-31 20:29:22 +01:00
CatoandClaude 40b98c00ab ops(register): signin goes live (always on) (#1490)
signin is the shared sign-in issuer every consuming app redirects to; a
sleeping issuer makes each first sign-in wait for a cold start. Live also
skips the wake socket, whose first sync collided with the units a deploy
had already started (see PR body).


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-31 20:07:51 +01:00
CatoandClaude f57234b40a fix(hetzner): a first switch to sleep stops a leftover wake proxy (#1491)
A deploy that runs before a new sleeping site's first sync completes
starts the app, which pulls in <app>-wake.service, and its proxy keeps the
inherited listener on the public port. The socket sync-infra then enables
cannot bind it (signin, 2026-10-31: Result: resources on every sync). When
the socket is not active, stop the proxy with the app and clear the
socket's failed state before enable --now.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-31 20:03:10 +01:00
CatoandClaude 757af003a7 fix(hetzner): sync-infra says why a wake socket did not start (#1489)
sync-sites apps=signin exited 1 with no output right after
"sleeps when idle": the activation's last command is
`systemctl enable --now <app>-wake.socket >/dev/null 2>&1`, so its
failure was the box call's exit status and its reason was discarded.
On failure it now prints the socket's status and what is listening on
the public port (unit names, ports, process names; no values), then
exits 1. The test pins the message and that the generated activation
script parses.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-31 19:49:13 +01:00
CatoandClaude 9ad520a6cd fix(ops): an empty app .env line no longer erases a fleet key (#1488)
Every app template ships `RESEND_API_KEY=`. launch.sh sourced
/opt/fleet/env and then the app's .env, so that blank line overrode the
fleet's mail key with nothing, and password recovery stayed hidden on
diplodoctor, solon and heidi while the fleet held the key.

Now, at runtime (launch.sh.tmpl) and at build (load-build-env.sh):
- an empty app line keeps the fleet value;
- a non-empty app value still wins;
- FLEET_KEYS_OFF="KEY ..." in an app's .env switches named fleet keys
  off, the explicit replacement for "blank means off".

No app documents a blank line as its way to switch a fleet key off: the
empty lines come from the fleet and loki app templates, and aoz-begleitung
and hirnli, whose examples say "leave empty", describe the fleet key as
their production transport.

test-fleet-env-merge.sh runs the rendered template and the build loader
against one fixture, with a negative control for the old order.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-31 19:43:49 +01:00
CatoandClaude 847be47b64 ops(hetzner): provision-db workflow — a host database without a laptop (#1487)
provision-db-on-box.sh was only ever run from a laptop, so a registered
app with no box env (signin) failed every deploy until someone did. The
new dispatch-only workflow runs the same script on the runner over the
deploy's SSH key, in its own concurrency group. provisionable-db.sh
gates the input on the register: only a host database under the name
the script derives from the slug. Names only in the log; the script
never overwrites a key, so a re-run is a no-op.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-31 19:26:13 +01:00
CatoandClaude f76ffe4e29 feat(box): register signin (shared sign-in) and its paired client secrets (#1481)
- apps.conf: signin on 4038, signin.orangecat.ch, its own host database
  `signin`, kind infra, status prospect until it serves.
- app-secrets.sh: signin's SIGNIN_URL, BETTER_AUTH_SECRET and
  SIGNIN_PAIRWISE_SECRET, and a `pair:<app>:<VAR>` kind: one value in two
  apps' env files, generated once, copied on the box when one side has it,
  reported (never fixed) when both differ, never printed. Restart is skipped
  when the app has no unit yet.
- test-app-secrets.sh runs the remote half locally; wired into test:ops.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-30 22:26:27 +01:00
CatoandClaude 055c9b2a2e fix(deploy): copy public/ and .next/static contents, never nest them (#1478)
`cp -r "$SRC/public" "$STAGE/$NEST/public"` copies the directory INTO the
target when the target already exists, and it exists whenever an app
imports a file from public/: Next's output tracing puts that file in the
standalone bundle first. Substrata imports public/geo/*.json, so its new
install icons shipped as public/public/app-icons/ and answered 404 in
production while geo kept working.

Copy the contents into a made-sure directory instead, for public/ and,
by the same reasoning, .next/static.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-30 18:21:58 +01:00
Cato 1d1276d705 fix(starter): the colour-token test flags literal colours, not tokens that point at the palette (#1452)
Problem: the site-template test failed every starter-sync pull request (loki#1429, #1440, #1445) because its pattern matched any custom property whose value starts with hsl( — including --sk-bg: hsl(var(--surface-page)), which is how the starter takes the brand from @bitbaum/design-tokens.

Change: only a hex or oklch/rgb/hsl value that is not a var() reference counts as a local colour. Validation: scripts/hetzner/test-site-template.sh passes 43 of 43 against the synced starter (previously 42 of 43); a literal hex and a literal hsl(10 20% 30%) are still flagged.
2026-10-28 02:41:29 +01:00
CatoandClaude Sonnet 5.5 59cd3e7b10 feat(terminal): a plain shell on the builder, operator-only behind the PIN (#1449)
* feat(terminal): a plain shell on the builder, operator-only behind the PIN

Sessions -> Plain shell opens a real bash login shell in a PTY the builder
owns: no project, no agent, no inject wrapper. It is one more kind of session
on the existing transport (open_shell command, peek-stream, the rawkey lane,
tab-memory), not a second terminal.

Security: operator account only (browser session, never a bearer token); a PIN
must be set and the shell's own unlock (10 min idle, 60 max) entered; opens
rate-limited and capped at 3 per builder; no queued command except
open/close/peek may name a shell tab (queue, validator and injectPty); tenant
and sealed builders never offer one; shell environment carries no engine keys.
Every open/close/denied/unlock is on an append-only audit trail with no
content. Threat model: docs/architecture/plain-shell.md.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE

* test(terminal): keep the repo's gates true for the plain shell

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE

* docs(plain-shell): name where provision-service.py lives

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-27 20:14:13 +01:00
Cato f26465c56b fix(deploy): fail closed when receipt visibility is unknown (#1439) 2026-10-26 10:32:04 +01:00
Cato cfa4d0766a feat: include configured workspace projects in release receipts (#1438) 2026-10-26 08:17:29 +01:00
Cato f2cd986c7c fix(deploy): keep CI runtime environment outside source checkout (#1435) 2026-10-25 19:08:18 +01:00
Cato 9b85906350 feat(deploy): stage public Fleet artifact receipts beside served apps (#1430) 2026-10-25 18:49:40 +01:00
CatoandClaude Fable 5.1 8c9c9b3c01 feat(box): app-secrets — generate an app's machine secrets on the box from GitHub (#1419)
* feat(box): app-secrets — generate an app's machine secrets on the box from GitHub

The secrets an app needs that no human holds: a cron bearer token the box's
own timer presents, and a Web Push (VAPID) key pair. Until now they were a
"generate this and paste it into /opt/<app>/shared/.env" ask handed to the
owner, who on 2026-10-22 — heidi's channel notifications waiting on exactly
that — rightly declined to run openssl for a value nobody will ever read.

scripts/hetzner/app-secrets.sh holds the registry (app|VAR|kind: hex32,
vapid, literal) and the rules: it adds only what is missing and never
overwrites, treats a VAPID pair as one unit, prints names and never values,
and restarts <app>-app only when it added something. Values are made on the
caller's side and travel to the box on ssh's stdin, never in argv or a log.
.github/workflows/app-secrets.yml runs it from GitHub over the deploy's SSH
(show | ensure), then re-runs install-app-crons.sh so a timer exists to
present the new CRON_SECRET.

First registered app: heidi (CRON_SECRET, VAPID_*, subject = the site's
contact address). Checked against a fake box: show, ensure, a second ensure
that adds nothing, the half-pair refusal; the generated pair is 65 + 32
bytes and web-push accepts it.

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

* test(terminal): the swipe test drags a finger that stops, over a deeper buffer

terminal-swipe-browser failed twice on one commit in CI (1 !== 0: the
"as far back" note was already showing after the first swipe) and passed
on main an hour earlier. Two things made the first swipe land on the
oldest line instead of short of it:

- The synthetic swipe lifted at full speed. CDP delivers the twelve moves
  a millisecond or two apart, the scroller reads that as a very fast
  finger, and the glide after a flick runs on that speed — on a quick
  runner one 300px swipe glided past every kept line. Six still moves
  before the lift decay the smoothed velocity to nothing (×0.2 each), so
  a swipe now moves exactly what the finger moved.
- 120 lines was no margin: at 390px the fitted font gives ~66 rows a
  screen, so only ~54 rows sat above the fold and a 300px swipe (~54 rows
  at that cell height) reached the top exactly. 300 lines leave 180 rows
  after the first swipe; the "to the top" loop allows twelve swipes.

Measured locally: start 234 → 180 after one swipe, top reached inside the
loop, the note on the swipe past it; three runs green.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-22 23:12:48 +02:00
CatoandClaude 48b0dc04cc feat(mailgate): every app host receives mail at hello@, delivered signed to the app (#1412)
loki-mailgate is the receiving half of the fleet email standard: one
public address per app on its own host (hello@<app host>), no mail server
or mailbox per app.

- Receive-only SMTP on :25 (smtp-server). Routes by apps.conf (Loki's live
  copy, refreshed by every deploy, plus the one installed beside it), so a
  new site gets mail after the next deploy with no step here. Accepts only
  hello@, postmaster@ and abuse@; refuses everything else at SMTP time, so
  it never bounces and cannot relay.
- SPF / DKIM / DMARC checked (mailauth); failures are marked, not dropped.
- Spooled to disk before "250", then POSTed to
  http://127.0.0.1:<port>/api/mail/inbound signed with the fleet key
  MAIL_INBOUND_SECRET (mail-kit 0.2 inbound contract), retried with backoff
  until the app says 2xx. Delivered mail is pruned after 14 days: the app's
  own retention governs its copy.
- Bundled to one file; a systemd unit with CAP_NET_BIND_SERVICE as ubuntu,
  ProtectSystem=strict; install-mailgate.sh creates the secret and its own
  STARTTLS key and opens 25/tcp; the manual Mailgate workflow tests,
  bundles and installs. test:mailgate joins verify.

Checked end to end against the bundle: hello@skif accepted and delivered
with a valid signature; another mailbox and an unknown host refused 550.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-22 18:46:06 +02:00
CatoandClaude 199ce6f5db fix(ops): fleet env seed works on the box, and mints app secrets (#1409)
The first seed run failed at `sudo install -d -m 0755 /opt/fleet`: the
box's Rust coreutils fails that chmod with EPERM even under sudo. Use
mkdir + chown, the idiom every other box script already uses.

fleet-env.sh gains `secret KEY`, which generates a random value for a
key named in fleet-keys.conf (never prints it), and the conf gains
MAIL_INBOUND_SECRET for the signed inbound-mail contract in mail-kit 0.2.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-22 18:13:50 +02:00
CatoandClaude 74083edcb2 feat(crons): hourly sweep of heidi's followed YouTube channels (#1410)
heidi's /api/cron/channels reads the public feeds of the channels learners
follow and sends the Web Push for new videos (heidi lib/channels/sweep.ts).
XML and one HTTP call per phone; no model. The route refuses without
CRON_SECRET in heidi's .env, and VAPID_* there turns the push on.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-22 11:26:58 +02:00
CatoandClaude 55e6d960a6 feat(box): one copy of the fleet's shared keys, read by every app (#1407)
/opt/fleet/env holds the keys every app may use: the AI vendors, web
search and the shared mail account (scripts/hetzner/fleet-keys.conf).
The launch script reads it before the app's own .env, and the deploy
build does the same, so an app with its own key keeps it and every
other app gets the shared one. Rotating a key is one edit, not eleven.

fleet-env.sh seeds the file from the value the apps already share
(placeholders never count, an existing key is never overwritten, no
value is ever printed) and shows each key as a fingerprint; the
Fleet env workflow runs it on the box. api-key-check now probes the
fleet file too.

Why: eight apps held the shared Groq key, orangecat kept a revoked one
for days, and skif never got one, so its AI stayed off.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-22 11:05:02 +02:00
Cato ac6899c33e fix(fleet): dedicated beta SSH key and preserve existing CI workflows (#1403)
* fix(beta): create app-scoped deploy key securely before Fleet registration

* fix(fleet): preserve product-owned CI and merge workflows even during GitHub API read failure
2026-10-22 09:19:17 +02:00
Catoandcatomean 09379070f5 Sealed builds: fresh container name per launch; launch-check agent@tab; clean-dead (#1391)
* launch-check: agent@tab runs in that tab's container name

* Sealed builds: fresh container name per launch (dead runsc containers can't be removed); clean-dead mode

* clean-dead option

* clean-dead: robust

---------

Co-authored-by: catomean <catomean@users.noreply.github.com>
2026-10-21 23:28:57 +02:00
Catoandcatomean 66180821e5 Sealed builds: reclaim the tab's container name (--replace); launch-check harness (#1390)
* sealed-builds: stop-sealed mode (stop stuck sealed agent containers)

* journal mode

* journal: unit OR drain

* journal tail 600

* journal keep podman

* containers mode

* diag: runtime as the unit runs it

* Sealed builds: --replace the per-tab container name (dead container blocked every launch); real-launch-path check (launch-check mode)

---------

Co-authored-by: catomean <catomean@users.noreply.github.com>
2026-10-21 22:55:51 +02:00
Catoandcatomean 316ccce8b0 Antigravity auto-approve; permission prompts show Needs you with the question (#1387)
* Antigravity auto-approve in unattended runs; agent permission prompts read as Needs you with the question

* Sealed git identity+push, drain counts sealed agents, dead agent = Agent stopped, no menu-pick suggestions; worktree read mode

* worktree mode: find nested worktrees

* worktree mode: match by branch

* worktree mode: staged diff

---------

Co-authored-by: catomean <catomean@users.noreply.github.com>
2026-10-21 21:19:05 +02:00
Catoandcatomean 9faf4d8dd8 fix(apps.conf): Kivvi is a bitbaum product, not a RevampIT favour (#1385)
* fix(apps.conf): Kivvi is a bitbaum product, not a RevampIT favour

* chore: regenerate fleet-sites.ts

---------

Co-authored-by: catomean <catomean@users.noreply.github.com>
2026-10-21 20:54:29 +02:00
Catoandcatomean c898c5e18c Cursor provider probe: pass --trust (unattended probe hit workspace-trust prompt) (#1383)
* Cursor provider probe: pass --trust (unattended probe hit workspace-trust prompt)

* builder-agent-login reprobe: clear and exit

---------

Co-authored-by: catomean <catomean@users.noreply.github.com>
2026-10-21 20:38:04 +02:00
Catoandcatomean 2e645b01c1 Sealed builds: Antigravity gets a TTY and its key (fixes 'never accepted the prompt') (#1380)
* sealed-builds: diag mode (runner journal + gemini under real PTY in the sealed container)

* probe: show composer + working screens

* Sealed builds: Antigravity gets a TTY and its key; Gemini 0.65 working/composer markers

* Fleet Runner 0.8.53 release entry; .env.example XDG_RUNTIME_DIR

* format

---------

Co-authored-by: catomean <catomean@users.noreply.github.com>
2026-10-21 20:29:22 +02:00
Catoandcatomean 0202a30e4e builder-agent-login: grok status via pty + auth file; add mode=reprobe (#1381)
Co-authored-by: catomean <catomean@users.noreply.github.com>
2026-10-21 20:16:32 +02:00