diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-12 20:30:13 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-12 20:30:13 +0000 |
| commit | a12927181c571fc1641772ad44dd4c6a4ab209d9 (patch) | |
| tree | d7cb99fa87606e9fb13d91305cda8a0f919e6528 /src/nostr/builder.rs | |
| parent | c29191b1e1239e931c575a926ec9480e594476d6 (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 'src/nostr/builder.rs')
| -rw-r--r-- | src/nostr/builder.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nostr/builder.rs b/src/nostr/builder.rs index deee641..33f2fe5 100644 --- a/src/nostr/builder.rs +++ b/src/nostr/builder.rs | |||
| @@ -575,9 +575,10 @@ pub async fn create_relay( | |||
| 575 | 575 | ||
| 576 | if archive_config.enabled() { | 576 | if archive_config.enabled() { |
| 577 | tracing::info!( | 577 | tracing::info!( |
| 578 | "GRASP-05 archive mode enabled: archive_all={}, whitelist_entries={}", | 578 | "GRASP-05 archive mode enabled: archive_all={}, whitelist_entries={}, read_only={}", |
| 579 | archive_config.archive_all, | 579 | archive_config.archive_all, |
| 580 | archive_config.whitelist.len() | 580 | archive_config.whitelist.len(), |
| 581 | archive_config.read_only | ||
| 581 | ); | 582 | ); |
| 582 | } | 583 | } |
| 583 | 584 | ||