OverviewFilesCommitsIssuesDocsReleasesPeers

pgh commits / 94cd85d

0.1.135: add `pgh repo visibility <name> [public|private]`
Front-end for pear-git-v3's repo-visibility RPC (read-gate, forge #138). No value queries; `public`/`private` sets. Deliberately positional rather than --public/--private flags, because the two directions are NOT symmetric and a flag pair implies they are. public→private stops this peer serving the repo but cannot retract bundles already published to the overlay (#135 — additive, no GC), nor un-tell peers a discoveryKey they already hold. The daemon returns a warning saying so; it is surfaced rather than swallowed, or an operator will believe a repo was made secret when it was only unlisted. Usage text carries both caveats: best-effort, and the marker is LOCAL so it must be set on each peer. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
94cd85d374db1ac5c82e50bb657b7333a2b38cd3
by plankatron <fleeky@gmail.com> · 2026-07-31T17:56:23.000Z

Changed files (2) +28 -1

lib/commands/repo.js +27 -0
……@@ -27,6 +27,14 @@ export const usage = `pgh repo — browse repos served by the daemon
2727 pgh repo writers <name> List writers
2828 pgh repo grant-writer <name> --peer <url> [--role owner|writer]
2929 Admin: grant a peer push authority
30 pgh repo visibility <name> Show whether THIS peer serves the repo
31 pgh repo visibility <name> public Serve it (writes the export-ok marker)
32 pgh repo visibility <name> private Stop serving it here. Admin.
33 BEST-EFFORT, not a retraction: bundles
34 already published stay in the overlay
35 and peers holding the discoveryKey keep
36 it. The marker is LOCAL — run on each
37 peer.
3038 pgh repo retire <name> Tombstone a repo: stop listing/serving/
3139 re-creating it fleet-wide. Bytes are
3240 NOT removed — remove ~/git-repos/
……@@ -96,6 +104,25 @@ export async function run (client, args) {
96104 // must replicate to every peer BEFORE anyone removes bytes. See
97105 // pear-git-v3/lib/services/retired-repos.js, which never deletes anything and
98106 // is explicit that removing bytes is a manual per-peer operator action.
107 // visibility — read or set whether THIS peer serves a repo.
108 //
109 // Deliberately not `--public/--private` flags: the two directions are not
110 // symmetric. public→private stops future serving but cannot retract bundles
111 // already in the overlay, nor un-tell peers a discoveryKey. The daemon
112 // returns a warning saying so; print it rather than swallowing it, or an
113 // operator will believe a repo was made secret when it was only unlisted.
114 if (sub === 'visibility') {
115 const name = args[1]
116 const value = args[2]
117 if (!name) throw new Error('usage: pgh repo visibility <name> [public|private]')
118 if (value && value !== 'public' && value !== 'private') {
119 throw new Error("usage: pgh repo visibility <name> [public|private] — got '" + value + "'")
120 }
121 // No value → query. The marker is LOCAL, so this answers for THIS peer
122 // only; run it on each peer to see the whole picture.
123 return client.call('repo-visibility', value ? { name, visibility: value } : { name })
124 }
125
99126 if (sub === 'retire') {
100127 const name = args[1]
101128 if (!name) throw new Error('usage: pgh repo retire <name>')
package.json +1 -1
……@@ -1,6 +1,6 @@
11{
22 "name": "pgh",
3 "version": "0.1.134",
3 "version": "0.1.135",
44 "description": "pgh — P2P content-addressed package manager and app launcher",
55 "type": "module",
66 "main": "index.js",