| … | … | @@ -27,6 +27,10 @@ export const usage = `pgh repo — browse repos served by the daemon |
| 27 | 27 | pgh repo writers <name> List writers |
| 28 | 28 | pgh repo grant-writer <name> --peer <url> [--role owner|writer] |
| 29 | 29 | Admin: grant a peer push authority |
| 30 | pgh repo backfill-visibility [--dry-run] Mark EVERY existing repo public on this |
| 31 | peer. Run once per peer BEFORE enabling |
| 32 | read-gate enforcement, or every repo |
| 33 | predating the marker goes unserved. |
| 30 | 34 | pgh repo visibility <name> Show whether THIS peer serves the repo |
| 31 | 35 | pgh repo visibility <name> public Serve it (writes the export-ok marker) |
| 32 | 36 | pgh repo visibility <name> private Stop serving it here. Admin. |
| … | … | @@ -123,6 +127,17 @@ export async function run (client, args) { |
| 123 | 127 | return client.call('repo-visibility', value ? { name, visibility: value } : { name }) |
| 124 | 128 | } |
| 125 | 129 | |
| 130 | // backfill-visibility — mark every existing repo public on THIS peer. |
| 131 | // |
| 132 | // Runs daemon-side, not from a script: `pgh.stage.ignore` lists `scripts/`, |
| 133 | // so pear-git-v3's backfill script never ships to a peer installed via |
| 134 | // `pgh app install` — it would be missing on exactly the machines that must |
| 135 | // run it before enforcement. Idempotent; --dry-run reports without writing. |
| 136 | if (sub === 'backfill-visibility') { |
| 137 | const dryRun = args.includes('--dry-run') || args.includes('-n') |
| 138 | return client.call('repo-backfill-visibility', { dryRun }) |
| 139 | } |
| 140 | |
| 126 | 141 | if (sub === 'retire') { |
| 127 | 142 | const name = args[1] |
| 128 | 143 | if (!name) throw new Error('usage: pgh repo retire <name>') |