Coder Social home page Coder Social logo

git-remote-nostr's Introduction

git-remote-nostr

It is a transparent bidirectional bridge between git and nostr. It lets you push your git repositories to blossom servers and maintains branch and tags info using NIP-34 kind 30618 repository state events.

DO NOT USE FOR PRODUCTION!

This is a proof of concept for the following reasons:

  • Only sha256 repositories are supported, which severely limits its usefulness.
  • Git object packing is not yet supported, which impacts performance in large repos.
  • Git objects are stored uncompressed so as their hashes match the git internal object ids.
  • Only single owner repos are supported.
  • Relay and blossom servers are fixed via git config.

Usage

Work-in-progress! sha1 support is coming soon!

To push a repo to nostr, the repository object format MUST be sha256, created with:

mkdir myproject
cd myproject
git init --object-format=sha256

Work on the project, then push to nostr:

git remote add origin nostr://<npub>/<myproject>
git push origin --all

As long as the nostr.sec config was set according to npub, the repo will be pushed and signed using the secret key. The repository will be created automatically the first time you push.

Install

git clone [email protected]/lez/git-remote-nostr
cd git-remote-nostr
python -mvenv .venv
source .venv/bin/activate
pip install -r requirements.txt
pip install .
# Then make sure git-remote-nostr executable is in your $PATH.

git config --global --add nostr.relay wss://your.git.relay
git config --global --add nostr.blossom http://127.0.0.1:3000

# If you want to push to remotes, set your secret key as hex or nsec:
# MAKE SURE IT IS NOT SAVED IN YOUR SHELL HISTORY by appending a space in the beginning, unsetting HISTFILE or BASH_HISTORY envvar, or killing the shell with a KILL signal afterwards.
 git config --global --add nostr.sec 1

Notes

  • The remote helper does not support shallow cloning.

  • Cloning a repository or fetching a lot of objects produces lots of loose objects. To save space in the local repository, run git gc --aggressive.

  • The work is based on git-remote-dropbox from Anish Athalye.

Design

To read about the design of git-remote-nostr, see DESIGN.rst file. This could be especially useful if you're thinking about contributing to the project.

Contributing

Currently github's issue tracking is used for reporting bugs and discussing feature requests. If you want to join development, contact me at the npub npub1elta7cneng3w8p9y4dw633qzdjr4kyvaparuyuttyrx6e8xp7xnq32cume.

License

Copyright (c) 2015-2019 Anish Athalye. Released under the MIT License. See LICENSE.rst for details. Copyright (c) 2024 Lez .

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.