fiatjaf on Nostr: This is now implemented in and its companion pre-push hook: ...
This is now implemented in
https://git.fiatjaf.com/song and its companion pre-push hook:
this is exactly what I was hoping for. the flow the current git remote helper is expecting is very similar to your video:
* song has a white list of npubs that can create repositories (just sk 79 in this example?)
* create git repo locally: `git init && echo "example" > README.md && git commit -am "initial commit"`
* create git announcement `ngit init --identifier my-repo --relays wss://git.oursong.com/npub123/my-repo --clone https://git.oursong.com/npub123/my-repo`
* `git remote add origin nostr://npub123/my-repo?relayhint=git.oursong.com | git push -u`
* song will receive the receive the state announcement nostr event which will authorise the push
Hopefully it will work with ngit soon, but it works without ngit now using just the pre-push hook:
mkdir flower
cd flower
git init
git remote add origin
http://yoursongrelayandserver.com/flowerln -s (which song-pre-push) .git/hooks/pre-push
git config song.signer '<nsec-or-bunker-url>'
echo 'peony' > name
git add .
git commit -m 'add name'
git push origin master -u
And the pre-push hook will sign a kind:30618 and push it to the server. The server will check that it comes from you and store it if it does, and will create a repository on its side upon receiving the event (named "flower"). Then the git push will proceed and since the kind:30618 has the correct branch name and the commit id in it, it will be authorized.
The next time you have a commit you can just git push and it should work normally.
Later you can publish a kind:30617 with more metadata if you want, and if that includes a "maintainers" tag then those maintainers can also create branches and push to your 'flower' repo.
I guess I should write this in the song README file.
gsovereignty (npub1myg…sn5p) gugabfigueiredo (npub1upl…sfek) jb55 (npub1xts…kk5s) dluvian (npub1use…k5ks) you might be interested or have criticisms.
DanConwayDev (npub15qy…yejr) please let me know if I got this right.
Published at
2024-08-28 15:52:18Event JSON
{
"id": "e9bbcbadc977a1de30a21c8af06d2492fe2201d4d60a788dfe04f320a98e96e2",
"pubkey": "3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d",
"created_at": 1724860338,
"kind": 1,
"tags": [
[
"client",
"gossip"
],
[
"q",
"57e6e10c2408005f73cdaf87dcbb52cf13674f3888f26d3c60ca848790dbd86f",
"wss://a.nos.lol/"
],
[
"p",
"d91191e30e00444b942c0e82cad470b32af171764c2275bee0bd99377efd4075"
],
[
"p",
"e07e6c1351e07c837b1feb6c3624173c6b3f13e40d75f8e4ebd69fff0739c1c7"
],
[
"p",
"32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245"
],
[
"p",
"e4336cd525df79fa4d3af364fd9600d4b10dce4215aa4c33ed77ea0842344b10"
],
[
"p",
"a008def15796fba9a0d6fab04e8fd57089285d9fd505da5a83fe8aad57a3564d"
]
],
"content": "This is now implemented in https://git.fiatjaf.com/song and its companion pre-push hook:\nnostr:nevent1qqs90ehppsjqsqzlw0x6lp7uhdfv7ym8fuug3und83sv4py8jrdasmcpzpmhxue69uhkztnwdaejumr0dshszrnhwden5te0dehhxtnvdakz7qgcwaehxw309ahx7um5wghxvmt59emkj73wvf5h5tcn8e7qw\n\nHopefully it will work with ngit soon, but it works without ngit now using just the pre-push hook:\n\nmkdir flower\ncd flower\ngit init\n\ngit remote add origin http://yoursongrelayandserver.com/flower\nln -s (which song-pre-push) .git/hooks/pre-push\ngit config song.signer '\u003cnsec-or-bunker-url\u003e'\n\necho 'peony' \u003e name\ngit add .\ngit commit -m 'add name'\ngit push origin master -u\n\nAnd the pre-push hook will sign a kind:30618 and push it to the server. The server will check that it comes from you and store it if it does, and will create a repository on its side upon receiving the event (named \"flower\"). Then the git push will proceed and since the kind:30618 has the correct branch name and the commit id in it, it will be authorized.\n\nThe next time you have a commit you can just git push and it should work normally.\n\nLater you can publish a kind:30617 with more metadata if you want, and if that includes a \"maintainers\" tag then those maintainers can also create branches and push to your 'flower' repo.\n\nI guess I should write this in the song README file.\n\nnostr:npub1mygerccwqpzyh9pvp6pv44rskv40zutkfs38t0hqhkvnwlhagp6s3psn5p nostr:npub1uplxcy63up7gx7cladkrvfqh834n7ylyp46l3e8t660l7peec8rsd2sfek nostr:npub1xtscya34g58tk0z605fvr788k263gsu6cy9x0mhnm87echrgufzsevkk5s nostr:npub1useke4f9maul5nf67dj0m9sq6jcsmnjzzk4ycvldwl4qss35fvgqjdk5ks you might be interested or have criticisms.\nnostr:npub15qydau2hjma6ngxkl2cyar74wzyjshvl65za5k5rl69264ar2exs5cyejr please let me know if I got this right.",
"sig": "fe1c39fc78c0371e4b015a984f9981736c49faa8b467c277618e1037df5293816e8546d8cd10aa252757058a737a2459444aa582782b2df5705b12f17c440d78"
}