From a12927181c571fc1641772ad44dd4c6a4ab209d9 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Mon, 12 Jan 2026 20:30:13 +0000 Subject: 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. --- .env.example | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to '.env.example') diff --git a/.env.example b/.env.example index 2dc5266..cb797a8 100644 --- a/.env.example +++ b/.env.example @@ -189,4 +189,17 @@ # NGIT_ARCHIVE_WHITELIST=npub1alice... # NGIT_ARCHIVE_WHITELIST=npub1alice...,npub1bob.../linux # NGIT_ARCHIVE_WHITELIST=bitcoin-core,linux,rust -# NGIT_ARCHIVE_WHITELIST= \ No newline at end of file +# NGIT_ARCHIVE_WHITELIST= + +# Archive read-only mode (relay is read-only sync of archived repositories) +# When true: +# - NIP-11 includes GRASP-05 in supported_grasps +# - NIP-11 curation field describes archive scope +# - Repository announcements not listing this service are accepted per whitelist/archive-all +# When false: +# - Archive mode disabled (standard GRASP-01 operation) +# +# CLI: --archive-read-only +# Default: true if NGIT_ARCHIVE_ALL or NGIT_ARCHIVE_WHITELIST is set, false otherwise +# Note: Setting to true without archive config causes startup error +# NGIT_ARCHIVE_READ_ONLY= \ No newline at end of file -- cgit v1.2.3