p2p --link now defaults to setting up a bi-directional link
authorJoey Hess <joeyh@joeyh.name>
Fri, 16 Dec 2016 20:32:29 +0000 (16:32 -0400)
committerJoey Hess <joeyh@joeyh.name>
Fri, 16 Dec 2016 20:38:06 +0000 (16:38 -0400)
commit3037feb1bf9ae9c857b45191309965859b23b0b6
treeba966f1f26ef4580a4dacee5512e05fb8e47f83d
parente67a310da1961336789474b39ec8cbeb6a7d0dec
p2p --link now defaults to setting up a bi-directional link

Both the local and remote git repositories get remotes added
pointing at one-another.

Makes pairing twice as easy!

Security: The new LINK command in the protocol can be sent repeatedly,
but only by a peer who has authenticated with us. So, it's entirely safe to
add a link back to that peer, or to some other peer it knows about.
Anything we receive over such a link, the peer could send us over the
current connection.

There is some risk of being flooded with LINKs, and adding too many
remotes. To guard against that, there's a hard cap on the number of remotes
that can be set up this way. This will only be a problem if setting up
large p2p networks that have exceptional interconnectedness.

A new, dedicated authtoken is created when sending LINK.

This also allows, in theory, using a p2p network like tor, to learn about
links on other networks, like telehash.

This commit was sponsored by Bruno BEAUFILS on Patreon.
CHANGELOG
Command/P2P.hs
P2P/Address.hs
P2P/Annex.hs
P2P/Protocol.hs
doc/git-annex-p2p.mdwn
doc/tips/peer_to_peer_network_with_tor.mdwn