Skip to content

Move mirror publishing into this repo (dedicated write-only deploy key) - #16

Merged
acosmi-fushihua merged 1 commit into
mainfrom
feat/publish-workflow-migration-20260817
Aug 17, 2026
Merged

acosmi-fushihua merged 1 commit into
mainfrom
feat/publish-workflow-migration-20260817

Conversation

@acosmi-fushihua

Copy link
Copy Markdown
Contributor

What

Ports the CN-mirror publisher from the private acosmi/crabcode-source repo (sync-plugins-to-mirror.yml) into this repo as publish-to-cn-mirror.yml, per the 2026-08-17 decision that plugin releases live in the plugin repo.

Publishing semantics: verbatim

Every load-bearing behavior is carried over unchanged, with its original in-file rationale:

  • zip layout contract: every entry prefixed marketplaces/crabcode-plugins-official/, exec bits preserved via real zip, and the full-quantifier self-check (every entry must carry the prefix — "at least one" can't see violations).
  • Mirror slimming: reads .crabcode-plugin/mirror-distribution.json from the same checkout the auditor reads (three-way same-source; prefixes must contain /tests/).
  • Atomicity: content zip + marketplace.json + both .sha256 sidecars land first; latest pointer switches last.
  • sha256 sidecar form: explicit printf '%s %s\n' (never platform-default sha256sum output), matching the auditor regex byte-for-byte.
  • Verification actually verifies: downloads served bytes and checks digests, pointer equality, and marketplace.json plugin count in-run.
  • Deliberately no schedule (the 2026-07-27 Actions-quota lesson): triggers are push: main + workflow_dispatch only.

What changed (repo-local only)

  • Checkout is now actions/checkout of this repo itself (no cross-repo token, guard step deleted — nothing to guard).
  • Dedicated deploy key: a new restrict,command="rrsync -wo /var/www/updates/crabcode" write-only key held in this repo's secrets (MIRROR_*, all four set), independently revocable from the enterprise CI key. Blast radius of the secret equals "malicious content merged to main gets faithfully published" — no new trust surface; fork PRs cannot read secrets. Key installed on the mirror server and live-verified: arbitrary commands are refused by rrsync (is not rsync), only rsync-write within the mirror content dir is possible.
  • notify-mirror.yml comment refresh only (no logic change): credential-location and "publisher polls on a schedule" notes described the pre-migration world. The auditor stays read-only, secret-free, and keeps resolving this repo's own ci.yml main-push runs — unaffected by the migration.

Follow-up

The enterprise sync-plugins-to-mirror.yml is retired in a separate PR on that repo once this lane's first publish is verified end-to-end. Until then both lanes coexist safely (content-addressed, idempotent).

🤖 Generated with Claude Code

…repo

The publisher previously lived in the private acosmi/crabcode-source repo
(sync-plugins-to-mirror.yml) only because the deploy credential was there.
Per the 2026-08-17 decision that plugin releases belong in the plugin repo,
this ports the publisher verbatim — zip layout contract (ARC_PREFIX on every
entry), mirror-distribution.json slimming with the three-way same-source
manifest, content-first/pointer-last atomic ordering, explicit printf sha256
sidecar form, and real digest verification against served bytes — with only
the repo-local changes: self-checkout, push:main + workflow_dispatch triggers
(deliberately no schedule), and a dedicated write-only deploy key
(restrict + rrsync -wo, independently revocable, held in this repo's secrets).

notify-mirror.yml comment refresh: the credential-location and
"publisher polls on a schedule" notes described the pre-migration world.
The audit workflow itself remains read-only and secret-free.

The retired enterprise workflow is removed in a follow-up PR over there.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@acosmi-fushihua
acosmi-fushihua merged commit 1e808be into main Aug 17, 2026
8 checks passed
@acosmi-fushihua
acosmi-fushihua deleted the feat/publish-workflow-migration-20260817 branch August 17, 2026 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant