From aaba82f3c8946f04e5c2ea0a9e186634598138e8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 19 Nov 2024 14:26:47 -0400 Subject: [PATCH] comments --- ..._63806afed3ab03308584415506183ced._comment | 24 +++++++++++++++++++ ..._7ea1596e9c9c06ef609a8aa6bccefd29._comment | 24 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 doc/todo/p2phttp__58___reuse_credentials_for_repos_on_one_host/comment_2_63806afed3ab03308584415506183ced._comment create mode 100644 doc/todo/p2phttp__58___reuse_credentials_for_repos_on_one_host/comment_3_7ea1596e9c9c06ef609a8aa6bccefd29._comment diff --git a/doc/todo/p2phttp__58___reuse_credentials_for_repos_on_one_host/comment_2_63806afed3ab03308584415506183ced._comment b/doc/todo/p2phttp__58___reuse_credentials_for_repos_on_one_host/comment_2_63806afed3ab03308584415506183ced._comment new file mode 100644 index 0000000000..adee58f09b --- /dev/null +++ b/doc/todo/p2phttp__58___reuse_credentials_for_repos_on_one_host/comment_2_63806afed3ab03308584415506183ced._comment @@ -0,0 +1,24 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 2""" + date="2024-11-19T17:19:38Z" + content=""" +Unfortunately, remote.foo.annexUrl is not limited to use for p2phttp. It +existed before that and could be legitimately set to a http url when +p2phttp is not being used. + +I agree it would be good to try to reuse the credentials of the git url for +p2phttp. That could be done by just querying git credential for the git url +credentials, and trying to use them for the p2phttp url. If they don't work, +use git credential to prompt for the p2phttp url credentials as it does now. + +If the user had credential.helper configured, they would probably already +have the git credentials cached, and if not, this would cache them for +later use, so no harm done asking for them. But if credential.helper was +not configured, there would be an extra and wholly unncessary password +prompt. + +So, I think it makes sense to only do this when credential.helper is +configured. And when the hostname is the same in both the git url +and the p2phttp url. +"""]] diff --git a/doc/todo/p2phttp__58___reuse_credentials_for_repos_on_one_host/comment_3_7ea1596e9c9c06ef609a8aa6bccefd29._comment b/doc/todo/p2phttp__58___reuse_credentials_for_repos_on_one_host/comment_3_7ea1596e9c9c06ef609a8aa6bccefd29._comment new file mode 100644 index 0000000000..be11c10dfd --- /dev/null +++ b/doc/todo/p2phttp__58___reuse_credentials_for_repos_on_one_host/comment_3_7ea1596e9c9c06ef609a8aa6bccefd29._comment @@ -0,0 +1,24 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 3""" + date="2024-11-19T17:37:01Z" + content=""" +credential.useHttpPath is the relevant git config for this git-credential +behavior. + +I think it would be reasonable for git-annex to check if that is false, and +if so, remove the path from the `git credential` request for an annex+http +url. + +But I agree, it would be better, in the vast majority of cases, to have a +single url endpoint that serves multiple repositories. + +And for that matter, if someone is running git-annex p2phttp to serve 2 +different repositories right now, they are probably making the two listen +on different ports and so removing the path wouldn't help. They would have +to be interposing another web server that mapped those ports to paths, like +you have done with forgejo-aneksajo, for the path mangling to help. + +So implementing [[todo/p2phttp_serve_multiple_repositories]] +seems better than adding such path mangling. +"""]]