This commit is contained in:
Joey Hess 2024-11-19 14:26:47 -04:00
parent 6489342b71
commit aaba82f3c8
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 48 additions and 0 deletions

View file

@ -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.
"""]]

View file

@ -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.
"""]]