diff options
Diffstat (limited to 'docs/how-to/migrate-ngit-relay-to-ngit-grasp.md')
| -rw-r--r-- | docs/how-to/migrate-ngit-relay-to-ngit-grasp.md | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/docs/how-to/migrate-ngit-relay-to-ngit-grasp.md b/docs/how-to/migrate-ngit-relay-to-ngit-grasp.md new file mode 100644 index 0000000..e17ba0a --- /dev/null +++ b/docs/how-to/migrate-ngit-relay-to-ngit-grasp.md | |||
| @@ -0,0 +1,46 @@ | |||
| 1 | # Migrate ngit-relay to ngit-grasp on NixOS VPS | ||
| 2 | |||
| 3 | **Goal:** Replace an ngit-relay instance on a VPS running NixOS with ngit-grasp. | ||
| 4 | |||
| 5 | **Specifics:** VPS running NixOS. | ||
| 6 | |||
| 7 | ## Approach | ||
| 8 | |||
| 9 | 1. Deploy ngit-grasp with 'domain' of `<prod-domain>.internal` and an `archiveService` of `<prod-domain>` running on a different port. This will gather all the events and git data from the production service and relays/git servers/grasp servers that for repositories that list the service in their announcement event. To sync all git data may take an hour. | ||
| 10 | |||
| 11 | 2. Analyze the data to see which repositories have not been moved with complete data. Understand why and for each decide if action is needed / not needed to move it. | ||
| 12 | |||
| 13 | 3. Set the 'domain' to production URL, turn off archive mode, and point your reverse proxy at the new port. | ||
| 14 | |||
| 15 | ## Challenges | ||
| 16 | |||
| 17 | - **ngit-relay accepts any commits/annotated tags** that were at that point of time referenced in the latest state event. **ngit-grasp requires all the git data** to reproduce the latest state. So if the git data is incomplete, it won't accept the repository. | ||
| 18 | |||
| 19 | - **ngit-relay doesn't clear out refs/nostr/<event-id>** where it doesn't have a PR event. Fortunately the 'PR' (as opposed to patches) functionality is not widely used so we just need to check a few repositories (shakespeare, ngit and gitworkshop). | ||
| 20 | |||
| 21 | ## Analysis Categories | ||
| 22 | |||
| 23 | ### No action required: | ||
| 24 | |||
| 25 | - **Git Data Complete - Moved** (state event exists in archive and git data reflects it) | ||
| 26 | - **Invalid Repositories Announcement** (Won't Parse) | ||
| 27 | - **Deletion Request** (kind 5) tagging announcement event in archive | ||
| 28 | - **Announcement Not on Production But In Archive** that lists service | ||
| 29 | |||
| 30 | ### Action/decision required: | ||
| 31 | |||
| 32 | - **Invalid State Event** (Won't Parse) | ||
| 33 | - **Incomplete Git Data** (at source and destination) And No State Event at Destination | ||
| 34 | - **No Announcement In Archive** (and no related delete event) | ||
| 35 | - **Complete Git Data at source, Announcement but no State Event in Archive** and empty bare git repo | ||
| 36 | - **State event but incomplete git data in Archive** | ||
| 37 | |||
| 38 | ## Analysis Approach | ||
| 39 | |||
| 40 | This analysis and categorization should be scripted to facilitate easy review and decision making. | ||
| 41 | |||
| 42 | There are already some scripts that we need to build on in the old issue worktree to help facilitate this. | ||
| 43 | |||
| 44 | ## Gotchas | ||
| 45 | |||
| 46 | Always use `nak req` with `--paginate` flag so we don't miss any events. If we receive increments of 250 eg 500 then it's a red flag that we are not paginating and there are probably more events. | ||