Repository navigation
feat(apps): apps are owned by the account key: deploy, secrets and logs from any machine (#375) - #495
Merged
Merged
Conversation
…oy from any machine (#375) Apps were signed by the deploying machine's buyer key, so only that machine could redeploy, read logs or delete. Like hosting sites since 0.3.73, an app is now owned by the account key derived from the producer's c0mpute identity. - Signer: AppRecord / the image site are signed with hosting::account_keypair, so app_id_for(owner, name) is the same on every machine. `--key auto|account|machine` picks the key; an app already deployed under a machine key keeps its id and that machine's control until `apps deploy --move`. - Owner-only calls: the CLI joins the network as the account key (NetworkConfig::with_keypair, Supervisor::boot_with_keypair), so a holder's `peer == owner_peer()` check for sealed secrets and logs holds from any machine. Nothing changes on holders or on the wire. - Owner state: the app key is derived from the identity per app name (HKDF `c0mpute-apps-app-key-v1` + name) instead of living in one machine's file. Secret env stays per machine and sealed on holders; a first deploy from a machine with none set, of an app running with some, is refused. - destroy and logs resolve the app id from the name and fetch the record from the network when this machine never deployed the app. - --move deploys under the account key (new app id), carries the secret env, deletes the machine-owned app once the new one answers, and leaves a stateful one running (state does not move between app ids). Co-Authored-By: Claude Fable 5.2 <[email protected]>
ThreatCrush Security Scan26 finding(s) HIGH/CRITICAL: 2 | MEDIUM: 20 | LOW: 4
Snippets are redacted; ThreatCrush never prints matched credential material. |
ralyodio
added a commit
that referenced
this pull request
Nov 25, 2026
…ke and relay table (#494), stale app error fix scripts/bump-version.sh 0.3.113, plus the workspace crate versions in Cargo.lock. Co-Authored-By: Claude Fable 5.2 <[email protected]>
ralyodio
added a commit
that referenced
this pull request
Nov 25, 2026
…again; bump v0.3.113 (#498) * fix(apps): clear the "stopped for disk" error once the app runs again (#394) stop_for_disk records why a node stopped an app in Local.error, which is persisted and returned by /apps/v1/apps. Nothing ever cleared it, so after the disk recovered and the app restarted the status API kept saying "stopped at ...: this node's docker disk is down to 18 GiB free" next to healthy: true. Seen live on gateway.c0mpute.com on 2026-11-25: four apps up and answering 200, all four still carrying the error from the previous evening. Clear it when the container starts successfully as primary. Refs #394 (product surface must reflect verified live state). Co-Authored-By: Claude Fable 5.2 <[email protected]> * bump v0.3.113: apps owned by the account key (#495), Scallion handshake and relay table (#494), stale app error fix scripts/bump-version.sh 0.3.113, plus the workspace crate versions in Cargo.lock. Co-Authored-By: Claude Fable 5.2 <[email protected]> --------- Co-authored-by: Claude Fable 5.2 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #375.
Apps were signed by the deploying machine's buyer key, so only that machine could redeploy an app, read its logs or delete it. Like hosting sites since v0.3.73, an app is now owned by the account key derived from the producer's c0mpute identity (
chat.key), so--name apiis the same app from every machine that holds the identity.The three blockers
AppRecord(and the image site) are signed withhosting::account_keypair(HKDFc0mpute-hosting-owner-v1, the helper hosting already uses), soapp_id_for(owner, name)is the same everywhere. Newapps::ownermodule picks the key:--key auto|account|machineonapps deploy,logs,destroy.autokeeps the owner of an app deployed from this machine, else the account key, else (no identity, or no way to unlock it) this machine's key with a note. An app is never silently forked under a second key.NetworkConfig::with_keypair,Supervisor::boot_with_keypair; the key is never written to disk). The holder checks (open_seal,LogsHandler: connecting peer ==rec.owner_peer()) are untouched and now pass from any machine.ChatKey::derive_subkey, HKDF infoc0mpute-apps-app-key-v1+\n+ name), so any machine rebuilds it. Secret env values stay on the machine they were set on (<data_dir>/apps/owner/<name>.json) and sealed on the holders; they are set again wherever you deploy from.destroyandlogswork on a machine that never deployed the app: the id comes from the name, anddestroyfetches the record to tombstone from the network.Compatibility
autosees the machine-owned record in the owner file and signs with the machine key (no identity asked for); logs and destroy join as the machine's buyer identity as before.apps deploy --move(on the machine that owns the app) deploys it under the account key and carries the secret env over. The id comes from the owner key, so the app id changes once (repointTXT _c0mpute-app.<domain>, and[apps] ownersallowlists need the new owner key, which the move prints). An app withoutstateis replaced: the old one is tombstoned once the new one answers. State does not move (snapshots belong to an app id and its key): a stateful app starts empty under the new id and the old one is left running, to be removed withapps destroy <name> --key machine --yesonce the data is copied. Its owner file is kept as<name>.machine.jsonuntil then.Things a reviewer or operator should know
apps deploy --key,apps deploy --move,apps logs --key,apps destroy --key; MCPapps_deploytakeskeyandmove,apps_destroytakeskey.C0MPUTE_DM_PASSWORDwithout one (git pushdeploys,c0mpute apps mcp, CI). With an identity present but locked and no app deployed from the machine yet,autofalls back to the machine key with a note, as hosting does.<data_dir>/apps/account-node.apps status <name>on a machine that never deployed the app resolves the id through the account key (asks for the identity password).c0mpute-net:NetworkConfiggained an optionalkeypairfield (defaultNone: unchanged behaviour).Out of scope
The last paragraph of the issue (the c0mpute.com cloud node signs every account's pushes with one shared key,
apps/web/src/lib/chat/push.ts) is custodial by nature and is not changed here; docs/apps.md says so.Tests
apps::owner: derivation determinism (owner, app id, peer id, app key the same for one identity; distinct per identity and per app name; app key label distinct from the account and storage labels), the owner-peer check (an account-signed record names the account peer, not the machine's or another identity's), legacy id retention (a machine-owned app keeps its id and needs no identity), the move path, no forking under another key, owner calls from a machine that never deployed.apps::deploy: same sealed secrets on every machine for an account app, a machine-owned app keeps its stored key, a move carries the secret env under the derived key, a first deploy from another machine never drops live secrets.tests/apps_account_owner_e2e.rs(loopback libp2p, fake docker): a record signed with the account key on "machine A" and carried by another node; "machine B" with the same identity and no app state joins as the account key, the unchanged holders accept its sealed secrets and answer its log request, and a machine-key peer is refused the logs.🤖 Generated with Claude Code