diff options
| author | Your Name <you@example.com> | 2026-05-26 16:11:05 +0530 |
|---|---|---|
| committer | Your Name <you@example.com> | 2026-05-26 16:11:05 +0530 |
| commit | 8816a192c95cf539b65975469a2d61aed46f0414 (patch) | |
| tree | 7590318244a56fabbfa6919ef6d0fab5be529134 /config.example.toml | |
feat: initial implementation of grasp-mirror daemon
GRASP mirror daemon that discovers repos from watched npubs and mirrors
git data + Nostr events across all known GRASP servers for redundancy.
Features:
- Configurable npub watch list via .env (MIRROR_NPUBS)
- TOML config for GRASP server list, index relays, storage paths
- NIP-11 verification of GRASP servers on startup
- Discovery of repos via kind:30617 announcements on index relays
- Git mirroring (bare clone + push --mirror) to missing GRASP servers
- Nostr event forwarding to all GRASP server embedded relays
- SQLite state tracking for sync status and event dedup
- Optional signing key for updating announcements with new clone URLs
- CLI subcommands: daemon, status, verify, mirror-once
Architecture:
config.rs - TOML + .env config loading
db.rs - SQLite state tracking
health.rs - NIP-11 GRASP server verification
discovery.rs - Relay subscription, kind:30617 parsing
git_mirror.rs - Bare clone + push to GRASP servers
nostr_mirror.rs - Event forwarding to all GRASP relays
signing.rs - Optional announcement updates
main.rs - CLI entry point, daemon loop
Diffstat (limited to 'config.example.toml')
| -rw-r--r-- | config.example.toml | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/config.example.toml b/config.example.toml new file mode 100644 index 0000000..f00620d --- /dev/null +++ b/config.example.toml | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | # GRASP Mirror Daemon Configuration | ||
| 2 | |||
| 3 | [discovery] | ||
| 4 | # Relays to query for repo announcements (kind:30617) | ||
| 5 | index_relays = ["wss://index.ngit.dev"] | ||
| 6 | # How often to poll for new repos (seconds) | ||
| 7 | poll_interval_secs = 300 | ||
| 8 | |||
| 9 | [servers] | ||
| 10 | # All known GRASP servers to mirror to. | ||
| 11 | # The daemon verifies each via NIP-11 on startup. | ||
| 12 | known = [ | ||
| 13 | "relay.ngit.dev", | ||
| 14 | "gitnostr.com", | ||
| 15 | "git.orangesync.tech", | ||
| 16 | "ngit.danconwaydev.com", | ||
| 17 | "git.shakespeare.diy", | ||
| 18 | "git.upleb.uk", | ||
| 19 | "grasp.budabit.club", | ||
| 20 | "git.uid.ovh", | ||
| 21 | "git.vps.satsnode.xyz", | ||
| 22 | ] | ||
| 23 | |||
| 24 | [storage] | ||
| 25 | # Directory for bare git mirror clones | ||
| 26 | mirror_dir = "/var/lib/grasp-mirror/repos" | ||
| 27 | # SQLite database for tracking sync state | ||
| 28 | database = "/var/lib/grasp-mirror/mirror.db" | ||
| 29 | |||
| 30 | # [signing] | ||
| 31 | # Optional: path to file containing nsec for updating announcements | ||
| 32 | # key_file = "/etc/grasp-mirror/nsec" | ||