@ -116,7 +116,6 @@ View interactive documentation at `/api/openapi.json` or use any OpenAPI viewer.
@@ -116,7 +116,6 @@ View interactive documentation at `/api/openapi.json` or use any OpenAPI viewer.
- `GET /api/config` - Get server configuration
- `GET /api/tor/onion` - Get Tor .onion address
- `POST /api/repos/poll` - Trigger repository polling (provisions new repos from Nostr)
- `GET /api/transfers/pending` - Get pending ownership transfers
This page covers all aspects of editing repositories: branch management, file management, auto-provisioning, file-editing permissions, and event-creation permissions.
## Auto-Provisioning
## Adding Repositories
When you create a repository announcement, GitRepublic automatically:
Repositories must be explicitly added to the server using the clone endpoint. When you clone a repository:
1. **Polls Nostr relays** for new announcements
1. **Fetches the repository announcement** from Nostr relays
2. **Creates a bare git repository** at `/repos/{npub}/{repo-name}.git`
3. **Fetches self-transfer event** for ownership verification
3. **Fetches self-transfer event** for ownership verification (if available)
4. **Creates initial commit** with README.md (if provided)
5. **Saves announcement and transfer events** to `nostr/repo-events.jsonl`
6. **Syncs from other remotes** if clone URLs are configured
The repository is ready to use immediately after announcement.
The repository is ready to use immediately after cloning.
{"kind":1640,"pubkey":"573634b648634cbad10f2451776089ea21090d9407f715e83c577b4611ae6edc","created_at":1772269280,"tags":[["author","Silberengel","silberengel7@protonmail.com"],["message","api refactor part 2"]],"content":"Signed commit: api refactor part 2","id":"ece894a60057bba46ebd4ac0dca2aca55ffce05e44671fe07b29516809fc86f6","sig":"176706a271659834e441ea5eab4bb1480667dad4468fe8315803284f4a183debf595523dd33d0d3cabe0c35013f4a72b9169b5f10afefaf8a82a721d8b0f3b08"}
{"kind":1640,"pubkey":"573634b648634cbad10f2451776089ea21090d9407f715e83c577b4611ae6edc","created_at":1772270859,"tags":[["author","Silberengel","silberengel7@protonmail.com"],["message","bug-fixes and fallback relay"]],"content":"Signed commit: bug-fixes and fallback relay","id":"1d85d0c5e1451c90bca5d59e08043f29adeaad4db4ac5495c8e9a4247775780f","sig":"a1960b76c78db9f64dad20378d26f500ffc09f1f6d137314db548470202712222a1d391f682146ba281fd23355c574fcbb260310db61b3458bba3dec0c724a18"}
@ -246,6 +259,7 @@ export class RepoManager {
@@ -246,6 +259,7 @@ export class RepoManager {
defaultBranch=existingBranches[0];
}
}
}
}catch{
// No branches exist, use the determined default
}
@ -337,6 +351,130 @@ Your commits will all be signed by your Nostr keys and saved to the event files
@@ -337,6 +351,130 @@ Your commits will all be signed by your Nostr keys and saved to the event files
@ -370,7 +508,8 @@ Your commits will all be signed by your Nostr keys and saved to the event files
@@ -370,7 +508,8 @@ Your commits will all be signed by your Nostr keys and saved to the event files
@ -518,7 +657,7 @@ Your commits will all be signed by your Nostr keys and saved to the event files
@@ -518,7 +657,7 @@ Your commits will all be signed by your Nostr keys and saved to the event files
// No remote URLs - this is an empty repo, provision it instead
logger.info({npub,repoName,cloneUrls,announcementEventId: announcementEvent.id},'No remote clone URLs found - provisioning empty repository');
@ -539,7 +678,7 @@ Your commits will all be signed by your Nostr keys and saved to the event files
@@ -539,7 +678,7 @@ Your commits will all be signed by your Nostr keys and saved to the event files
logger.info({npub,repoName,url: remoteUrls[0]},'Localhost URL specified but repo does not exist locally - provisioning instead');
try{
// In development, allow provisioning even if domain URL isn't in announcement
"description":"Manually trigger repository polling to provision new repos from Nostr announcements. This endpoint fetches NIP-34 repo announcements from relays and provisions repositories that list this server's domain in their clone URLs. The poll runs asynchronously and does not block the request.",
"tags":["Infrastructure"],
"responses":{
"200":{
"description":"Poll triggered successfully",
"content":{
"application/json":{
"schema":{
"type":"object",
"properties":{
"success":{"type":"boolean"},
"message":{"type":"string"}
}
}
}
}
},
"503":{
"description":"Polling service not available",
"content":{
"application/json":{
"schema":{
"$ref":"#/components/schemas/Error"
}
}
}
},
"500":{
"description":"Error triggering poll",
"content":{
"application/json":{
"schema":{
"$ref":"#/components/schemas/Error"
}
}
}
}
}
}
},
"/api/repos/{npub}/{repo}/files":{
"get":{
"summary":"Get file content, list files, or get raw file",