upleb.uk

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

summaryrefslogtreecommitdiff
path: root/docs/reference
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/reference
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/reference')
-rw-r--r--docs/reference/configuration.md71
1 files changed, 71 insertions, 0 deletions
diff --git a/docs/reference/configuration.md b/docs/reference/configuration.md
index 52418ad..4692600 100644
--- a/docs/reference/configuration.md
+++ b/docs/reference/configuration.md
@@ -574,6 +574,77 @@ NGIT_ARCHIVE_WHITELIST=npub1alice23...,npub1bob23.../linux,bitcoin-core
574 574
575--- 575---
576 576
577#### `NGIT_ARCHIVE_READ_ONLY`
578
579**Description:** Configure relay as read-only sync of archived repositories
580**Type:** Boolean
581**Default:** `true` if `NGIT_ARCHIVE_ALL` or `NGIT_ARCHIVE_WHITELIST` is set, `false` otherwise
582**Required:** No
583
584**Examples:**
585
586```bash
587# Explicitly enable (requires archive mode)
588NGIT_ARCHIVE_READ_ONLY=true
589
590# Explicitly disable (writable archive repos)
591NGIT_ARCHIVE_READ_ONLY=false
592
593# Automatic (default behavior)
594# - If NGIT_ARCHIVE_ALL or NGIT_ARCHIVE_WHITELIST is set → true
595# - Otherwise → false
596# NGIT_ARCHIVE_READ_ONLY=
597```
598
599**Behavior:**
600
601- When `true`:
602 - NIP-11 document includes `GRASP-05` in `supported_grasps`
603 - NIP-11 `curation` field describes the archive scope
604 - Repository announcements not listing this service are accepted per whitelist/archive-all
605- When `false`:
606 - Archive mode disabled (standard GRASP-01 operation)
607- When unset (default):
608 - Automatically `true` if archive mode configured
609 - Automatically `false` otherwise
610
611**Error Conditions:**
612
613```bash
614# ERROR: Cannot set read-only without archive config
615NGIT_ARCHIVE_READ_ONLY=true
616NGIT_ARCHIVE_ALL=false
617NGIT_ARCHIVE_WHITELIST=
618# → Server fails to start: "NGIT_ARCHIVE_READ_ONLY=true requires either
619# NGIT_ARCHIVE_ALL=true or NGIT_ARCHIVE_WHITELIST to be set"
620```
621
622**NIP-11 Impact:**
623
624When `NGIT_ARCHIVE_READ_ONLY=true`:
625- `supported_grasps`: includes `"GRASP-05"`
626- `curation`: Set to one of:
627 - `"Read-only sync of all repositories found on network"` (if `NGIT_ARCHIVE_ALL=true`)
628 - `"Read-only sync of whitelisted repositories and maintainers"` (if `NGIT_ARCHIVE_WHITELIST` set)
629
630**Use Cases:**
631
632```bash
633# Public archive of entire ecosystem
634NGIT_ARCHIVE_ALL=true
635NGIT_ARCHIVE_READ_ONLY=true # Default
636
637# Selective backup of critical projects
638NGIT_ARCHIVE_WHITELIST=npub1torvalds.../linux,npub1satoshi.../bitcoin
639NGIT_ARCHIVE_READ_ONLY=true # Default
640
641# Writable mirror (advanced, not typical)
642NGIT_ARCHIVE_WHITELIST=npub1alice...
643NGIT_ARCHIVE_READ_ONLY=false
644```
645
646---
647
577### Logging Configuration 648### Logging Configuration
578 649
579#### `RUST_LOG` 650#### `RUST_LOG`