Skip to main content

Crate git_remote_htree

Crate git_remote_htree 

Source
Expand description

Git remote helper for hashtree

This crate provides a git remote helper that allows pushing/pulling git repositories via nostr and hashtree.

§Usage

git remote add origin htree://<pubkey>/<repo-name>
git remote add origin htree://<petname>/<repo-name>
git push origin main
git pull origin main

§Encryption Modes

  • Unencrypted: No CHK, just hash - anyone with hash can read
  • Public: CHK encrypted, ["key", "<hex>"] in event - anyone can decrypt
  • Link-visible: CHK + XOR mask, ["encryptedKey", XOR(key,secret)] - need #k=<secret> URL
  • Private: CHK + NIP-44 to self, ["selfEncryptedKey", "..."] - author only

Default is Public (CHK encrypted, key in nostr event).

To create a link-visible repo, use #link-visible to auto-generate a key:

git remote add origin htree://self/repo#link-visible
git push origin main
# After push, you'll see instructions to update the remote URL with the generated key

Or specify an explicit key with #k=<secret>:

git remote add origin htree://npub/repo#k=<64-hex-chars>

Modules§

git
Git storage module
nostr_client
Nostr client for publishing and fetching git repository references

Structs§

ParsedUrl
Parsed htree URL components

Functions§

generate_secret_key
Generate a new random secret key for private repos
main_entry
Entry point for the git remote helper Call this from main() to run the helper