Browse Source

Sync from gitrepublic-web monorepo - 2026-02-28 10:41:16

Nostr-Signature: 24697c9b20cb800baa1109ab2b6597ad172ed9f412ac53702ac41505f95d325b 573634b648634cbad10f2451776089ea21090d9407f715e83c577b4611ae6edc bdd7e099c4ed9729b3933eb24e9b93f82c674f04058a5bf5b1c479f2e378cbacc6ab53412235040af291115f737f82ecebd1786dc80697cf4069bc66a6b31f8e
master
Silberengel 2 weeks ago
parent
commit
b0be5dbec3
  1. 1
      nostr/commit-signatures.jsonl
  2. 45
      scripts/commands/repos.js
  3. 1
      scripts/gitrepublic.js

1
nostr/commit-signatures.jsonl

@ -5,3 +5,4 @@
{"kind":1640,"pubkey":"573634b648634cbad10f2451776089ea21090d9407f715e83c577b4611ae6edc","created_at":1772009920,"tags":[["author","Silberengel","silberengel7@protonmail.com"],["message","Sync from gitrepublic-web monorepo - 2026-02-25 09:58:40"]],"content":"Signed commit: Sync from gitrepublic-web monorepo - 2026-02-25 09:58:40","id":"f0de11d8bb0d86896321d7e57ae373fa074acffc40f67dc7274ad419b356e16c","sig":"477c0cf41131dd31fd9aa7ad656ab74e84ae17cbb10133ce14dedd8a237337382bc8f8ea6a09b621c497ec48429268223c8dd07ac85f8ba72472e94bf8d2a226"} {"kind":1640,"pubkey":"573634b648634cbad10f2451776089ea21090d9407f715e83c577b4611ae6edc","created_at":1772009920,"tags":[["author","Silberengel","silberengel7@protonmail.com"],["message","Sync from gitrepublic-web monorepo - 2026-02-25 09:58:40"]],"content":"Signed commit: Sync from gitrepublic-web monorepo - 2026-02-25 09:58:40","id":"f0de11d8bb0d86896321d7e57ae373fa074acffc40f67dc7274ad419b356e16c","sig":"477c0cf41131dd31fd9aa7ad656ab74e84ae17cbb10133ce14dedd8a237337382bc8f8ea6a09b621c497ec48429268223c8dd07ac85f8ba72472e94bf8d2a226"}
{"kind":1640,"pubkey":"573634b648634cbad10f2451776089ea21090d9407f715e83c577b4611ae6edc","created_at":1772010116,"tags":[["author","Silberengel","silberengel7@protonmail.com"],["message","Sync from gitrepublic-web monorepo - 2026-02-25 10:01:56"]],"content":"Signed commit: Sync from gitrepublic-web monorepo - 2026-02-25 10:01:56","id":"38d45ddb1bd8d67e7e271a99ac80715234472fdf10e67daeffdce5ae65d59cfe","sig":"24b793020ce8dccea12f4a724bf50e86a94f139908befef9a4c864dd619587ef2dbf27e959d72ad3a0719dc10a8f39878126db472aa669b9a7781ebdf511ec23"} {"kind":1640,"pubkey":"573634b648634cbad10f2451776089ea21090d9407f715e83c577b4611ae6edc","created_at":1772010116,"tags":[["author","Silberengel","silberengel7@protonmail.com"],["message","Sync from gitrepublic-web monorepo - 2026-02-25 10:01:56"]],"content":"Signed commit: Sync from gitrepublic-web monorepo - 2026-02-25 10:01:56","id":"38d45ddb1bd8d67e7e271a99ac80715234472fdf10e67daeffdce5ae65d59cfe","sig":"24b793020ce8dccea12f4a724bf50e86a94f139908befef9a4c864dd619587ef2dbf27e959d72ad3a0719dc10a8f39878126db472aa669b9a7781ebdf511ec23"}
{"kind":1640,"pubkey":"573634b648634cbad10f2451776089ea21090d9407f715e83c577b4611ae6edc","created_at":1772142569,"tags":[["author","Silberengel","silberengel7@protonmail.com"],["message","Sync from gitrepublic-web monorepo - 2026-02-26 22:49:28"]],"content":"Signed commit: Sync from gitrepublic-web monorepo - 2026-02-26 22:49:28","id":"4ea7d72a5505ea4ead0609e3bff9501ac46cee0313c83815f9bfde2cc229d2a8","sig":"5c0068a821242ebe8c83a4daaee0e3ccd91c1649274e6f379f5048e23997344a9eca6545b1436372d3149f7b68ba9b3f47819834b6a3a0ea94671b98de8e22f6"} {"kind":1640,"pubkey":"573634b648634cbad10f2451776089ea21090d9407f715e83c577b4611ae6edc","created_at":1772142569,"tags":[["author","Silberengel","silberengel7@protonmail.com"],["message","Sync from gitrepublic-web monorepo - 2026-02-26 22:49:28"]],"content":"Signed commit: Sync from gitrepublic-web monorepo - 2026-02-26 22:49:28","id":"4ea7d72a5505ea4ead0609e3bff9501ac46cee0313c83815f9bfde2cc229d2a8","sig":"5c0068a821242ebe8c83a4daaee0e3ccd91c1649274e6f379f5048e23997344a9eca6545b1436372d3149f7b68ba9b3f47819834b6a3a0ea94671b98de8e22f6"}
{"kind":1640,"pubkey":"573634b648634cbad10f2451776089ea21090d9407f715e83c577b4611ae6edc","created_at":1772226202,"tags":[["author","Silberengel","silberengel7@protonmail.com"],["message","Sync from gitrepublic-web monorepo - 2026-02-27 22:03:22"]],"content":"Signed commit: Sync from gitrepublic-web monorepo - 2026-02-27 22:03:22","id":"2d084347a6769a725623fa48090198544eeaf5f3085c0f741aeeb1a843c77ed4","sig":"2b9b1a22967592e7f980aedd885e86924c2bc5cb1c7b2d776fdcefac18d2745bafea25ce24e8630c3c5ad1015915e15191d95804437d2c982d55fc7c6a9071d2"}

45
scripts/commands/repos.js

@ -8,6 +8,31 @@ import { apiRequest } from '../utils/api.js';
export async function repos(args, server, json) { export async function repos(args, server, json) {
const subcommand = args[0]; const subcommand = args[0];
// Show help if no subcommand or help requested
if (!subcommand || subcommand === '--help' || subcommand === '-h') {
console.log('Repository Operations:');
console.log('');
console.log('Commands:');
console.log(' list List all repositories (registered and local)');
console.log(' get <npub> <repo> Get repository info with clone URL reachability');
console.log(' (or use naddr: get <naddr>)');
console.log(' settings <npub> <repo> Get/update repository settings');
console.log(' Use --help for options');
console.log(' maintainers <npub> <repo> [add|remove <npub>] Manage maintainers');
console.log(' branches <npub> <repo> List branches');
console.log(' tags <npub> <repo> List tags');
console.log(' fork <npub> <repo> Fork a repository');
console.log(' delete <npub> <repo> Delete a repository');
console.log(' poll Trigger repository polling (provisions new repos from Nostr)');
console.log('');
console.log('Examples:');
console.log(' gitrep repos list');
console.log(' gitrep repos get npub1abc... myrepo');
console.log(' gitrep repos poll');
console.log('');
process.exit(0);
}
if (subcommand === 'list') { if (subcommand === 'list') {
// Get registered and unregistered repos from Nostr // Get registered and unregistered repos from Nostr
const listData = await apiRequest(server, '/repos/list', 'GET'); const listData = await apiRequest(server, '/repos/list', 'GET');
@ -25,7 +50,7 @@ export async function repos(args, server, json) {
async function checkVerification(npub, repoName) { async function checkVerification(npub, repoName) {
try { try {
// The verify endpoint doesn't require authentication, so we can call it directly // The verify endpoint doesn't require authentication, so we can call it directly
const url = `${server.replace(/\/$/, '')}/api/repos/${npub}/${repoName}/verify`; const url = `${server.replace(/\/$/, '')}/api/repos/${npub}/${repoName}/verification`;
const response = await fetch(url); const response = await fetch(url);
if (!response.ok) { if (!response.ok) {
// If endpoint returns error, assume not verified // If endpoint returns error, assume not verified
@ -411,7 +436,7 @@ export async function repos(args, server, json) {
} }
} else if (subcommand === 'fork' && args[1] && args[2]) { } else if (subcommand === 'fork' && args[1] && args[2]) {
const [npub, repo] = args.slice(1); const [npub, repo] = args.slice(1);
const data = await apiRequest(server, `/repos/${npub}/${repo}/fork`, 'POST', {}); const data = await apiRequest(server, `/repos/${npub}/${repo}/forks`, 'POST', {});
if (json) { if (json) {
console.log(JSON.stringify(data, null, 2)); console.log(JSON.stringify(data, null, 2));
} else { } else {
@ -421,8 +446,22 @@ export async function repos(args, server, json) {
const [npub, repo] = args.slice(1); const [npub, repo] = args.slice(1);
const data = await apiRequest(server, `/repos/${npub}/${repo}/delete`, 'DELETE'); const data = await apiRequest(server, `/repos/${npub}/${repo}/delete`, 'DELETE');
console.log(json ? JSON.stringify(data, null, 2) : 'Repository deleted successfully'); console.log(json ? JSON.stringify(data, null, 2) : 'Repository deleted successfully');
} else if (subcommand === 'poll') {
// Trigger repository polling to provision new repos from Nostr announcements
const data = await apiRequest(server, '/repos/poll', 'POST');
if (json) {
console.log(JSON.stringify(data, null, 2));
} else {
if (data.success) {
console.log('Repository polling triggered successfully');
console.log('The server will fetch NIP-34 repo announcements and provision repositories that list this server\'s domain.');
} else {
console.error('Failed to trigger polling:', data.error || 'Unknown error');
process.exit(1);
}
}
} else { } else {
console.error('Invalid repos command. Use: list, get, settings, maintainers, branches, tags, fork, delete'); console.error('Invalid repos command. Use: list, get, settings, maintainers, branches, tags, fork, delete, poll');
process.exit(1); process.exit(1);
} }
} }

1
scripts/gitrepublic.js

@ -112,6 +112,7 @@ Commands:
repos tags <npub> <repo> List tags repos tags <npub> <repo> List tags
repos fork <npub> <repo> Fork a repository repos fork <npub> <repo> Fork a repository
repos delete <npub> <repo> Delete a repository repos delete <npub> <repo> Delete a repository
repos poll Trigger repository polling (provisions new repos from Nostr)
file get <npub> <repo> <path> [branch] Get file content file get <npub> <repo> <path> [branch] Get file content
file put <npub> <repo> <path> [file] [message] [branch] Create/update file file put <npub> <repo> <path> [file] [message] [branch] Create/update file
file delete <npub> <repo> <path> [message] [branch] Delete file file delete <npub> <repo> <path> [message] [branch] Delete file

Loading…
Cancel
Save