From 8816a192c95cf539b65975469a2d61aed46f0414 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 26 May 2026 16:11:05 +0530 Subject: 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 --- config.example.toml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 config.example.toml (limited to 'config.example.toml') 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 @@ +# GRASP Mirror Daemon Configuration + +[discovery] +# Relays to query for repo announcements (kind:30617) +index_relays = ["wss://index.ngit.dev"] +# How often to poll for new repos (seconds) +poll_interval_secs = 300 + +[servers] +# All known GRASP servers to mirror to. +# The daemon verifies each via NIP-11 on startup. +known = [ + "relay.ngit.dev", + "gitnostr.com", + "git.orangesync.tech", + "ngit.danconwaydev.com", + "git.shakespeare.diy", + "git.upleb.uk", + "grasp.budabit.club", + "git.uid.ovh", + "git.vps.satsnode.xyz", +] + +[storage] +# Directory for bare git mirror clones +mirror_dir = "/var/lib/grasp-mirror/repos" +# SQLite database for tracking sync state +database = "/var/lib/grasp-mirror/mirror.db" + +# [signing] +# Optional: path to file containing nsec for updating announcements +# key_file = "/etc/grasp-mirror/nsec" -- cgit v1.2.3