GeezerVison is showing github.com — P7.2 implement + deploy: Cloudflare Workers pkarr endpoint, under the Nix deployment standard · Issue #1829 · developing-today/code
P7.2 implement + deploy: Cloudflare Workers pkarr endpoint, under the Nix deployment standard #1829DescriptionOrigin
Implementation issue for #793, decided IMPLEMENT by Drew (2026-10-28): 'I don't think we need that, but it would be pretty cool... let's build it. Put it in the implement pile and pick it up at some point.' Gated on the deployment-standard design #1828 — this Worker is that standard's pilot and must deploy through it, not around it.
Build
Per the design note doc/2026-10-14T10-18-19Z_design_p7_2_cloudflare_workers.md: a Cloudflare Worker serving pkarr over HTTP PUT/GET and DNS-over-HTTPS. (Context: id already uses pkarr client-side via existing public relays; this is our own self-hosted door into pkarr, on our own Cloudflare account, which has Workers headroom.)
Deploy
Acceptance criteria
Activitydeveloping-today commented on Oct 28, 2026 dezren39 commented on Oct 28, 2026 Intake review
Fleet monitor intake pass (protocol §5), 2026-10-28.
- Related: gated on the deployment-standard design Deployment standard: Nix flake deploys with SOPS + vault-backed keys (pilot: pkarr Worker) #1828 (this Worker is its pilot — deploy through the standard, not around it); origin decision on id phase-7: P7.2 Cloudflare Workers pkarr — implementation and deployment are deferred with no tracking issue #793 (IMPLEMENT, Drew 2026-10-28).
- Still live: filed today; no PR or commit implements a pkarr Worker yet. Not a duplicate of Deployment standard: Nix flake deploys with SOPS + vault-backed keys (pilot: pkarr Worker) #1828 — that issue designs the standard, this one builds + deploys the pilot.
- Risks: deploying before Deployment standard: Nix flake deploys with SOPS + vault-backed keys (pilot: pkarr Worker) #1828 settles would bake in a one-off path the standard then has to unwind; Cloudflare zone choice is deferred to the Deployment standard: Nix flake deploys with SOPS + vault-backed keys (pilot: pkarr Worker) #1828 design — don't guess it at build time.
- Suggested approach: build the Worker + tests first (no deploy), hold deployment until Deployment standard: Nix flake deploys with SOPS + vault-backed keys (pilot: pkarr Worker) #1828's entrypoint exists, then deploy, run the publish→resolve round trip, and record the rollback check on this issue.
- Labels normalized: kind/feature, source/human, status/needs-triage, priority/normal, effort/m, app/id, meta/enriched. Acceptance criteria were already present in the body — no body edit.
dezren39 commented on Oct 31, 2026 Owner re-raised this in main chat 2026-10-31: the pkarr Worker pilot is wanted — deploy it using the flake standard from #1828. Status check today: #1828's design was approved by the owner 2026-10-28 (just recipe → nix run → impure secret-gathering → pure-derivation deploy binary; cf binary first, wrangler fallback; state handling deferrable), and the Workers versions/deployments research landed 2026-10-29 — rollback via the Versions API (create a deployment at a previous version ID) supersedes the original revert+redeploy-only framing for Workers. No implementation has started since; this is the live tracking issue for the pilot build + first flake deploy. dezren39 commented on Oct 31, 2026 BUILD STARTED 2026-10-31 (owner re-issued the 2026-10-28 order in main chat today). Scope: build the pkarr Worker to the Phase 7 design note in this repo; deploy via the #1828 Nix flake standard (just → nix run → secret-gathering → deploy binary; cf first, wrangler fallback; Workers Versions API for deploy/rollback); workers.dev subdomain is the first target (Lab Ops Hub pattern) — a custom zone/domain is a separate follow-up, not a blocker. Tests per the design note. dezren39 commented on Oct 31, 2026 Shipped — pkarr Worker pilot is live, deployed via the cf versions flow
Live: https://pkarr.developing-today.workers.dev (scope text at /, ok at /healthz)
What was built (pkgs/pkarr-worker/, design doc/2026-10-31T23-00-00Z_design_cloudflare_worker_deployment_standard.md)
The P7.2 Worker per the Phase 7 design note: PUT/GET /pkarr/<z32> for signed pkarr relay payloads (Ed25519-verified against the path key, well-formed DNS packet ≤1000 B, newest timestamp wins, valid-but-stale still 204 for iroh compat) and RFC 8484 DoH at /dns-query for _iroh.<z32>.<origin> TXT (out-of-zone REFUSED, in-zone non-pkarr NODATA). One SQLite Durable Object per key, alarm expiry after 7 days, per-IP rate limits on all routes. 17 vitest tests pass, tsc --noEmit clean; test payloads are signed with Node's Ed25519 so the Worker's WebCrypto verification is anchored to an independent implementation.
Deploy machinery (the #1828 standard's first slice): just deploy-pkarr → nix run .#pkarr-deploy → impure secret gathering (SOPS account id, Bitwarden token by name — cloudflare.api-token-day-to-day; nothing plaintext in repo or store) → deploy.mjs drives cf versions: upload stamped git-<sha12> + full SHA in the message → ?deployable=true pre-check → deployment at 100%. Rollback is --deploy-version <id>.
PRs (all merged)
Versions & deployments (cf, verified against the account API)
| # |
Version ID |
Tag |
State |
| 1 |
c78fb7c4-e6b3-4183-a953-bae770aad02c |
git-fdd8811ade96 |
bootstrap version |
| 2 |
b400670e-fde6-4cb8-b51e-c393321da984 |
git-297a3ac94c9b |
uploaded, never deployed (its deploy run surfaced gap 2 below) |
| 3 |
7958cca6-8ed2-43a8-af57-7ef4026d32e2 |
git-5e08e1982eb7 |
live |
Deployment history: bootstrap → v1 (23:22:13Z) · versions-flow deploy b2931205 → v3 (23:24:39Z) · rollback f7d94398 → v1 (23:25:01Z), service verified on the rolled-back version (healthz ok, previously published record still served — DO storage is version-independent) · roll forward 66768142 → v3 (23:25:34Z), current live deployment.
End-to-end verification (from outside, against the live Worker)
Test key ut7mwjd7jqpes6pip4itojmwhzhc5fkyfnpb9nk4y4xyys4asxfy — 7/7 checks passed, on both the bootstrap version and the final versions-flow version:
GET / scope text, GET /healthz ok
PUT /pkarr/<key> → 204; GET returns the payload byte-verbatim
- DoH
POST /dns-query for _iroh.<key>.pkarr.developing-today.workers.dev TXT → the published relay=https://relay.example.net
- stale-timestamp PUT → 204 but does not overwrite
- DoH out-of-zone name → REFUSED (rcode 5)
cf versions gaps found (all worked around inside the cf surface — no wrangler fallback needed)
cf workers versions create cannot create a brand-new Worker — it refuses and says to run the deploy command first. First deploy bootstraps via cf deploy with the same tag/message; the versions flow governs everything after. (Recorded in the README + design doc.)
cf workers deployments create requires --strategy percentage explicitly in non-interactive runs.
- The versions list REST shape is paginated (
result.items, and result.deployments for deployments) — the ?deployable=true pre-check reads that shape.
Environment findings: deploys run from the laptop checkout (~/git/code-deploy) because the sandbox cannot decrypt secrets/sops/common/cloudflare.yaml (laptop age key) — by design. The laptop's ~/.npmrc registry mirror rewrites lockfile URLs and lagged a tarball; the deploy now pins npm_config_replace_registry_host=false. The day-to-day token sufficed for every step; the account-wide token was never needed.
Closing this and #793: the pilot and its verification are complete. A custom zone/domain for the endpoint remains a possible follow-up, deliberately out of scope here.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|