Avatar
Lez
cfd7df62799a22e384a4ab5da8c4026c875b119d0f47c2716b20cdac9cc1f1a6
Inventor of nsite, building tribewiki.org. Biohacker.

I was looking for such a project.

Initial feedback: try it with the browser set to dark theme. (text is invisible)

Christopher Alexander was an inspiring, unique thinker.

An architect, constantly thinking about what makes places "alive".

He came up with a method to measure how alive is a thing, and how to build them. Books where he goes about it: "Pattern language", "Nature of order".

In this lecture of '96 he talks to software programmers, arguing they should apply these principles when building software.

Too bad we can't invite him to a Nostr conference as speaker anymore, he would love it.

https://www.youtube.com/watch?v=98LdFA-_zfA

It's confusing, noted.

This argument about http headers does not stand if we are strict, because of the 'nostr://' scheme. I think it's also fair to assume that after the nostr:// we expect @ to mean nip05, not http username -- we don't even know if it's http under the hood.

But still, it's confusing.

The remapping is not algorithmic, but included in this event: https://njump.me/nevent1qqstda2vwm5ucl3qxa8rm0ah06npuanr6jr7mvhaqfqq8dsqp9543qgpzemhxue69uhhyetvv9ujumn0wd68ytnzv9hxgq3qelta7cneng3w8p9y4dw633qzdjr4kyvaparuyuttyrx6e8xp7xnq7vvqe5

In there, the "clone" URL actually holds https://github.com/lez/ as we are used to seeing.

Maybe what's really confusing is the fact that it's not a real clone url, just a fancy pointer to it, I don't know. It has nothing to do with git clone urls we seen so far.

My opinion is that nostr://nostr.hu/lez/nostropus would also be confusing. Because the git repo is not on nostr.hu server at all. And it's hard to tell people it's a NIP05, you just have to swap the elements and put @ in that.

Maybe it's confusing because the host where the files are stored is not showing up in the remote url at all. It's equivalent with `nostr://npub1elta..../nostropus`. So it means "On nostr, find this user, and find his repo with this reponame"

Am I right that you'd prefer "nostr://nostr.hu/lez/nostropus" instead of the current form?

Replying to Avatar fiatjaf

My repos are "git clone https://git.fiatjaf.com/reponame" already. What is this adding -- aside from forcing the user to have a remote helper installed before they can clone the repo?

The win is more obvious if you compare it to the old form "nostr://naddr[192 chars omitted]"

also, think about it this way

the nip-05 is only, and ONLY serving https://n.mleku.dev/.well-known/nostr.json

every other route from that `/` can be anything

you should recommend a scheme to resolve the name@ into an implied path

in fact you can skip the stupid @ thing altogether and just make the name the first path element, it would be more easy to type and read

Still feeling misunderstood and hardly understand your desire.

Do you want to serve your git under your nip5 host? You are the minority, but still you can do it. Add http://mleku@n.mleku.dev/gitroot/project as the `clone` tag.

@ is part of NIP-05. If you skip it, people won't recognize that it's a NIP-05.

The way it works:

there is a URL nostr://lez@nostr.hu/identifier?username=gitusername

1. NIP05 resolved to npub + NIP05 relaylist

2. NIP05 relaylist is REQ'd for {authors: [npub], #d: [identifier], kinds: [30617]}

3. Repo is cloned from the 30617 event's clone tag, using 'gitusername' from original URL

In your example, example.com is the NIP-05 provider, and not the git server, right?

If you want to specify user for the git server, it is currently done in parameters:

nostr://dave@example.com/somerepo?username=davesgitserveruser and this long username is used for the URL specified in the repo event as "clone" tag.

#golang has a "vanity import" scheme which is basically a meta tag that points to the "real" address, i have mine going to https://realy.lol but that points to https://github.com/mleku/realy and additionally i added a redirect header that bounces a normal access over to the actual hosting

this thing `nostr://lez@nostr.hu` should equate to X.X.X.X IPv4 address at port 443 or port 80, so what is the protocol exactly?

The 30617 event contains the IP:port where git will connect.

ohhh so you have

https://example.com/.well_known/nostr.json and you expect the http-git service to be at https://example.com right?

so with mine, that would be https://n.mleku.dev ?

yup, i get it

my nip-05 implementation on lerproxy (found in https://realy.lol in the cmd/lerproxy directory) only has a configuration to specify a local path where the nostr.json file is at, i would need to modify it so it additionally providesn actual network redirection address for anything other than `.well_known/nostr.json` it would be a small change

i was asking because i already have an easy to configure nip-05... it just only points to a file path... it is very simple to create an optional second clause, like, separated by a space or something on the line, i mean, really simple stuff

though, you also include the username there, this would imply a sub-path or some similar thing, i just use the default _ path for mine so it's just n.mleku.dev but i am thinking you mean to have distinct paths per user, so the user path needs to be part of the *actual* path of the redirection

just putting these thoughts all together, i would rather not tamper with nip-05 spec, but rather just define an appendix to it that says for your example, you should have this:

nostr.hu/lez/nostropus = nostr://lez@nostr.hu/nostropus as a standard remapping, so it simplifies how the web server routes the request

No! NIP-05 allows you to specify a relay list for your name. It's a not so well-known feature, but part of the NIP-05 spec.

So when you do a `git clone`, it will fetch the gitrepo event 30617 (see NIP-34) from your NIP-05 relays.

All the metadata for the repo is stored inside the repo events. 1. the git server urls, 2. relays where patches are welcome 3. description and so on and on.

We can't get fancier git remote URL's, ever!

git clone nostr://lez@nostr.hu/nostropus

The fresh ngit release is out! No more excuses for feeding github anymore!

nostr:nevent1qvzqqqqqqypzpgqgmmc409hm4xsdd74sf68a2uyf9pwel4g9mfdg8l5244t6x4jdqythwumn8ghj7un9d3shjtnswf5k6ctv9ehx2ap0qy88wumn8ghj7mn0wvhxcmmv9uqzqq8jntkvgqaas2ymty0y43ad0hapzjyn872z0xy2g6rp29a4yaw6fwdzs9

Great way to put it

The local cache of your 10002 events (your relay list) is now automatically refreshed when you run `ngit init`. It should not push the repo event to any of your old relays anymore.

But in this case the user and protocol doesn't belong to the rest of the URL, it belongs to the invisible underlying clone URL(s).

So when there are multiple underlying URL's, how can we prevent repeated errors on the console, if the username or protocol are different for each clone URL?

I'll tag nostr:npub1s6z7hmmx2vud66f3utxd70qem8cwtggx0jgc7gh8pqwz2k8cltuqrdwk4c as I understand he might be using this feature on a daily basis.

Replying to Avatar DanConwayDev

From ec99da472f7fd9678b10f95e2f55cc17f96f8e62 Mon Sep 17 00:00:00 2001

From: DanConwayDev

Date: Mon, 16 Dec 2024 13:17:43 +0000

Subject: [PATCH] docs: add FAQ with server protocol question

A question came up about the reason to specify git server protocol

and ssh user in the nostr git url format. this is an attempt to

answer it in a more holistic manner.

---

FAQs.md | 27 +++++++++++++++++++++++++++

1 file changed, 27 insertions(+)

create mode 100644 FAQs.md

diff --git a/FAQs.md b/FAQs.md

new file mode 100644

index 0000000..4a24bf4

--- /dev/null

+++ b/FAQs.md

@@ -0,0 +1,27 @@

+# FAQs

+

+## what protocol is used to interact with the git server(s) listed in the announcement event `30617`?

+

+Most Git servers support a variety of protocols, and it is the user's responsibility to specify which one to use in the Git remote URL.

+

+For a Nostr repository, the Git remote URL(s) are specified by the maintainer in the announcement event. These URLs may include a protocol that is not suitable for the user. For instance, if SSH is specified, the user may not have SSH keys configured for the Git server.

+

+Privacy-conscious users often prefer to use unauthenticated HTTP for read operations and SSH for write operations.

+

+The git-remote-nostr plugin is designed to increase the likelihood of success by disregarding the protocol specified by the maintainer and using the following approach. It attempts to use the following protocols for read operations:

+

+- Unauthenticated HTTP

+- SSH

+- Authenticated HTTP

+

+For write operations, it tries:

+

+- SSH

+- Unauthenticated HTTP

+- Authenticated HTTP

+

+If the first protocol attempted fails but a subsequent one succeeds, all future attempts will default to the successful protocol.

+

+Some users may prefer a different configuration, such as using SSH for both read and write operations. They can achieve this by specifying ssh in the Nostr Git URL: `nostr://ssh/dan@gitworkshop.dev/ngit`.

+

+Additionally, users may want to use non-default SSH keys. The user for non-default SSH keys can be specified in the Nostr Git URL: `nostr://nym1@ssh/npub123/identifier`. In this case, NIP05 addresses cannot be used.

--

libgit2 1.8.1

OK, now I see the reason for the existence of the feature. I guess it's exactly the same for the protocol feature. (/ssh/https/)

For me it feels that this preference of the user belongs to the git config of the user instead of the remote URL.

This way the user could specify his githost-specific settings once in global git config, and use it automatically for new clones, too.