Commit graph

28992 commits

Author SHA1 Message Date
Joey Hess
ae69ebfc7c
try to gather scattered writes
git upload-pack makes some uncessary writes in sequence, this tries to
gather them together to avoid needing to send multiple DATA packets when
just one will do.

In a small pull, this reduces the average number of DATA packets from
4.5 to 2.5.
2016-11-21 20:56:58 -04:00
Joey Hess
9c311fb564
fix parse of CONNECTDONE 2016-11-21 19:33:57 -04:00
Joey Hess
6b992f672c
pull/push over tor working now
Still a couple bugs:

* Closing the connection to the server leaves git upload-pack /
  receive-pack running, which could be used to DOS.

* Sometimes the data is transferred, but it fails at the end, sometimes
  with:

  git-remote-tor-annex: <socket: 10>: commitBuffer: resource vanished (Broken pipe)

  Must be a race condition around shutdown.
2016-11-21 19:24:55 -04:00
Joey Hess
070fb9e624
Added git-remote-tor-annex, which allows git pull and push to the tor hidden service.
Almost working, but there's a bug in the relaying.

Also, made tor hidden service setup pick a random port, to make it harder
to port scan.

This commit was sponsored by Boyd Stephen Smith Jr. on Patreon.
2016-11-21 17:27:38 -04:00
Joey Hess
9cf9ee73f5
improve p2p protocol implementation
Tested it in ghci a little now.
2016-11-20 16:42:18 -04:00
Joey Hess
74691ddf0e
remotedaemon: serve tor hidden service 2016-11-20 15:48:12 -04:00
Joey Hess
a101b8de37
remotedaemon: Fork to background by default. Added --foreground switch to enable old behavior.
Groundwork for tor hidden services, which the remotedaemon will serve.
2016-11-20 14:50:36 -04:00
Joey Hess
d50b0f3bb3
implement p2p protocol for Handle
This is most of the way to having the p2p protocol working over tor
hidden services, at least enough to do git push/pull.

The free monad was split into two, one for network operations and the
other for local (Annex) operations. This will allow git-remote-tor-annex
to run only an IO action, not needing the Annex monad.

This commit was sponsored by Remy van Elst on Patreon.
2016-11-20 12:16:32 -04:00
Joey Hess
0eaad7ca3a
extend p2p protocol to support gitremote-helpers connect
A bit tricky since Proto doesn't support threads. Rather than adding
threading support to it, ended up using a callback that waits for both
data on a Handle, and incoming messages at the same time.

This commit was sponsored by Denis Dzyubenko on Patreon.
2016-11-19 22:39:36 -04:00
Joey Hess
9d9d1fdcd4
Merge branch 'master' into tor 2016-11-18 20:05:34 -04:00
Joey Hess
c45ec7b819
add news item for git-annex 6.20161118 2016-11-18 12:00:20 -04:00
Joey Hess
5680565122
releasing package git-annex version 6.20161118 2016-11-18 11:59:49 -04:00
Joey Hess
50ad13b809
comment 2016-11-18 11:40:52 -04:00
yomguy
0a34f08ad9 Added a comment 2016-11-18 14:00:51 +00:00
openmedi
fe556ced50 2016-11-18 13:57:49 +00:00
openmedi
4baae17fa4 Added a comment 2016-11-18 12:03:44 +00:00
Joey Hess
73a6b9b514
Add content locking to P2P protocol
Is content locking needed in the P2P protocol? Based on re-reading
bugs/concurrent_drop--from_presence_checking_failures.mdwn,
I think so: Peers can form cycles, and multiple peers can all be trying
to drop the same content.

So, added content locking to the protocol, with some difficulty.

The implementation is fine as far as it goes, but note the warning
comment for lockContentWhile -- if the connection to the peer is dropped
unexpectedly, the peer will then unlock the content, and yet the local
side will still think it's locked.

To be honest I'm not sure if Remote.Git's lockKey for ssh remotes
doesn't have the same problem. It checks that the
"ssh remote git-annex-shell lockcontent"
process has not exited, but if the connection closes afer that check,
the lockcontent command will unlock it, and yet the local side will
still think it's locked.

Probably this needs to be fixed by eg, making lockcontent catch any
execptions due to the connection closing, and in that case, wait a
significantly long time before dropping the lock.

This commit was sponsored by Anthony DeRobertis on Patreon.
2016-11-18 01:32:24 -04:00
Joey Hess
236ff111a7
rename 2016-11-17 22:10:28 -04:00
Joey Hess
b121078b35
refactor 2016-11-17 22:09:07 -04:00
Joey Hess
27c8a4a229
add CHECKPRESENT
Using SUCCESS to mean the content is present and FAILURE to mean it's not.
2016-11-17 21:56:02 -04:00
Joey Hess
cbffb61083
added REMOVE to protocol 2016-11-17 21:48:59 -04:00
Joey Hess
2b33452bd8
add ALREADY-HAVE response to PUT 2016-11-17 21:37:49 -04:00
Joey Hess
47b7028d7c
pass Len to writeKeyFile so it can detect short reads 2016-11-17 21:32:09 -04:00
Joey Hess
505d1df8ab
refactor 2016-11-17 21:04:35 -04:00
Joey Hess
ae403be24b
avoid setPresent when sending to a peer
This mirrors how git-annex-shell works; recvKey updates location
tracking, but sendKey does not.
2016-11-17 20:54:14 -04:00
Joey Hess
65e903397c
implementation of peer-to-peer protocol
For use with tor hidden services, and perhaps other transports later.

Based on Utility.SimpleProtocol, it's a line-based protocol,
interspersed with transfers of bytestrings of a specified size.

Implementation of the local and remote sides of the protocol is done
using a free monad. This lets monadic code be included here, without
tying it to any particular way to get bytes peer-to-peer.

This adds a dependency on the haskell package "free", although that
was probably pulled in transitively from other dependencies already.

This commit was sponsored by Jeff Goeke-Smith on Patreon.
2016-11-17 18:30:50 -04:00
Joey Hess
776b13c3c4
Merge branch 'master' of ssh://git-annex.branchable.com 2016-11-17 17:20:25 -04:00
Joey Hess
f3ea75a74c
devblog 2016-11-17 17:19:53 -04:00
andrew
9cc869e583 Added a comment: git annex copy --auto --to cloud works 2016-11-17 17:49:28 +00:00
Joey Hess
e830285431
Merge branch 'master' into tor 2016-11-17 13:40:01 -04:00
Joey Hess
6a5592c05f
avoid tab warnings from ghc 8 2016-11-17 13:39:30 -04:00
Joey Hess
95916b2ecf
Merge branch 'master' into tor 2016-11-17 12:56:27 -04:00
andrew
50836695b7 Added a comment: RESOLVED 2016-11-17 14:59:15 +00:00
db48x
95b5afb706 2016-11-17 04:00:18 +00:00
luckcolorsgoo@ab4f3c1c44a7dbcbcb9d9a29315b59ad524ceaaa
8ac3b30ca0 Added a comment 2016-11-16 22:56:46 +00:00
Joey Hess
9cc9bd8a10
Merge branch 'master' of ssh://git-annex.branchable.com 2016-11-16 18:06:44 -04:00
Joey Hess
aedec5d08d
arm build uses 32kb page size
(Change was made in gitannexbuilder scripts not here.)
2016-11-16 18:05:42 -04:00
https://anarc.at/openid/
c9d51f6064 Added a comment: how about reusing the special remote protocol? 2016-11-16 21:58:08 +00:00
Joey Hess
2e4edee607
Merge branch 'master' of ssh://git-annex.branchable.com 2016-11-16 16:18:11 -04:00
Joey Hess
c8a0eb03a5
devblog 2016-11-16 16:17:09 -04:00
Joey Hess
10703dc817
improve comment 2016-11-16 16:03:23 -04:00
Joey Hess
2577f1c0a2
fsck --all --from was checking the content of files in the local repository, rather than on the special remote.
Straight up forgot to handle this case!

This commit was sponsored by Fernando Jimenez on Patreon.
2016-11-16 15:33:57 -04:00
Joey Hess
b4b970d5f2
moreinfo needed 2016-11-16 15:12:46 -04:00
Joey Hess
bd4cf0f663
comment 2016-11-16 15:01:49 -04:00
Joey Hess
2f192583ba
comment 2016-11-16 14:49:47 -04:00
Joey Hess
b868e931a6
moreinfo 2016-11-16 14:43:45 -04:00
Joey Hess
1b71d920e4
comment 2016-11-16 14:43:33 -04:00
Joey Hess
d7b8be75a4
comment 2016-11-16 14:40:28 -04:00
Joey Hess
6d1039822e
already fixed 2016-11-16 14:35:22 -04:00
Joey Hess
681a4e5a58
comment 2016-11-16 14:33:33 -04:00