You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Interestingly, git-annex is sending an Authorization header, and it looks like it's leaning on git credential so so it's git doing the prompting, which is nice and elegant. So maybe uploading over HTTP does work afterall.
But this part of the protocol isn't documented on the wiki, or at least I don't want to waste my time trying to find my way around that place. But I bet we have enough here to reverse engineer it; it looks like the first thing it needs is a response to a HEAD request, presumably checking if the file already exists or not; so we'll have to add another route for that, and once we do that maybe it'll send a POST or a PUT request to actually upload the file, and we'll have to add a route for that too. And then it should be done 🤞
I tried again to get this working for a few hours but no matter what I tried I couldn't convince git-annex to do it.
I learnt it issues a HEAD request for each file. If that returns 200, and the Content-Length matches the expected size, it says "ok". Otherwise, it says "not found". It never tries to issue a PUT or a POST. So I doubt this is supported.
I suspect it's a result of there being no server in the world that it could possibly be tested against. GitHub doesn't support it, Apache doesn't support PUTs, GitLab probably doesn't either. If we added annex HTTP uploading support we'd be the first, probably.
I'll put in a feature request and see what joeyh says.
There is no "one true way" to upload a file to a HTTP server.
I don't want to add some additional git-annex specific HTTP-based protocol.
(I lightly disagree: the One True Way is PUT + an Authorization: header, which is just what S3 uses, and what Gitea could easily support. But if the code doesn't exist it doesn't exist.)
Activity
kousu commentedon May 8, 2022
Using a test repo at https://data.praxisinstitute.org.dev.neuropoly.org/uofc/CANDICE-fMRI-, which is currently running the patch for #3, download anonymously:
git clone ... && git annex get
then construct an new annexed file:
prove it's distinct (it's the last one, the one with 1 copy):
git annex whereis
and now see what happens if we try to upload it; with debugging turned on:
git annex copy --to origin
Interestingly, git-annex is sending an Authorization header, and it looks like it's leaning on
git credential
so so it'sgit
doing the prompting, which is nice and elegant. So maybe uploading over HTTP does work afterall.But this part of the protocol isn't documented on the wiki, or at least I don't want to waste my time trying to find my way around that place. But I bet we have enough here to reverse engineer it; it looks like the first thing it needs is a response to a HEAD request, presumably checking if the file already exists or not; so we'll have to add another route for that, and once we do that maybe it'll send a POST or a PUT request to actually upload the file, and we'll have to add a route for that too. And then it should be done 🤞
kousu commentedon Sep 20, 2022
I tried again to get this working for a few hours but no matter what I tried I couldn't convince git-annex to do it.
I learnt it issues a HEAD request for each file. If that returns 200, and the Content-Length matches the expected size, it says "ok". Otherwise, it says "not found". It never tries to issue a PUT or a POST. So I doubt this is supported.
I suspect it's a result of there being no server in the world that it could possibly be tested against. GitHub doesn't support it, Apache doesn't support PUTs, GitLab probably doesn't either. If we added annex HTTP uploading support we'd be the first, probably.
I'll put in a feature request and see what joeyh says.
[-]Support `git annex sync --content`/`git annex copy --to` over http(s):// [/-][+]Support uploading over http(s):// [/+]kousu commentedon Sep 20, 2022
Feature request/request for clarification: https://git-annex.branchable.com/forum/HTTP_uploads/?updated
kousu commentedon Sep 23, 2022
This is a wontfix:
(I lightly disagree: the One True Way is
PUT
+ anAuthorization:
header, which is just what S3 uses, and what Gitea could easily support. But if the code doesn't exist it doesn't exist.)179 remaining items