Joey Hess [Fri, 26 Jul 2024 23:50:15 +0000 (19:50 -0400)]
fix hang at end of PUT to proxied p2p http remote
sendExactly will now be sure to evaluate the whole lazy ByteString.
In this case, the lazy ByteString was exactly the right lenth.
But, it seems that L.take caused it to not actually be fully evaluated.
In servePut, this manifested as gather never being fully evaluated,
which caused the hang.
Very, very subtle, and horrible bug. Clearly the use of lazy ByteString
(or really just laziness) is at fault, and it would be very worth moving
to conduit or whatever to avoid this.
Joey Hess [Fri, 26 Jul 2024 21:15:09 +0000 (17:15 -0400)]
update
Joey Hess [Fri, 26 Jul 2024 20:34:08 +0000 (16:34 -0400)]
implement proxy connection pool
removeOldestProxyConnectionPool will be innefficient the larger the pool
is. A better data structure could be more efficient. Eg, make each value
in the pool include the timestamp of its oldest element, then the oldest
value can be found and modified, rather than rebuilding the whole Map.
But, for pools of a few hundred items, this should be fine. It's O(n*n log n)
or so.
Also, when more than 1 connection with the same pool key exists,
it's efficient even for larger pools, since removeOldestProxyConnectionPool
is not needed.
The default of 1 idle connection could perhaps be larger.. like the
number of jobs? Otoh, it seems good to ramp up and down the number of
connections, which does happen. With 1, there is at most one stale
connection, which might cause a request to fail.
Joey Hess [Fri, 26 Jul 2024 19:50:01 +0000 (15:50 -0400)]
closeP2PConnection on interrupted GET
Joey Hess [Fri, 26 Jul 2024 19:25:15 +0000 (15:25 -0400)]
clean up after http p2p proxy GET is interrupted
There was an annex worker thread that did not get stopped.
It was stuck in ReceiveMessage from the P2PHandleTMVar.
Fixed by making P2PHandleTMVar closeable.
In serveGet, releaseP2PConnection has to come first, else the
annexworker may not shut down, if it's waiting to read from it.
In proxyConnection, call closeRemoteSide in order to wait for the ssh
process (for example).
Joey Hess [Fri, 26 Jul 2024 17:57:28 +0000 (13:57 -0400)]
close proxy remote side when done with it
Joey Hess [Fri, 26 Jul 2024 17:55:14 +0000 (13:55 -0400)]
oops
Joey Hess [Fri, 26 Jul 2024 17:54:37 +0000 (13:54 -0400)]
oops
Joey Hess [Fri, 26 Jul 2024 17:39:43 +0000 (13:39 -0400)]
clean up protocol version for proxying
The proxy always checks the protocol version of a remote before talking
to it in a version-specific way, so the protocol version in the ProxyParams
is the client's protocol version. The remote will always be at the same or
an older protocol version than the client.
Note that in relayDATAFinish, when the client is at protocol version 0,
the remote must thus be as well, and that's why its version is not
checked in the case for that.
With that clarified, it's evident that, in P2P.Http.State, there's no
need to look at the proxied remote's protocol version at all.
Joey Hess [Fri, 26 Jul 2024 17:24:56 +0000 (13:24 -0400)]
fix setting protocol version for v0 server
Before it was leaving the protocol version at the default, when it
was actually v0.
v0 has only ever been used over tor, which is probably why this bug was
never noticed.
Joey Hess [Fri, 26 Jul 2024 16:49:06 +0000 (12:49 -0400)]
fix hang in GET from http p2p proxy
serverP2PConnection = proxyfromclientconn causes serveGet to
signalFullyConsumedByteString to it, which is what it's waiting for
Joey Hess [Fri, 26 Jul 2024 16:48:47 +0000 (12:48 -0400)]
improve comment
Joey Hess [Fri, 26 Jul 2024 15:01:45 +0000 (11:01 -0400)]
update
Joey Hess [Fri, 26 Jul 2024 14:24:23 +0000 (10:24 -0400)]
http p2p proxy is now largely working
Joey Hess [Fri, 26 Jul 2024 01:36:10 +0000 (21:36 -0400)]
remove some debugging
Joey Hess [Thu, 25 Jul 2024 19:39:57 +0000 (15:39 -0400)]
wip
Joey Hess [Thu, 25 Jul 2024 19:18:06 +0000 (15:18 -0400)]
use a record to reduce the huge number of parameters
Joey Hess [Thu, 25 Jul 2024 19:00:36 +0000 (15:00 -0400)]
factored out proxyRequest
This will allow the HTTP server to keep a connection to a proxied
remote open, and only enter the Annex monad when handling a client
request.
Joey Hess [Thu, 25 Jul 2024 17:15:05 +0000 (13:15 -0400)]
http server support for proxies, incomplete
Refactored git-annex-shell code so this can use checkCanProxy'.
At this point all that remains is opening a proxy connection,
and using a proxy connection.
Joey Hess [Thu, 25 Jul 2024 16:00:57 +0000 (12:00 -0400)]
use annex+http for accessing proxies
Doesn't work yet on the http server side, which is throwing 502 bad
gateway.
Joey Hess [Thu, 25 Jul 2024 14:12:59 +0000 (10:12 -0400)]
less indent
Joey Hess [Thu, 25 Jul 2024 14:11:09 +0000 (10:11 -0400)]
p2phttp drop supports checking proof timestamps
At this point the p2phttp implementation is fully complete!
Joey Hess [Thu, 25 Jul 2024 00:55:58 +0000 (20:55 -0400)]
add common parameters to generic get API
Honestly this was just done to make the documentation correct. There's
no point in using these parameters. And they're optional.
Joey Hess [Wed, 24 Jul 2024 19:12:16 +0000 (15:12 -0400)]
fix build without servant
Joey Hess [Wed, 24 Jul 2024 18:36:37 +0000 (14:36 -0400)]
testremote passes on p2phttp remote
Joey Hess [Wed, 24 Jul 2024 18:25:40 +0000 (14:25 -0400)]
expire lock after 10 minutes initially
Once keeplocked is called, the lock will expire at the end
of that call. But if keeplocked never gets called, this avoids
the lock persisting forever.
Joey Hess [Wed, 24 Jul 2024 17:42:57 +0000 (13:42 -0400)]
Remote.Git lockContent works with annex+http urls
Joey Hess [Wed, 24 Jul 2024 16:33:26 +0000 (12:33 -0400)]
Remote.Git removeKey works with annex+http urls
Does not yet handle drop proof lock timestamp checking.
Joey Hess [Wed, 24 Jul 2024 16:19:53 +0000 (12:19 -0400)]
update
Joey Hess [Wed, 24 Jul 2024 16:18:51 +0000 (12:18 -0400)]
update
Joey Hess [Wed, 24 Jul 2024 16:14:56 +0000 (12:14 -0400)]
progress meter for p2phttp storeKey
Joey Hess [Wed, 24 Jul 2024 16:05:10 +0000 (12:05 -0400)]
Remote.Git storeKey works with annex+http urls
Does not yet update progress meter.
Joey Hess [Wed, 24 Jul 2024 15:13:37 +0000 (11:13 -0400)]
update
Joey Hess [Wed, 24 Jul 2024 15:10:19 +0000 (11:10 -0400)]
more generic clientGet
Joey Hess [Wed, 24 Jul 2024 15:03:59 +0000 (11:03 -0400)]
fix slowloris timeout in hashing resume of download of large file
Hash the data that is already present in the file before connecting to
the http server.
Joey Hess [Wed, 24 Jul 2024 14:28:48 +0000 (10:28 -0400)]
fix meter display on resume
It still needs to be offset, otherwise on resume from 80% it will
display 1%..20%.
Seems that this bug must have affected P2P.Annex as well where it runs
this code, but apparently it didn't affect it in a very user-visible
way. Maybe the transfer log file was updated incorrectly?
Joey Hess [Wed, 24 Jul 2024 13:45:14 +0000 (09:45 -0400)]
Remote.Git retrieveKeyFile works with annex+http urls
This includes a bugfix to serveGet, it hung at the end.
Joey Hess [Wed, 24 Jul 2024 13:08:17 +0000 (09:08 -0400)]
factor out resumeVerifyFromOffset
Joey Hess [Wed, 24 Jul 2024 12:33:59 +0000 (08:33 -0400)]
avoid needing ifdefs when using P2P.Http.Client
Joey Hess [Wed, 24 Jul 2024 01:17:06 +0000 (21:17 -0400)]
Merge branch 'master' into httpproto
Joey Hess [Wed, 24 Jul 2024 01:16:56 +0000 (21:16 -0400)]
Propagate --force to git-annex transferrer
And other child processes.
Joey Hess [Wed, 24 Jul 2024 01:02:31 +0000 (21:02 -0400)]
bug
Joey Hess [Tue, 23 Jul 2024 22:45:02 +0000 (18:45 -0400)]
cache credentials for p2phttp in memory
Joey Hess [Tue, 23 Jul 2024 22:21:01 +0000 (18:21 -0400)]
remove uuid from url when calling git credential
The user doesn't want to see a uuid in the prompt.
Also, when a http server is proxying, multiple remotes will have the
same base url, and the same password will work for them all.
Joey Hess [Tue, 23 Jul 2024 22:11:15 +0000 (18:11 -0400)]
use git credential when p2phttp needs auth
Joey Hess [Tue, 23 Jul 2024 19:37:36 +0000 (15:37 -0400)]
p2phttp support https
Joey Hess [Tue, 23 Jul 2024 19:19:56 +0000 (15:19 -0400)]
add --bind option and listen to both ipv4 and ipv6 by default
Joey Hess [Tue, 23 Jul 2024 18:58:49 +0000 (14:58 -0400)]
protocol version fallback on 404
and prettified errors
Joey Hess [Tue, 23 Jul 2024 18:31:32 +0000 (14:31 -0400)]
Remote.Git checkpresent works with annex+http urls.
Joey Hess [Tue, 23 Jul 2024 18:12:03 +0000 (14:12 -0400)]
factor out http server and client into own modules
To avoid a cycle when Remote.Git uses the client.
Joey Hess [Tue, 23 Jul 2024 17:53:10 +0000 (13:53 -0400)]
started wiring p2phttp into Remote.Git
but we have a cycle, ugh
Joey Hess [Tue, 23 Jul 2024 16:30:27 +0000 (12:30 -0400)]
require a valid uuid at the end of an annex+http url
Joey Hess [Tue, 23 Jul 2024 13:55:14 +0000 (09:55 -0400)]
add remoteAnnexP2PHttpUrl to RemoveGitConfig
This is always parsed, when building without servant, a Baseurl is not
generated, and users of it will need to fail.
Joey Hess [Tue, 23 Jul 2024 13:12:21 +0000 (09:12 -0400)]
starting support for remote.name.annexUrl set to annex+http
In this case, Remote.Git should not use that url for all access to
the repository. It will only be used for annex operations, which isn't
done yet.
Joey Hess [Tue, 23 Jul 2024 12:53:56 +0000 (08:53 -0400)]
update servant build flag
make it work when building w/o assistant
Joey Hess [Tue, 23 Jul 2024 12:53:52 +0000 (08:53 -0400)]
update
Joey Hess [Tue, 23 Jul 2024 12:42:33 +0000 (08:42 -0400)]
annex+http urls
Joey Hess [Tue, 23 Jul 2024 01:19:32 +0000 (21:19 -0400)]
refactor
Joey Hess [Tue, 23 Jul 2024 01:19:20 +0000 (21:19 -0400)]
fix build
Joey Hess [Tue, 23 Jul 2024 00:59:45 +0000 (20:59 -0400)]
update
Joey Hess [Tue, 23 Jul 2024 00:44:48 +0000 (20:44 -0400)]
change default port to 9417
Port 80 would need root, not a good idea, so pick something that might
work by default.
9418 is git protocol's port. 9419 is used by something, but nothing
known uses 9417, so it's as good a default as any.
Joey Hess [Tue, 23 Jul 2024 00:37:37 +0000 (20:37 -0400)]
exit cleanly on eg, failure to bind socket
Joey Hess [Mon, 22 Jul 2024 23:50:08 +0000 (19:50 -0400)]
P2P protocol is finalized
Joey Hess [Mon, 22 Jul 2024 23:48:54 +0000 (19:48 -0400)]
make keeplocked client UUID optional
It's not used, but it makes the protocol simpler if this parameter can
always be sent.
Joey Hess [Mon, 22 Jul 2024 23:44:26 +0000 (19:44 -0400)]
locking over http basically working
Joey Hess [Mon, 22 Jul 2024 23:15:52 +0000 (19:15 -0400)]
make serveKeepLocked check auth just to be safe
Joey Hess [Mon, 22 Jul 2024 22:55:12 +0000 (18:55 -0400)]
implement clientLockContent
Joey Hess [Mon, 22 Jul 2024 21:36:56 +0000 (17:36 -0400)]
implemented serveLockContent (untested)
Joey Hess [Mon, 22 Jul 2024 20:56:44 +0000 (16:56 -0400)]
improve clientKeepLocked
Joey Hess [Mon, 22 Jul 2024 20:50:11 +0000 (16:50 -0400)]
variable name
Joey Hess [Mon, 22 Jul 2024 20:49:05 +0000 (16:49 -0400)]
refactor
Joey Hess [Mon, 22 Jul 2024 20:31:39 +0000 (16:31 -0400)]
finished clientGet validity checking
Joey Hess [Mon, 22 Jul 2024 20:23:08 +0000 (16:23 -0400)]
improve clientGet types
Joey Hess [Mon, 22 Jul 2024 19:48:46 +0000 (15:48 -0400)]
fix TMVar left full crash affecting servePutOffset
Problem is that whatever is reading from the TMVar may not have read
from it yet before the client writes the next thing to it.
Joey Hess [Mon, 22 Jul 2024 19:02:08 +0000 (15:02 -0400)]
implemented servePutOffset and clientPutOffset
But, it's buggy: the server hangs without processing the VALIDITY,
and I can't seem to work out why. As far as I can see, storefile
is getting as far as running the validitycheck, which is supposed to
read that, but never does.
This is especially strange because what seems like the same protocol
doesn't hang when servePut runs it. This made me think that it needed
to use inAnnexWorker to be more like servePut, but that didn't help.
Another small problem with this is that it does create an empty
.git/annex/tmp/ file for the key. Since this will usually be used in
combination with servePut, that doesn't seem worth worrying about much.
Joey Hess [Mon, 22 Jul 2024 17:12:15 +0000 (13:12 -0400)]
fix crash in servePut when client sends from too high offset
Have to consume all the content from the client, but force an Invalid
result, so it will just get discarded.
Joey Hess [Mon, 22 Jul 2024 16:50:21 +0000 (12:50 -0400)]
clientPut seeking to offset
Joey Hess [Mon, 22 Jul 2024 16:30:30 +0000 (12:30 -0400)]
avoid padding in servePut
This means that when the client sends a truncated data to indicate
invalidity, DATA is not passed the full expected data. That leaves the
P2P connection in a state where it cannot be reused. While so far, they
are not reused, they will be later when proxies are supported. So, have
to close the P2P connection in this situation.
Joey Hess [Mon, 22 Jul 2024 15:47:24 +0000 (11:47 -0400)]
avoid padding in clientPut
Instead truncate when necessary to indicate invalid content was sent.
Very similar to how serveGet handles it.
Joey Hess [Mon, 22 Jul 2024 15:26:22 +0000 (11:26 -0400)]
fix releasing of p2p connection
Joey Hess [Mon, 22 Jul 2024 15:19:52 +0000 (11:19 -0400)]
avoid padding content in serveGet
Always truncate instead. The padding risked something not noticing the
content was bad and getting a file that was corrupted in a novel way
with the padding "X" at the end. A truncated file is better.
Joey Hess [Mon, 22 Jul 2024 14:20:18 +0000 (10:20 -0400)]
servePut and clientPut implementation
Made the data-length header required even for v0. This simplifies the
implementation, and doesn't preclude extra verification being done for
v0.
The connectionWaitVar is an ugly hack. In servePut, nothing waits
on the waitvar, and I could not find a good way to make anything wait on
it.
adehnert [Sun, 21 Jul 2024 19:08:45 +0000 (19:08 +0000)]
Added a comment: git-annex for managing music
adehnert [Sun, 21 Jul 2024 18:17:25 +0000 (18:17 +0000)]
adehnert [Sun, 21 Jul 2024 18:17:11 +0000 (18:17 +0000)]
adehnert [Sun, 21 Jul 2024 18:15:11 +0000 (18:15 +0000)]
adehnert [Sun, 21 Jul 2024 18:14:28 +0000 (18:14 +0000)]
adehnert [Sun, 21 Jul 2024 18:14:03 +0000 (18:14 +0000)]
m.risse@77eac2c22d673d5f10305c0bade738ad74055f92 [Sun, 21 Jul 2024 12:38:12 +0000 (12:38 +0000)]
Added a comment
adehnert [Sun, 21 Jul 2024 01:04:44 +0000 (01:04 +0000)]
Added a comment: `git annex sync --ff-only`
nobodyinperson [Fri, 19 Jul 2024 15:21:19 +0000 (15:21 +0000)]
Added a comment: Also Serveo.net
kdm9 [Fri, 19 Jul 2024 13:11:05 +0000 (13:11 +0000)]
Added a comment
m.risse@77eac2c22d673d5f10305c0bade738ad74055f92 [Fri, 19 Jul 2024 12:12:56 +0000 (12:12 +0000)]
m.risse@77eac2c22d673d5f10305c0bade738ad74055f92 [Fri, 19 Jul 2024 08:26:31 +0000 (08:26 +0000)]
Added a comment
m.risse@77eac2c22d673d5f10305c0bade738ad74055f92 [Wed, 17 Jul 2024 14:07:32 +0000 (14:07 +0000)]
Added a comment
yarikoptic [Tue, 16 Jul 2024 15:58:50 +0000 (15:58 +0000)]
reporting FTBFS on windows
m.risse@77eac2c22d673d5f10305c0bade738ad74055f92 [Tue, 16 Jul 2024 15:42:54 +0000 (15:42 +0000)]
mih [Tue, 16 Jul 2024 15:02:46 +0000 (15:02 +0000)]
m.risse@77eac2c22d673d5f10305c0bade738ad74055f92 [Tue, 16 Jul 2024 09:21:54 +0000 (09:21 +0000)]
Added a comment
nobodyinperson [Mon, 15 Jul 2024 18:32:36 +0000 (18:32 +0000)]
Added a comment