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

Reply to this note

Please Login to reply.

Discussion

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.

I can see that argument but some users are very used to setting the protocol in the git url. eg:

```

git remote set-url origin nostr://dan@gitworkshop.dev/identifier

git remote set-url --push origin nostr://nym1@ssh/npub/identifier

````

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.

You are right, in that the same protocol (and ssh user) will get used for every git server. I'd be surprised if a different ssh user is used for different git servers thatnhave the same repository.