OverviewFilesCommitsIssuesDocsReleasesPeers

pgh commits / afdf4fb

pgh 0.1.121 — repo resync auto-admits via P2P doorbell (drop HTTP --admit-from)
The daemon now auto-admits the re-joined key via the hyperswarm doorbell, so `pgh repo resync <name>` just works — no owner url, no HTTP peer call. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
afdf4fb9a51bed949919fd8d8efe7b20913ffa34
by plankatron <fleeky@gmail.com> · 2026-07-20T03:02:23.000Z

Changed files (2) +10 -23

lib/commands/repo.js +9 -22
……@@ -28,10 +28,9 @@ export const usage = `pgh repo — browse repos served by the daemon
2828 Admin: grant a peer push authority
2929 pgh repo local-key <name> Print this daemon's tracker local key
3030 pgh repo revoke <name> <userId> Revoke a writer
31 pgh repo resync <name> [--admit-from <owner-url>]
32 Heal a stuck tracker: clean re-join in
33 a fresh corestore (+ auto-admit if the
34 owner url is given)`
31 pgh repo resync <name> Heal a stuck tracker: clean re-join in
32 a fresh corestore + P2P doorbell
33 auto-admission (no url)`
3534
3635export async function run (client, args) {
3736 const sub = args[0]
……@@ -190,26 +189,14 @@ export async function run (client, args) {
190189 // (repo-resync RPC → forceResync). Recovers a standalone peer whose tracker
191190 // can't reconcile a group manifest migration (crash-loops or silently freezes)
192191 // — a fresh namespace does NOT heal it (same primaryKey-derived local writer),
193 // only a fresh corestore does. The re-join is READ-ONLY until admitted; with
194 // --admit-from <owner-url> the peer auto-requests admission of its new local
195 // key from the tracker owner, who auto-approves iff this peer already holds
196 // write authority (repo-request-writer). One command = heal + participate.
192 // only a fresh corestore does. The daemon AUTO-ADMITS the re-joined key via the
193 // P2P doorbell (an optimistic request-writer op vouched by this peer's old
194 // writer key; the owner admits on apply) — no url, no HTTP, fully over
195 // hyperswarm. One command = heal + participate.
197196 if (sub === 'resync') {
198197 const name = args[1]
199 if (!name) throw new Error('usage: pgh repo resync <name> [--admit-from <owner-url>]')
200 const res = await client.call('repo-resync', { repo: name })
201 if (res && res.error) return res
202 const ai = args.indexOf('--admit-from')
203 const owner = ai !== -1 ? args[ai + 1] : null
204 if (!owner || !res || !res.localKey) return res
205 const pc = await PghPeerClient.connect({ url: owner })
206 let admission
207 try {
208 admission = await pc.call('repo-request-writer', { name, writerKey: res.localKey })
209 } finally {
210 await pc.close()
211 }
212 return { ...res, admission }
198 if (!name) throw new Error('usage: pgh repo resync <name>')
199 return client.call('repo-resync', { repo: name })
213200 }
214201
215202 if (sub === 'revoke') {
package.json +1 -1
……@@ -1,6 +1,6 @@
11{
22 "name": "pgh",
3 "version": "0.1.120",
3 "version": "0.1.121",
44 "description": "pgh — P2P content-addressed package manager and app launcher",
55 "type": "module",
66 "main": "index.js",