Repository navigation
Installer and CLI: the engine license key (#474, I1) - #489
Draft
teaspoonai wants to merge 99 commits into
Draft
teaspoonai wants to merge 99 commits into
teaspoonai wants to merge 99 commits into
Conversation
Moves bucket(), d1() and manifest() out of index.test.mjs into worker/test/fakes.mjs (not a *.test.mjs, so the test glob skips it), for the license tests that follow. No test changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
POST /api/license signs license.json ({payload, signature}) per the design's
wire format: payload v=2, an SSHSIG blob (namespace teaport-license, sha512)
over JCS(payload), made with WebCrypto Ed25519 (src/sshsig.js).
- {acceptance_id, device}: a personal key for a year, with the acceptance id
the installer's receipt holds, checked as /api/token checks it. Licensed
acceptances are refused (licensed_use). At most 3 devices per normalized
email hold an unexpired, unrevoked personal key (device_cap); a device
asking again gets the same license_id, so it never counts twice.
- {maker_id, device}: the appliance key of a live maker acceptance, no
expiry; one per maker acceptance (a unique index), the same device gets it
signed again, another is refused (maker_device).
- {license_id, device}: a renewal keeping the license_id. Personal: another
year (keeping its engine_major), the cap again. Appliance: the same terms
under the current key, past MAKER_MAX_DAYS too.
LICENSE_SIGNING_KEY (secret, PKCS#8 PEM) signs only if it is the key that
LICENSE_PUBKEY (var, OpenSSH line labelled LICENSE_KID) names; otherwise 503
license_unavailable and nothing is read or written. LICENSE_PUBKEY ships
empty, so this deploys before the key exists.
Migration 0004 is additive: the licenses table, and an index on
acceptances' normalized email for the cap. The retention cron deletes a
personal key's row RETENTION_DAYS after it expired; appliance rows stay.
Tests cover each path, the cap, the 503 cases, the migration, and interop
with ssh-keygen -Y verify / -Y sign.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
packaging/RELEASING.md, "Worker secrets": LICENSE_SIGNING_KEY. The owner makes it with openssl in their own terminal and keeps it in Bitwarden; the OpenSSH public line for LICENSE_PUBKEY and engine/license_keys/prod.pub is built from the raw key (ssh-keygen -y cannot read openssl's PKCS#8 file). The commands were run with a throwaway key, in zsh and bash, and the line verifies the Worker's signatures under ssh-keygen -Y verify. Then secret put, shred; what a leak exposes; rotation; rollbacks. docs/engine-license-data.md: the licenses table (ids only, no email; the link to the acceptance or maker record; tpdev2), the key file on the box, retention (a personal key's row 7 years after it expired; appliance rows kept), access and erasure. The retention period is no longer a proposal: the owner confirmed 7 years. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review fixes for POST /api/license. - A revoked personal key stays revoked: its device gets 403 revoked on the acceptance path and on renewal, under any acceptance of the same email. Revoking an acceptance revokes the personal keys last issued under it: no renewal, no cap slot, and accepting again does not bring them back. - Freeing a slot is a new column, released_at (0004 is not deployed yet): a released key no longer counts or renews (403 released), and its device may get a new key. - The cap and the one-key-per-device rule are one INSERT ... SELECT ... WHERE NOT EXISTS (...) AND (count) < 3, and a renewal one conditional UPDATE: written first, signed after, checked by meta.changes. Requests at the same moment no longer pass the cap or give a device two keys. - The cap's statements start from acceptances_email_norm, then licenses_acceptance, by INDEXED BY and CROSS JOIN: D1 keeps no planner statistics, and without them SQLite picked licenses_expires (every live personal key). They are exported as LICENSE_SQL, and the tests check EXPLAIN QUERY PLAN on those strings over 500 keys without ANALYZE. - The rate-limit test now checks that neither the body, D1 nor R2 is read. - The D1 fake's run() returns meta.changes, as D1's does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eptance (#474) docs/engine-license-data.md: released_at; a revocation sticks, and an acceptance's revocation reaches its keys; an appliance key goes to the first device asking with a live maker id (design §6). A key's row can outlive its acceptance by up to 8 years, so access and erasure also find rows by device, and erasure deletes a person's license rows with their acceptances. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Second review fixes for POST /api/license. - R1: revoking a key is the device's. A device holding a revoked, unreleased personal key gets none under any email address: the new-key INSERT and the renewal UPDATE refuse it in the same statement, by licenses_device (INDEXED BY, as the others; without it SQLite picked licenses_expires). Releasing the row lifts it. - R2: revoked keys, and keys of a revoked acceptance, count toward the email's 3-device cap until they expire; only released keys stop counting. Accepting again starts no new cap. - A write refused for a reason gone by the re-read (a row released or deleted meanwhile) is tried again, up to 3 times, then 409 conflict; a renewal whose row is gone is 404 unknown_license, not device_cap. - A comment: an index named by INDEXED BY that is missing fails to prepare, a 500 with nothing written (fail closed). Tests: the revoked-device and revoked-acceptance tests follow the new rules, a retry/conflict test, and the plan test covers the device check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/engine-license-data.md: a revoked key bars its device under any email address until released; revoking an acceptance blocks the person under that address; revoked keys count toward the cap until they expire. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R3: the device check looked at personal keys only, so a box whose appliance (or commercial) key was revoked got a personal key under a new acceptance: a stolen appliance could switch tiers. The check now takes any revoked, unreleased row on the device, whatever its tier; the plan stays on licenses_device (the plan test unchanged). Releasing the row lifts the bar. Tests: a revoked appliance key and a revoked commercial row bar a personal key on their device, under any email, until released; an unrevoked appliance key bars nothing. Docs and the migration's comments say "revoking a key bars the device", any tier. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A device holding any revoked, unreleased row now gets no new key and no renewal of any tier. The appliance path checks it in its own statements: the INSERT OR IGNORE of a new appliance key becomes INSERT ... SELECT ... WHERE NOT EXISTS (revoked row on the device), and signing an appliance key again (asked again, or renewed) is a conditional UPDATE, written first and signed after, as the personal keys are. Both are in LICENSE_SQL and the plan test (licenses_device, by INDEXED BY). A box back at the factory after a revocation is released by staff first. Tests: a device with a revoked personal key gets no new appliance key, no repeat and no renewal of the one it has; releasing the row lifts it. Docs and the migration's comments say so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… its key (#474) The owner's two decisions. (a) A personal renewal ({license_id, device}) whose acceptance is not of the channel's current license gets 409 eula_changed, the same body as the acceptance path (one helper, eulaRefusal, for both), and nothing is written. The box keeps its key to expiry plus the engine's grace while teaport has the license accepted again; that acceptance renews the same key. Appliance renewals are not tied to a license version. (b) {maker_id, device} for a live maker acceptance with no key yet, from a device holding a live appliance key under an older maker acceptance, moves that key: same license_id, maker_id updated, signed again. One UPDATE OR IGNORE (applianceMove, by licenses_device): of records racing, the newest ends up with it, a key never moves back to an older record (409 maker_superseded), the unique index on maker_id holds, and the revoked-device bar applies. A new appliance key is inserted only for a device with no live one. A maker record past its retention counts as older. Tests: the 409 on renewal (same body, nothing written, appliance unaffected, re-acceptance renews); the move, its limits (released, revoked, the device bar, a deleted old record); a race of five newer records both ways round; the plan test covers applianceMove. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…474) docs/engine-license-data.md and packaging/RELEASING.md: a personal renewal answers 409 eula_changed after a license change (the box keeps its key to expiry plus the 30-day grace, teaport asks again, and the new acceptance renews the same key; appliance keys unaffected); a box provisioned again keeps its appliance key, which moves to the newest maker acceptance; staff release a revoked row before re-provisioning. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R5: applianceMove checked only that the new maker record was newer. With a leaked FACTORY_TOKEN and a box's tpdev2, a made-up record for another serial could take the box's key, and revoking that record in the leak's cleanup would then stop the real box's renewals. The move now also needs the new record's device_id (the serial's hash) to equal the old record's, while that one exists (an old record deleted by retention still counts as the box's). Otherwise nothing moves and nothing is written: 403 maker_serial (a new applianceHeld statement says why, so a newer record of the same box stays 409 maker_superseded). A swapped module or serial needs staff to release the old key; documented in docs/engine-license-data.md and packaging/RELEASING.md. Tests: another serial's newer record is refused, the key stays, the real box still renews after that record is revoked, a same-serial record still moves it, and a swapped serial gets a new key once the old one is released; one new record asked from two boxes moves only its own box's key, in order and at once. The plan test covers applianceHeld. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…up (#474) packaging/RELEASING.md, FACTORY_TOKEN: a leak also mints appliance license keys (up to FACTORY_DAILY_MAX a day, for any tpdev2 with no live appliance key and no revoked row, never expiring), a made-up record for a box's own (guessable) serial can take its key, and any record can once the box's old record is gone. The cleanup is now ordered, with the exact D1 commands for the owner (--remote; not run here): list the suspect records, then their keys; revoke the made-up boxes' keys (they reach the field only through the W2 revocation list); give real boxes' keys back to their own records, or unlink or release them; check none is left; only then revoke the maker acceptances. The SQL was run in local D1 against a leak scenario. docs/engine-license-data.md points to it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eys by evidence (#474) The review ran 08aa2ef's runbook against a leak: it revoked a real box's key and left made-up keys live. Now, in packaging/RELEASING.md: - Order: rotate the secret, then revoke the suspect maker acceptances before touching any key. The Worker already refuses mint, move and renewal under a revoked one, so that stops the leak's records at once. Then sort their keys, revoke the made-up ones, give the real ones back, and check none is left live (not 0: go again from step 2). - Real vs made-up: real only if the key predates the leak (a key the record took) or its device is the tpdev2 the same serial's box held a key for before the leak. A sold serial is no evidence. Revoking and giving back are each one statement on that rule, with no hand-made lists; a real key whose own record is gone or holds another key is unlinked (maker_id NULL, it keeps renewing), never released. - IP: COALESCE(ip, '') NOT IN (<every factory address>, IPv6 too), checked against the station's provisioning log. - Time: <LEAK_START> in the stored form with milliseconds (2026-12-01T00:00:00.000Z); the shorter form misses the first second. The SQL sits between leak-runbook markers, read by the test that follows; it was also run in local D1. docs/engine-license-data.md states the order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
worker/test/leak-runbook.test.mjs reads the runbook's SQL from between its markers in packaging/RELEASING.md and runs it, in order, on the fake D1 after a leak whose keys the Worker issued: real boxes A (key taken by a same-serial record), B, C (built during the leak, IPv6 factory address), D (released, then re-keyed on its own hardware), E (record past retention, key taken); made-up ones in the leak's first second, on attacker hardware, and under a sold serial. Between the record revocation and the rest, the attacker's mint, move and renewal are refused. Every real key ends live, under its own record (or unlinked) and renewing; every made-up key is revoked; the check prints 0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
licenses.first_maker_id (edited into 0004, not yet deployed): the maker acceptance an appliance key was first issued under, set by the insert and never changed by a move (maker_id is where it is now). A leak's cleanup sorts keys by it: a real box built during the leak, whose key a same-serial record took, was otherwise sorted made-up. Tests: set on issue, kept across a move. docs/engine-license-data.md lists the column. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…_START (#474) Eighth review of the leak runbook (packaging/RELEASING.md): - A key under a suspect record is real if made before <LEAK_START>, or first issued under a record that is not suspect (first_maker_id), or bound to the tpdev2 that serial's box held a key for before the leak. A key minted under one made-up record and moved to another stays made-up. Steps 3, 4 and 5 use that rule. - Step 1 also lists every record the leaked secret (its mark, from <KNOWN_RECORD>) made before <LEAK_START>, with whether it came from a factory address: one missing from the station's log means the secret was out earlier; move <LEAK_START> back and start again (a late one finds nothing, and the check would still print 0). worker/test/leak-runbook.test.mjs, now three tests: the check run before the cleanup prints more than 0; the full run, with a real box built during the leak whose key was taken (G) and a chain mint-and-move, ends with every real key live under its own record and every made-up one revoked; a run without step 4 gives no made-up key a record; a late LEAK_START shows in step 1's second list and an earlier one cleans up. Mutants killed: an always-0 check, step 5's move and unlink without the real-keys filter, the sort without first_maker_id. The SQL also ran in local D1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ninth review: since the key move (813fe05), a box provisioned again left its old record R1 holding nothing, so applianceInsert let R1 mint a second, perpetual appliance key for any hardware, with no FACTORY_TOKEN: R1's id is in the box's old receipt. The leak runbook never sees it, R1 being a real factory record. Migration 0004 (not deployed) adds license_makers (maker_id PRIMARY KEY, license_id, at): every maker acceptance that ever held an appliance key, written by triggers on licenses (AFTER INSERT, and AFTER UPDATE OF maker_id to a new non-NULL one) in the same statement as the key's write; insert-only, kept for good. applianceInsert and applianceMove refuse a record found there (NOT EXISTS, by its primary key), and the refusal is 403 maker_spent. A record that got its key by a move and lost it again (R2 -> R3) is spent too; a released box's next key comes under its next record. D1 applies the triggers and runs them (checked in local D1). Tests: a superseded record gets no key for other hardware, after one move and after two; the history follows the moves and outlives the maker acceptance; the plan test checks the lookup uses license_makers' primary key. The leak runbook tests pass unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/engine-license-data.md: the license_makers table, kept for good (ids only; it must outlive the maker acceptances it names), and why a maker acceptance that ever held a key gets no other. packaging/ RELEASING.md: provisioning a box again spends its old record. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…#474) The cited acceptance lines are unchanged (hash 290d30f9); only their line numbers moved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ease Release manifests (stable.json, beta.json) and the bootstrap are signed offline with ssh-keygen -Y (keys release-main and release-backup; namespaces teaport-manifest and teaport-bootstrap). install.sh, teaport update and the brain's daily check verify the .sig before reading anything from the manifest, against /usr/lib/teaport/allowed_signers from the brain package (the checkout's manifest/allowed_signers on a first install). - The manifest names its channel, pins brain.commit, and has a sha256 for every artifact. Release candidates (brain-vX.Y.Z-rcN, .deb X.Y.Z~rcN) are allowed on beta only. A commit under a tag that isn't a release tag is refused and not offered. - manifest/check.py: measured against the last uploaded commit (manifest/last_upload.py). A strict .deb reader cross-checked byte for byte against dpkg-deb, with entry, control, Depends and conffiles rules. The factory signing helper carries the same reader. - release-deb.yml builds the release .deb from a tag only. build-deb.sh pins setuptools by hash and uses only hash-checked uv and nfpm. - The license gate's access block is under the signature: ACCESS_PROTOCOL=1, and https on the download host. DL_CHECK_TOKEN moves to the gate-check environment. - packaging/RELEASING.md: signing, the release keys, what it does not cover, the turn-on runbook. The settings are in "GitHub settings". The keys are placeholders until the turn-on (a draft until then). Squashed from feat/manifest-signing (42 commits and two merges of main), rebased onto main 5d3ccea. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eys (#474) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the license (#474) As teaport#482 does for acceptances and downloads, for the v2.0 privacy policy: the licenses rows are kept on an erasure request (Art. 6(1)(b) while the license is in force, then Art. 17(3)(e) until their retention), and used for nothing else; the request changes nothing about the license. Ending the license is a separate request: revoked_at on the acceptances, released_at on the personal keys, an appliance's owner unlinked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
) The box's owner accepts the license at setup, and their acceptance is linked to the box's appliance key. license.json holds no secret and the box's agent can read it, so the link needs proof that the box asks: a per-box secret the Worker mints with the key's first issue (and again on a move to a newer maker record), answered once as link_secret beside the document and kept only as its SHA-256 (migration 0005, additive). A repeat request for the same record gets no secret: its maker id is in the box's receipt, which the agent can read. POST /api/license/link {acceptance_id, license_id, device, link_secret} sets licenses.acceptance_id for an unrevoked, unreleased appliance key on that device whose secret matches (constant time, checked before anything about the acceptance is told), for an acceptance on record, not revoked and of the current license. The same acceptance again is a no-op; another moves it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…465) license_accept.py records the owner's acceptance with method tty (the CHECK of acceptances.method takes tty or flag only), installer setup:git:<rev>, the appliance serial's hash as device_id, and licensed use under the box's appliance key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…#465) license_accept.py (root, behind sudo) takes the owner's email and the SHA-256 of the text the page showed, never an acceptance id. It makes POST /api/accept itself and records the returned id in install.sh's own receipt, /var/lib/teaport/eula-accepted.json ("method": "setup"), so later runs get tokens from it. Offline it queues the email in a root-owned /var/lib/teaport/eula-queued.json and sends it once online. It works only while provisioning's marker /var/lib/teaport-owner/license-pending is there, and once: a recorded or queued acceptance is never replaced. Device id: the appliance serial's hash on a factory box, the machine id's elsewhere. license_link.py (root) takes nothing: it reads the record, license.json and /etc/teaport/license-link.secret (root 0600) and calls POST /api/license/link. For the run user only while setup is unfinished: the Settings session cannot be verified (its key is in brain.env, which the run user reads); root and an administrator through sudo may always. A link removes the marker; a re-link of the same acceptance sends nothing; no secret file: logged, nothing done. teaport-license-owner.timer (enabled by the package) runs both as root after boot and every 15 minutes, only while a queue or the marker is there. sudoers-sync writes a line for each helper (NOLOG_INPUT for the email). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…les (#474 F1) config_apply, wifi_apply, login_apply and update_apply (and the two license helpers) carry the same PROTECTED tuple: /etc/teaport/license.json, license-revocations.json and license-link.secret. Every write, rename or removal they make refuses one of them, by name or through a link, even if their own allowlist came to name it. A test per helper. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The setup page (every first-boot path: spoken, the audio kit's room mic, headless #457 start the same teaport-wifi-setup unit) shows the whole license text, the owner's email and a box to tick while setup is unfinished. Required: the join waits for it, as setup finishes only once it is accepted; offline the acceptance is queued and the join goes on. With no copy of the text on the box and no internet, the page says it comes in Settings. Settings has the same card (GET/POST /api/eula), above the login's. Only setup waits: the engine runs under the box's appliance key. Words in all 13 catalogs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…setup (#465) The factory branch of eula_gate accepts nothing, but keeps the manifest's license text, checked against its SHA-256, as $STATE/EULA-v<version>.txt: the setup page has no internet to fetch it. Best effort. A setup receipt ("method": "setup") gets tokens like an installer's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tpriv without engine.env (#474 I1 review) - Every fetched or renewed key is staged and checked with voxtral --license-status --license-file as the engine's user: one the engine refuses never replaces a key it accepts (kept_valid, said loudly); with no valid key held it goes in unverified (before the key ceremony). - A held key for another device is kept while the engine accepts it here (a misread GPU takes no device slot); a new device is asked for only when the engine refuses the held key and the id reads the same twice. - A symbolic link at license.json is a key installed by hand: never replaced. - The factory binding (maker_id, secret_for, secret_sha256) is recorded in license-key.json (now root's 0600) before the secret is written, kept across every outcome, and the status is written inside the lock: a failed day, a crash between the writes or the timer racing install.sh no longer turn the record's re-ask into FATAL. license-key-status.json (0644) is the same without the binding, for status and doctor. - /usr/bin/setpriv by its path with TOOL_ENV alone; engine.env's values only after the switch, as /usr/bin/env -i's arguments. - check --file: install's check alone, nothing written (exit 5: this engine cannot check). - The owner link after a factory first issue, which could never fire, is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…es anything (#474 I1 review) A full run and --only engine check the file with the installed engine before the manifest is fetched; with no engine yet (or one before license keys) with the downloaded one, right after phase_engine and before anything is configured. A refused file stops the run with nothing changed. The header says how TEAPORT_LICENSE_MODE behaves under --only engine and --only license. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ked license.json (#474 I1 review) They read license-key-status.json; kept_valid is said under the license line and warned by doctor, as is a license.json that is a symbolic link (never renewed). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ned (#474 I1 review) teaport-license-renew and teaport-license-owner get ProtectSystem=strict with ReadWritePaths for the directories they write, ProtectHome, PrivateTmp and NoNewPrivileges (no PrivateDevices: the engine reads the GPU). RELEASING.md's I1 notes: the binding, kept_valid, no owner link from I1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… before a run changes anything, the hardened renewal (#474 I1 review) installer.md: kept_valid, the device-id misread, the symlink, --license-file checked first, both state files and their modes, TEAPORT_LICENSE_MODE under --only engine and --only license, the timer started at install. cli.md, security.md (setpriv without engine.env, the unit's sandbox), troubleshooting.md and engine-license-data.md to match. Citations moved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n is FATAL; the engine's user by Python's own switch (#474 I1 review 2) - check --file stages in a directory of its own in the state directory (root's, 0750 to the engine's group), so a fresh install's check, before anything has made /etc/teaport, works and leaves /etc as it was. - A binding or a link secret that cannot be written after the server minted it is FATAL (exit 3, provision the box again), not failed. - run_tool switches to the engine's user with subprocess's user, group and extra_groups (os.getgrouplist: initgroups' groups, as setpriv --init-groups gave): engine.env reaches the engine through execve's environment alone, never a root process's environment or any argv. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…g is configured (#474 I1 review 2) When phase_engine changed the binary (a full run, or --only engine's staged one), the check the old engine passed is done again with the new one. Tests: the real check chain on a fresh box with no /etc/teaport. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… I1 review 2) engine_license_status hands them to python on stdin, which runs the engine with them as its environment alone, as its user from root (subprocess's own switch, the user's groups): no env -i or setpriv argv holds them. Docs and the renewal unit's comment say it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lean-up never masks its exit (#474 I1 review 3) The try opens right after mkdtemp, so a failing chmod, chown or stage removes the directory too; the finally uses rmtree(ignore_errors) and a best-effort unlink, so a refusal stays exit 2. A directory a killed run left is swept at the next check, under the lock every check holds while its directory exists. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deploying teaport-docs with
|
| Latest commit: |
ecb4945
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://aa5b494c.teaport-docs.pages.dev |
| Branch Preview URL: | https://feat-installer-license-474.teaport-docs.pages.dev |
# Conflicts: # docs/engine-license-data.md # docs/src/content/docs/reference/licenses.md
…ccept-465 Conflicts were citation lines only: O1's side kept, sources fixed. The citations whose install.sh lines really changed (#480's --install-agent, user_manager and the voice-only hint) now cite main's ranges, moved to the merged install.sh, whose claims are #480's own and still hold: installation.md (the agent option, the voice-only hint), troubleshooting (linger), updating (the channel), installer.md (the parser, the options table, the overrides table). No #480 wording dropped: each page's prose matches origin/main's apart from O1's own sections. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nto the installer license branch install.sh keeps both sides: I1's license-key paragraph, TEAPORT_LICENSE_FILE / TEAPORT_LICENSE_MODE and their checks beside #480's agent paragraph, TEAPORT_INSTALL_AGENT / --install-agent and its checks (--install-agent is refused with any --only, --only license included). ci.yml keeps #475's signed-manifest dry run and composite-action layout, with #480's --install-agent dry-run step reading the checkout's manifest the same way, and one more refusal checked: --only license --install-agent. Docs: the flags paragraph names both sides' usage errors; elsewhere I1's text with both sides' citations to be moved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the merged install.sh The six that moved past --fix-sources: the voice-only note and the linger cause (#480's lines, which say --install-agent now), the parser, the flags and the env tables (which gained --install-agent and TEAPORT_INSTALL_AGENT), and the channel paragraph. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…474 I1) test_install_license_key.py runs under appliance.run_tests: a pytest.skip where user namespaces are unavailable (GitHub's runners) ended the script as a failure. It raises appliance.Unavailable, so the other cases run and the script reports the skip. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ease Release manifests (stable.json, beta.json) and the bootstrap are signed offline with ssh-keygen -Y (keys release-main and release-backup; namespaces teaport-manifest and teaport-bootstrap). install.sh, teaport update and the brain's daily check verify the .sig before reading anything from the manifest, against /usr/lib/teaport/allowed_signers from the brain package (the checkout's manifest/allowed_signers on a first install). - The manifest names its channel, pins brain.commit, and has a sha256 for every artifact. Release candidates (brain-vX.Y.Z-rcN, .deb X.Y.Z~rcN) are allowed on beta only. A commit under a tag that isn't a release tag is refused and not offered. - manifest/check.py: measured against the last uploaded commit (manifest/last_upload.py). A strict .deb reader cross-checked byte for byte against dpkg-deb, with entry, control, Depends and conffiles rules. The factory signing helper carries the same reader. - release-deb.yml builds the release .deb from a tag only. build-deb.sh pins setuptools by hash and uses only hash-checked uv and nfpm. - The license gate's access block is under the signature: ACCESS_PROTOCOL=1, and https on the download host. DL_CHECK_TOKEN moves to the gate-check environment. - packaging/RELEASING.md: signing, the release keys, what it does not cover, the turn-on runbook. The settings are in "GitHub settings". The keys are placeholders until the turn-on (a draft until then). Squashed from feat/manifest-signing (42 commits and two merges of main), rebased onto main 5d3ccea. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eys (#474) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GITHUB_TOKEN is now ghs_ plus a JWT, about 520 characters and variable (GitHub's stateless installation tokens, rolled out by October 2026), so the 255-character cap refused it and every publish run's base step failed with "GITHUB_TOKEN is not a token". Keep the character check, raise the cap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The install-agent code moved install.sh's lines; every cited block is the same text at its new lines (hashes unchanged). The installer reference's environment-variable item now cites TEAPORT_INSTALL_AGENT as well. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GITHUB_TOKEN is now ghs_ plus a JWT, about 520 characters and variable (GitHub's stateless installation tokens, rolled out by October 2026), so the 255-character cap refused it and every publish run's base step failed with "GITHUB_TOKEN is not a token". Keep the character check, raise the cap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit be2c065)
#475 was rebased onto main bd7a766. This branch already held its content (old head e4ed6c6 plus bd7a766), and the token fix be2c065 was cherry-picked just before. The rebase's ci.yml --install-agent resolution is equivalent to this branch's (it exports TEAPORT_MANIFEST_UNSIGNED before the first dry-run). The docs re-cite is redone by the lint after main is merged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ease Release manifests (stable.json, beta.json) and the bootstrap are signed offline with ssh-keygen -Y (keys release-main and release-backup; namespaces teaport-manifest and teaport-bootstrap). install.sh, teaport update and the brain's daily check verify the .sig before reading anything from the manifest, against /usr/lib/teaport/allowed_signers from the brain package (the checkout's manifest/allowed_signers on a first install). - The manifest names its channel, pins brain.commit, and has a sha256 for every artifact. Release candidates (brain-vX.Y.Z-rcN, .deb X.Y.Z~rcN) are allowed on beta only. A commit under a tag that isn't a release tag is refused and not offered. - manifest/check.py: measured against the last uploaded commit (manifest/last_upload.py). A strict .deb reader cross-checked byte for byte against dpkg-deb, with entry, control, Depends and conffiles rules. The factory signing helper carries the same reader. - release-deb.yml builds the release .deb from a tag only. build-deb.sh pins setuptools by hash and uses only hash-checked uv and nfpm. - The license gate's access block is under the signature: ACCESS_PROTOCOL=1, and https on the download host. DL_CHECK_TOKEN moves to the gate-check environment. - packaging/RELEASING.md: signing, the release keys, what it does not cover, the turn-on runbook. The settings are in "GitHub settings". The keys are placeholders until the turn-on (a draft until then). Squashed from feat/manifest-signing (42 commits and two merges of main), rebased onto main 5d3ccea. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eys (#474) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GITHUB_TOKEN is now ghs_ plus a JWT, about 520 characters and variable (GitHub's stateless installation tokens, rolled out by October 2026), so the 255-character cap refused it and every publish run's base step failed with "GITHUB_TOKEN is not a token". Keep the character check, raise the cap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> # Conflicts: # cli/teaport # docs/src/content/docs/getting-started/installation.md # docs/src/content/docs/guides/configuration.md # docs/src/content/docs/guides/discord-bridge.md # docs/src/content/docs/guides/faq.md # docs/src/content/docs/guides/local-audio.md # docs/src/content/docs/guides/phone-calls.md # docs/src/content/docs/guides/troubleshooting.md # docs/src/content/docs/guides/updating.md # docs/src/content/docs/guides/wifi-setup.md # docs/src/content/docs/index.mdx # docs/src/content/docs/reference/architecture.md # docs/src/content/docs/reference/cli.md # docs/src/content/docs/reference/installer.md # docs/src/content/docs/reference/licenses.md # docs/src/content/docs/reference/security.md # docs/src/content/docs/reference/settings.md
The paragraphs match main's; #490 changed the code they cite (cmd_doctor's gateway token and listen checks, config_ui's on-box rule, the schema's help), and main re-cited them. Same ranges here, mapped onto this branch's files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Same content as a64dd4a (merged before): range-diff shows the RELEASING and token-fix commits unchanged and the signing commit differing only in its docs citations. A trial merge's conflicts hold no #475 line missing here except the ones this branch replaced on purpose (the helper list, RELEASING's watch list, the --install-agent step's export form). The re-cite a6d3384 is for #475's tree; this branch's citations lint clean. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Part of #474 (Engine License Key), step I1: the installer and CLI side. Closes the work of the old draft #291 (license format v1), which this supersedes.
Draft. Merges after #475 (release signing), #481 (W1) and #488 (O1). This branch is #475 at e4ed6c6 with #488 merged in, plus I1. Until those three land, GitHub's diff shows their changes too.
I1's own commits are
331b7b22..ecb49457(from cfef902; a6652ed holds the merge fixes). The merge commits are 7cf02ea and 79140b8.What it adds
brain/teaport_brain/license_key.py: the root helper that asks for, renews and installs the engine's license key. No sudoers line names it.install.shasks after the engine download;--only engineasks with the binary that will run;--only licensedoes only this step;teaport-license-renew.timer(started by postinst) and everyteaport updaterenew.{acceptance_id, device}for a personal key;{maker_id, device}at the factory;{license_id, device}to renew.{payload, signature}goes to/etc/teaport/license.json(0640);/etc/teaport/license-link.secret(root 0600, created with that mode, atomic), written once and never on a renewal;--license-status --license-file, as the engine's user, through Python's own uid switch). A key the engine accepts is never replaced by one it refuses (kept_valid). A commercial key, or a symlinked one, is never replaced.install.sh --license-file PATH: a commercial file is checked by the engine before the run changes anything. A newly downloaded engine checks it again.TEAPORT_LICENSE_MODE: writesVOX_LICENSE_MODEonly as exactlyoff,warnoron, and exits 2 on anything else.RestartPreventExitStatus=78.teaport status/teaport doctor:VOX_LICENSE_MODE's value, parsed as systemd does;--helpis checked first).ProtectSystem=strict,ReadWritePaths,ProtectHome,PrivateTmp,NoNewPrivileges; noPrivateDevices, because the GPU is needed);tools/licenseorlicense_keysships, and brain-deb-check enforces it.Tests
test_license_key.pyalone has 64 tests;--only brain,--only engine,--only license, and with--license-file;Review: an independent review agent went through 4 passes, and the last was clear. Along the way it found and the branch fixed:
--license-filedying mid-install, and on a fresh box;Jetson bench check: done 2026-11-30 on jetson05 (Orin NX, JP7). I1's
license_key.pyran as root in a transient unit with the renewal unit's exact hardening (ProtectSystem=strict,ReadWritePaths,ProtectHome,PrivateTmp,NoNewPrivileges), using a TEST-key engine build. Results:--device-idas the engine user, sandboxed, readtpdev2-3810e309…fromgpu-uuid,dt-serial, the box's known id.checkwith a test license for this box returnedvalid, exit 0.checkwith a license for another device returnedrefused("issued for a different device"), exit 2.Not covered: the network renewal itself, because the license server is pinned and has no online key yet. Cosmetic: the refusal message repeats "this device".
Still to come: F1 (the factory seal, teaport-factory) and E2/W2 (revocation list, grace).
🤖 Generated with Claude Code