Commit graph

29186 commits

Author SHA1 Message Date
Alper Nebi Yasak
93a22a1c97
Remove http-conduit (<2.2.0) constraint
Since https://github.com/aristidb/aws/issues/206 is resolved, this
constraint is no longer necessary. However, http-conduit (>=2.2.0)
requires http-client (>=0.5.0) which introduces some breaking changes.
This commit also implements those changes depending on the version.
Fixes: https://git-annex.branchable.com/bugs/Build_with_aws_head_fails/

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2016-12-10 10:45:52 -04:00
alpernebbi
bbc5e4f4f3 Added a comment: Patch to fix aws head build issue 2016-12-10 13:08:58 +00:00
0xloem@0bd8a79a57e4f0dcade8fc81d162c37eae4d6730
efa71e70a4 Added a comment: Corrupt Links Produced, Significant Data Loss 2016-12-10 12:31:32 +00:00
alpernebbi
d07a85e74e Added a comment 2016-12-10 07:36:04 +00:00
Joey Hess
fa1b3a19f9
hang up connection after relaying
Seems that git upload-pack outputs a "ONCDN " that is not read by the
remote git receive-pack. This fixes:

[2016-12-09 17:08:32.77159731] P2P > ERROR protocol parse error: "ONCDN "
2016-12-09 17:11:16 -04:00
Joey Hess
b65780778a
update 2016-12-09 17:07:32 -04:00
Joey Hess
725b8a5e14
fix uuid comparison 2016-12-09 17:02:59 -04:00
Joey Hess
52ccd44812
avoid exposing auth tokens in debug 2016-12-09 16:55:48 -04:00
Joey Hess
e71755abc9
devblog 2016-12-09 16:46:37 -04:00
Joey Hess
217c3b0a21
debug dump P2P messages 2016-12-09 16:45:36 -04:00
Joey Hess
9dd510bf29
make tor hidden service work when directory watching is not available
Avoid crashing when built w/o inotify..
2016-12-09 16:40:47 -04:00
Joey Hess
8ac4126bd2
cleanup 2016-12-09 16:22:06 -04:00
Joey Hess
c51d7dbf67
bump maxConnections to 100
10 seemed too low because more than 10 friends could be linked to a repo
over tor, and if all were running the remotedaemon, which makes a
persistent connection for change notification, then the 11th friend
would not be able to access that repo.

100 might be too low, but it's a much larger group of people. And at
that size group, it probably makes sense to structure the network so
that 100 peers are not all trying to access one central node.
2016-12-09 16:03:25 -04:00
Joey Hess
2c907fff51
remotedaemon: git change detection over tor hidden service 2016-12-09 16:02:43 -04:00
Joey Hess
f7687e0876
only start ref change watcher thread once per P2P connection
This is more efficient. Note that the peer will get CHANGED messages for
all refs changed since the connection opened, even if those changes
happened before it sent NOTIFYCHANGE.
2016-12-09 15:08:54 -04:00
Joey Hess
e152c322f8
refactor ref change watching
Added to change notification to P2P protocol.

Switched to a TBChan so that a single long-running thread can be
started, and serve perhaps intermittent requests for change
notifications, without buffering all changes in memory.

The P2P runner currently starts up a new thread each times it waits
for a change, but that should allow later reusing a thread. Although
each connection from a peer will still need a new watcher thread to run.

The dependency on stm-chans is more or less free; some stuff in yesod
uses it, so it was already indirectly pulled in when building with the
webapp.

This commit was sponsored by Francois Marier on Patreon.
2016-12-09 15:01:09 -04:00
Joey Hess
596e1685a6
update 2016-12-09 13:38:50 -04:00
Joey Hess
15be5c04a6
git-annex-shell, remotedaemon, git remote: Fix some memory DOS attacks.
The attacker could just send a very lot of data, with no \n and it would
all be buffered in memory until the kernel killed git-annex or perhaps OOM
killed some other more valuable process.

This is a low impact security hole, only affecting communication between
local git-annex and git-annex-shell on the remote system. (With either
able to be the attacker). Only those with the right ssh key can do it. And,
there are probably lots of ways to construct git repositories that make git
use a lot of memory in various ways, which would have similar impact as
this attack.

The fix in P2P/IO.hs would have been higher impact, if it had made it to a
released version, since it would have allowed DOSing the tor hidden
service without needing to authenticate.

(The LockContent and NotifyChanges instances may not be really
exploitable; since the line is read and ignored, it probably gets read
lazily and does not end up staying buffered in memory.)
2016-12-09 13:34:32 -04:00
Joey Hess
3d759a0322
debug on error serving peer 2016-12-09 13:00:19 -04:00
Joey Hess
58f5d41cac
fix 2016-12-09 12:56:38 -04:00
Joey Hess
0f3a3ff1e5
make clear that log is only updated after successful removal
This does not change behavior, because an exception is thrown on
unsuccessful removal. But is clearer.
2016-12-09 12:54:18 -04:00
Joey Hess
bdf2a31424
typo 2016-12-09 12:54:12 -04:00
Joey Hess
71e8cd408e
content removal is supposed to succed if the content was already not present 2016-12-09 12:48:22 -04:00
Joey Hess
ca1bcdcd7c
improve warning on connection loss 2016-12-09 12:35:45 -04:00
Joey Hess
9c5c24aa0a
todo 2016-12-08 20:55:46 -04:00
Joey Hess
e84165dc5e
more todo 2016-12-08 20:15:12 -04:00
Joey Hess
38516b2fca
update progress logs in remotedaemon send/receive 2016-12-08 19:56:02 -04:00
Joey Hess
1f3ed1b6b2
avoid remotedaemon outputting misc Messages when running
It's a daemon or is communictaing with the assistant over stdio, so
should not display checksum messages etc while serving the P2P protocol
etc.
2016-12-08 18:42:59 -04:00
Joey Hess
0f4ee4f298
fix memory leak
I'm unsure why this fixed it, but it did. Seems to suggest that the
memory leak is not due to a bug in my code, but that ghc didn't manage
to take full advantage of laziness, or was failing to gc something it
could have.
2016-12-08 18:42:52 -04:00
Joey Hess
095593a9af
correction 2016-12-08 18:25:51 -04:00
Joey Hess
3b9f6c1b2b
analysis 2016-12-08 17:50:59 -04:00
Joey Hess
5654085e7a
profiling 2016-12-08 17:34:26 -04:00
Joey Hess
41ed0770df
consistent caps 2016-12-08 17:17:01 -04:00
Joey Hess
da8c65601f
comment 2016-12-08 17:12:02 -04:00
Joey Hess
8e00efb938
didn't mean to commit this change yet 2016-12-08 17:10:48 -04:00
Joey Hess
43e7044b43
comment 2016-12-08 17:10:24 -04:00
Joey Hess
0288e934cc
update instructions to work better 2016-12-08 16:55:40 -04:00
Joey Hess
b8fea9f08d
we have a memory leak 2016-12-08 16:35:33 -04:00
Joey Hess
d8f1a0d95c
move byteable to main dep list
Only the webapp had pulled it in, but the authtoken code uses it now.
2016-12-08 16:31:08 -04:00
Joey Hess
2ad06ded7e
force sofar calculation
This could avoid a memory leak. It would only happen when
the meter didn't look at sofar.
2016-12-08 16:28:07 -04:00
Joey Hess
c6972cb914
better format error 2016-12-08 16:02:26 -04:00
Joey Hess
39b7eb7350
update 2016-12-08 16:00:29 -04:00
Joey Hess
23438fb80f
move to debug 2016-12-08 15:56:36 -04:00
Joey Hess
af41519126
convert P2P runners from Maybe to Either String
So we get some useful error messages when things fail.

This commit was sponsored by Peter Hogg on Patreon.
2016-12-08 15:47:49 -04:00
Joey Hess
c05f4eb631
fix laziness problem in git relaying
The switch to hGetMetered subtly changed the laziness of how DATA was
read, and broke git protocol relaying. Fix by sending received data to
the git process's stdin immediately, which ensures that the lazy
bytestring is all read from the peer before going on to process the next
message from the peer.
2016-12-08 15:15:29 -04:00
Joey Hess
e56506d83c
include error message when unable to connect to peer 2016-12-08 14:14:08 -04:00
Joey Hess
b613ccf7a3
update 2016-12-08 13:58:11 -04:00
Joey Hess
df67626cb7
fix build with old ghc 2016-12-08 13:58:03 -04:00
Joey Hess
44c55e2441
fix links 2016-12-07 16:11:30 -04:00
Joey Hess
0766d032bf
link to git-annex-metadata-gui 2016-12-07 16:09:30 -04:00