upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/docs/explanation/grasp-05-archive.md
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2026-01-12 20:30:13 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2026-01-12 20:30:13 +0000
commita12927181c571fc1641772ad44dd4c6a4ab209d9 (patch)
treed7cb99fa87606e9fb13d91305cda8a0f919e6528 /docs/explanation/grasp-05-archive.md
parentc29191b1e1239e931c575a926ec9480e594476d6 (diff)
feat(grasp-05): add read-only mode with auto-enable for archive configs
Implements NGIT_ARCHIVE_READ_ONLY configuration option that defaults to true when archive mode is enabled, allowing relays to operate as read-only syncs of archived repositories. Key changes: - Add NGIT_ARCHIVE_READ_ONLY config option (defaults to true if archive enabled) - NIP-11 advertises GRASP-05 support and includes curation field when read-only - Validation logic rejects non-whitelisted repos in read-only mode - Comprehensive tests for read-only behavior and defaults - Full documentation in config reference, .env.example, and NixOS module Read-only mode enables passive mirroring without being listed in announcements, useful for backup/archive operations while preventing accidental write acceptance.
Diffstat (limited to 'docs/explanation/grasp-05-archive.md')
-rw-r--r--docs/explanation/grasp-05-archive.md25
1 files changed, 20 insertions, 5 deletions
diff --git a/docs/explanation/grasp-05-archive.md b/docs/explanation/grasp-05-archive.md
index e43a87e..45481dd 100644
--- a/docs/explanation/grasp-05-archive.md
+++ b/docs/explanation/grasp-05-archive.md
@@ -35,14 +35,17 @@ Archive mode relaxes the "must list service" requirement for whitelisted reposit
35 35
36**Configuration:** 36**Configuration:**
37```bash 37```bash
38# Specific repos (safest) 38# Specific repos (safest) - read-only by default
39NGIT_ARCHIVE_WHITELIST=npub1torvalds.../linux,npub1satoshi.../bitcoin 39NGIT_ARCHIVE_WHITELIST=npub1torvalds.../linux,npub1satoshi.../bitcoin
40# NGIT_ARCHIVE_READ_ONLY defaults to true
40 41
41# All repos from trusted maintainers 42# All repos from trusted maintainers
42NGIT_ARCHIVE_WHITELIST=npub1alice...,npub1bob... 43NGIT_ARCHIVE_WHITELIST=npub1alice...,npub1bob...
44# NGIT_ARCHIVE_READ_ONLY defaults to true
43 45
44# Archive everything (⚠️ storage risk) 46# Archive everything (⚠️ storage risk)
45NGIT_ARCHIVE_ALL=true 47NGIT_ARCHIVE_ALL=true
48# NGIT_ARCHIVE_READ_ONLY defaults to true
46``` 49```
47 50
48### Validation Priority 51### Validation Priority
@@ -63,11 +66,21 @@ Archived repos use the same directory structure as hosted repos:
63<git_data_path>/ 66<git_data_path>/
64 npub1alice.../ 67 npub1alice.../
65 hosted-repo.git/ # Lists your service (writable) 68 hosted-repo.git/ # Lists your service (writable)
66 archived-repo.git/ # Whitelisted (read-only) 69 archived-repo.git/ # Whitelisted (read-only by default)
67``` 70```
68 71
69**No flags or metadata** - archive status determined dynamically from config + announcement contents. 72**No flags or metadata** - archive status determined dynamically from config + announcement contents.
70 73
74### Read-Only Mode
75
76By default, archive mode operates in read-only mode (`NGIT_ARCHIVE_READ_ONLY=true`):
77- Repository announcements are accepted per whitelist/archive-all configuration
78- The service is **not listed** in accepted announcements (passive sync only)
79- NIP-11 document advertises `GRASP-05` support
80- NIP-11 `curation` field indicates read-only sync scope:
81 - `"Read-only sync of all repositories found on network"` (if `NGIT_ARCHIVE_ALL=true`)
82 - `"Read-only sync of whitelisted repositories and maintainers"` (if whitelist configured)
83
71### Full Sync 84### Full Sync
72 85
73Archived repositories trigger complete GRASP-02 sync: 86Archived repositories trigger complete GRASP-02 sync:
@@ -129,12 +142,14 @@ Watch for:
129 142
130## Comparison: Hosted vs Archived 143## Comparison: Hosted vs Archived
131 144
132| Aspect | Hosted (GRASP-01) | Archived (GRASP-05) | 145| Aspect | Hosted (GRASP-01) | Archived (GRASP-05 Read-Only) |
133|--------|-------------------|---------------------| 146|--------|-------------------|-------------------------------|
134| Announcement must list you | ✅ Required | ❌ Whitelisted instead | 147| Announcement must list you | ✅ Required | ❌ Whitelisted instead |
135| Git pushes | ✅ Accepted | ❌ Rejected (read-only) | 148| Git pushes | ✅ Accepted | ❌ Rejected (read-only) |
136| GRASP-02 sync | ✅ Full sync | ✅ Full sync | 149| GRASP-02 sync | ✅ Full sync | ✅ Full sync |
137| Relay discovery | ✅ Listed | ❌ Not listed | 150| Relay discovery | ✅ Listed in announcements | ❌ Not listed (passive sync) |
151| NIP-11 supported_grasps | `["GRASP-01", "GRASP-02"]` | `["GRASP-01", "GRASP-05", "GRASP-02"]` |
152| NIP-11 curation field | `null` | Describes archive scope |
138| Use case | Hosting workspace | Backup/mirror | 153| Use case | Hosting workspace | Backup/mirror |
139 154
140## Related Documentation 155## Related Documentation