]> dgit.raspbian.org Git - git-annex.git/commitdiff
a local git remote cannot proxy
authorJoey Hess <joeyh@joeyh.name>
Wed, 12 Jun 2024 14:16:04 +0000 (10:16 -0400)
committerJoey Hess <joeyh@joeyh.name>
Wed, 12 Jun 2024 14:16:04 +0000 (10:16 -0400)
Prevent listProxied from listing anything when the proxy remote's
url is a local directory. Proxying does not work in that situation,
because the proxied remotes have the same url, and so git-annex-shell
is not run when accessing them, instead the proxy remote is accessed
directly.

I don't think there is any good way to support this. Even if the instantiated
git repos for the proxied remotes somehow used an url that caused it to use
git-annex-shell to access them, planned features like `git-annex copy --to
proxy` accepting a key and sending it on to nodes behind the proxy would not
work, since git-annex-shell is not used to access the proxy.

So it would need to use something to access the proxy that causes
git-annex-shell to be run and speaks P2P protocol over it. And we have that.
It's a ssh connection to localhost. Of course, it would be possible to
take ssh out of that mix, and swap in something that does not have
encryption overhead and authentication complications, but otherwise
behaves the same as ssh. And if the user wants to do that, GIT_SSH
does exist.

Remote/Git.hs
doc/todo/git-annex_proxies.mdwn

index 60382f1563ed1639841ac73d80ebdcfb93a33628..0d7356c26b5b9cff260d04861c41e722b244789f 100644 (file)
@@ -855,9 +855,12 @@ listProxied proxies rs = concat <$> mapM go rs
                        Git.ConfigKey proxyconfigprefix = remoteConfig proxyname mempty
 
        -- Git remotes that are gcrypt or git-lfs special remotes cannot
-       -- proxy. Proxing is also not yet supported for remotes using P2P
+       -- proxy. Local git remotes cannot proxy either because
+       -- git-annex-shell is not used to access a local git url.
+       -- Proxing is also yet supported for remotes using P2P
        -- addresses.
        canproxy gc r
                | remoteAnnexGitLFS gc = False
                | Git.GCrypt.isEncrypted r = False
+               | Git.repoIsLocal r || Git.repoIsLocalUnknown r = False
                | otherwise = isNothing (repoP2PAddress r)
index d6e5fcb80aada99a782a607bc46269999349c2eb..f03a784f9a8b4578be097311b107987a94b3756c 100644 (file)
@@ -36,12 +36,6 @@ For June's work on [[design/passthrough_proxy]], implementation plan:
 
 2. Remote instantiation for proxies. (done)
 
-4. Prevent listProxied from listing anything when the proxy remote's
-   url is a local directory. Proxying does not work in that situation,
-   because the proxied remotes have the same url, and so git-annex-shell
-   is not run when accessing them, instead the proxy remote is accessed
-   directly.
-
 3. Implement git-annex-shell proxying for CONNECT and NOTIFYCHANGES.
    (For completeness, they will only be used when using tor-annex
    to access a proxy.)