diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2025-11-20 14:50:54 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2025-11-20 14:50:54 +0000 |
| commit | 62bcfda39d51a459fbf0a7fa48ee9e2ac8505780 (patch) | |
| tree | a1c4ac2b1c009723cabc21c859020c1e5e0c4e9d | |
| parent | bf7f4d5381203d5c27b2811d62c5b1781533aa2b (diff) | |
docs: fix readme with vendored git-http-backend
| -rw-r--r-- | README.md | 31 |
1 files changed, 19 insertions, 12 deletions
| @@ -28,12 +28,13 @@ Unlike the reference implementation ([ngit-relay](https://gitworkshop.dev/npub15 | |||
| 28 | 28 | ||
| 29 | The key architectural decision is **inline authorization** rather than Git hooks: | 29 | The key architectural decision is **inline authorization** rather than Git hooks: |
| 30 | 30 | ||
| 31 | - The `git-http-backend` crate provides low-level access to the Git protocol | 31 | - Vendored and customised `git-http-backend` crate provides low-level access to the Git protocol |
| 32 | - We intercept the `git-receive-pack` operation before spawning the Git process | 32 | - We intercept the `git-receive-pack` operation before spawning the Git process |
| 33 | - Push validation happens by checking the Nostr relay for the latest state event | 33 | - Push validation happens by checking the Nostr relay for the latest state event |
| 34 | - Only matching pushes are forwarded to the actual Git repository | 34 | - Only matching pushes are forwarded to the actual Git repository |
| 35 | 35 | ||
| 36 | This approach provides: | 36 | This approach provides: |
| 37 | |||
| 37 | - **Better error messages**: Direct HTTP responses vs. hook stderr | 38 | - **Better error messages**: Direct HTTP responses vs. hook stderr |
| 38 | - **Simpler deployment**: No hook management or symlinks | 39 | - **Simpler deployment**: No hook management or symlinks |
| 39 | - **Tighter integration**: Shared state between Git and Nostr components | 40 | - **Tighter integration**: Shared state between Git and Nostr components |
| @@ -42,6 +43,7 @@ This approach provides: | |||
| 42 | ## GRASP Compliance | 43 | ## GRASP Compliance |
| 43 | 44 | ||
| 44 | ### GRASP-01 (Core Service Requirements) | 45 | ### GRASP-01 (Core Service Requirements) |
| 46 | |||
| 45 | - ✅ NIP-01 compliant Nostr relay at `/` | 47 | - ✅ NIP-01 compliant Nostr relay at `/` |
| 46 | - ✅ Accepts NIP-34 repository announcements and state events | 48 | - ✅ Accepts NIP-34 repository announcements and state events |
| 47 | - ✅ Git Smart HTTP service at `/<npub>/<identifier>.git` | 49 | - ✅ Git Smart HTTP service at `/<npub>/<identifier>.git` |
| @@ -52,11 +54,13 @@ This approach provides: | |||
| 52 | - ✅ NIP-11 relay information document | 54 | - ✅ NIP-11 relay information document |
| 53 | 55 | ||
| 54 | ### GRASP-02 (Proactive Sync) - Planned | 56 | ### GRASP-02 (Proactive Sync) - Planned |
| 57 | |||
| 55 | - 🔄 Proactive event sync from listed relays | 58 | - 🔄 Proactive event sync from listed relays |
| 56 | - 🔄 Proactive Git data sync from listed clone URLs | 59 | - 🔄 Proactive Git data sync from listed clone URLs |
| 57 | - 🔄 PR data fetching and serving | 60 | - 🔄 PR data fetching and serving |
| 58 | 61 | ||
| 59 | ### GRASP-05 (Archive) - Planned | 62 | ### GRASP-05 (Archive) - Planned |
| 63 | |||
| 60 | - 🔄 Accept repositories not listing this instance | 64 | - 🔄 Accept repositories not listing this instance |
| 61 | - 🔄 Backup/mirror mode operation | 65 | - 🔄 Backup/mirror mode operation |
| 62 | 66 | ||
| @@ -64,7 +68,7 @@ This approach provides: | |||
| 64 | 68 | ||
| 65 | - **Rust**: Core language | 69 | - **Rust**: Core language |
| 66 | - **actix-web**: HTTP server framework | 70 | - **actix-web**: HTTP server framework |
| 67 | - **git-http-backend**: Git protocol handling | 71 | - **git-http-backend**: Git protocol handling but vendored and customised for authorisation logic |
| 68 | - **nostr-relay-builder**: Nostr relay infrastructure from rust-nostr | 72 | - **nostr-relay-builder**: Nostr relay infrastructure from rust-nostr |
| 69 | - **nostr-sdk**: Nostr event handling and validation | 73 | - **nostr-sdk**: Nostr event handling and validation |
| 70 | - **tokio**: Async runtime | 74 | - **tokio**: Async runtime |
| @@ -72,8 +76,10 @@ This approach provides: | |||
| 72 | ## Quick Start | 76 | ## Quick Start |
| 73 | 77 | ||
| 74 | ```bash | 78 | ```bash |
| 79 | # install ngit | ||
| 80 | curl -Ls https://ngit.dev/install.sh | bash | ||
| 75 | # Clone the repository | 81 | # Clone the repository |
| 76 | git clone https://gitworkshop.dev/ngit-grasp | 82 | git clone nostr://danconwaydev.com/relay.ngit.dev/ngit-grasp |
| 77 | cd ngit-grasp | 83 | cd ngit-grasp |
| 78 | 84 | ||
| 79 | # Build (using Nix for reproducible environment) | 85 | # Build (using Nix for reproducible environment) |
| @@ -146,6 +152,7 @@ nix develop -c cargo test --test nip01_compliance test_nip01_smoke | |||
| 146 | ``` | 152 | ``` |
| 147 | 153 | ||
| 148 | **Integration tests automatically:** | 154 | **Integration tests automatically:** |
| 155 | |||
| 149 | - Start a fresh relay instance | 156 | - Start a fresh relay instance |
| 150 | - Run compliance tests using grasp-audit library | 157 | - Run compliance tests using grasp-audit library |
| 151 | - Clean up when done | 158 | - Clean up when done |
| @@ -213,20 +220,20 @@ ngit-grasp/ | |||
| 213 | 220 | ||
| 214 | ## Comparison with ngit-relay | 221 | ## Comparison with ngit-relay |
| 215 | 222 | ||
| 216 | | Feature | ngit-relay (Go) | ngit-grasp (Rust) | | 223 | | Feature | ngit-relay (Go) | ngit-grasp (Rust) | |
| 217 | |---------|----------------|-------------------| | 224 | | ------------- | ----------------------------------------- | ----------------------------- | |
| 218 | | Language | Go | Rust | | 225 | | Language | Go | Rust | |
| 219 | | Components | nginx + git-http-backend + hooks + Khatru | Single integrated binary | | 226 | | Components | nginx + git-http-backend + hooks + Khatru | Single integrated binary | |
| 220 | | Authorization | Pre-receive Git hook | Inline during receive-pack | | 227 | | Authorization | Pre-receive Git hook | Inline during receive-pack | |
| 221 | | Deployment | Docker + supervisord | Single binary | | 228 | | Deployment | Docker + supervisord | Single binary | |
| 222 | | Testing | Go tests + shell scripts | Rust unit + integration tests | | 229 | | Testing | Go tests + shell scripts | Rust unit + integration tests | |
| 223 | | Performance | Good | Excellent (zero-copy, async) | | 230 | | Performance | Good | Excellent (zero-copy, async) | |
| 224 | 231 | ||
| 225 | ## Contributing | 232 | ## Contributing |
| 226 | 233 | ||
| 227 | Contributions welcome! Please: | 234 | Contributions welcome! Please: |
| 228 | 235 | ||
| 229 | 1. Read [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) | 236 | 1. Read [docs/explanation/architecture.md](docs/ARCHITECTURE.md) |
| 230 | 2. Open an issue to discuss major changes | 237 | 2. Open an issue to discuss major changes |
| 231 | 3. Follow Rust conventions and run `cargo fmt` + `cargo clippy` | 238 | 3. Follow Rust conventions and run `cargo fmt` + `cargo clippy` |
| 232 | 4. Add tests for new functionality | 239 | 4. Add tests for new functionality |