diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/explanation/grasp-05-archive.md | 25 | ||||
| -rw-r--r-- | docs/reference/configuration.md | 71 |
2 files changed, 91 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 |
| 39 | NGIT_ARCHIVE_WHITELIST=npub1torvalds.../linux,npub1satoshi.../bitcoin | 39 | NGIT_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 |
| 42 | NGIT_ARCHIVE_WHITELIST=npub1alice...,npub1bob... | 43 | NGIT_ARCHIVE_WHITELIST=npub1alice...,npub1bob... |
| 44 | # NGIT_ARCHIVE_READ_ONLY defaults to true | ||
| 43 | 45 | ||
| 44 | # Archive everything (⚠️ storage risk) | 46 | # Archive everything (⚠️ storage risk) |
| 45 | NGIT_ARCHIVE_ALL=true | 47 | NGIT_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 | |||
| 76 | By 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 | ||
| 73 | Archived repositories trigger complete GRASP-02 sync: | 86 | Archived 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 |
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) | ||
| 588 | NGIT_ARCHIVE_READ_ONLY=true | ||
| 589 | |||
| 590 | # Explicitly disable (writable archive repos) | ||
| 591 | NGIT_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 | ||
| 615 | NGIT_ARCHIVE_READ_ONLY=true | ||
| 616 | NGIT_ARCHIVE_ALL=false | ||
| 617 | NGIT_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 | |||
| 624 | When `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 | ||
| 634 | NGIT_ARCHIVE_ALL=true | ||
| 635 | NGIT_ARCHIVE_READ_ONLY=true # Default | ||
| 636 | |||
| 637 | # Selective backup of critical projects | ||
| 638 | NGIT_ARCHIVE_WHITELIST=npub1torvalds.../linux,npub1satoshi.../bitcoin | ||
| 639 | NGIT_ARCHIVE_READ_ONLY=true # Default | ||
| 640 | |||
| 641 | # Writable mirror (advanced, not typical) | ||
| 642 | NGIT_ARCHIVE_WHITELIST=npub1alice... | ||
| 643 | NGIT_ARCHIVE_READ_ONLY=false | ||
| 644 | ``` | ||
| 645 | |||
| 646 | --- | ||
| 647 | |||
| 577 | ### Logging Configuration | 648 | ### Logging Configuration |
| 578 | 649 | ||
| 579 | #### `RUST_LOG` | 650 | #### `RUST_LOG` |