Commit Graph

195 Commits

Author SHA1 Message Date
Pavol Rusnak
d3efdcf0c3 remove elliptic.P224 usage
Fedora/RedHat distros comply with US patent law and remove this curve,
which makes it impossible to run ipfs with distro provided Golang.

License: MIT
Signed-off-by: Pavol Rusnak <stick@gk2.sk>
2015-08-03 16:41:10 +02:00
Jeromy
47cd70fa7d fix same test in swarm
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-22 16:15:50 -07:00
Jeromy
b60f494c1e fix race condition in notifications test
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-22 14:38:13 -07:00
Juan Benet
13d49d9abb Merge pull request #1471 from heems/master
add transport from netsim and bandwidth to mocknet
2015-07-19 23:36:25 -07:00
Jeromy
a4efe42567 make timing tests actually not run under CI
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-19 16:11:06 -07:00
Karthik Bala
0e597b3ae6 add transport logic to mocknet
License: MIT
Signed-off-by: Karthik Bala <karthikbala444@gmail.com>
2015-07-15 19:36:15 -07:00
Juan Batiz-Benet
cdb18d2833 Merge pull request #1473 from ipfs/godep-peerstream
update go-peerstream to newest version
2015-07-14 21:29:38 -07:00
Jeromy
a9c971fdbb update go-peerstream to newest version
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-14 16:23:30 -07:00
Jeromy
191ac62c12 making the daemon shutdown quicker
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-14 14:04:56 -07:00
Jeromy
a19ad97ea5 make ping its own protocol
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-13 19:19:25 -07:00
Juan Batiz-Benet
6e9c72ab37 expose internal/pb packages.
we shouldn't use internal packages.

License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-07-10 11:08:49 -07:00
rht
3daf749daa Make sure process context is set last
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-07-05 09:35:36 +07:00
rht
0ceac5ded9 Use WithContextAndTeardown whenever possible
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-07-05 09:19:06 +07:00
rht
007a12e7ef Change Process interface into object variable
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-07-04 22:50:23 +07:00
rht
330b213777 Replace ctxgroup.ContextGroup -> goprocess.Process
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-07-04 22:50:23 +07:00
Juan Batiz-Benet
0d42a6a7bc Merge pull request #1433 from ipfs/fix/addr-filter
add filters from config to addr filter in swarm
2015-07-02 17:00:36 -07:00
Lars Gierth
9c30b85180 swarm: fix peers_total metric
License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
2015-07-01 21:59:08 +02:00
Jeromy
7cc73f7b86 add command to manipulate address filters and a sharness test for them
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-06-30 18:25:34 -07:00
Jeromy
e7fd57f69a add filters from config to addr filter in swarm
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-06-30 15:03:56 -07:00
Lars Gierth
8b164f9e39 swarm: export ipfs_p2p_peers_total metric
License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
2015-06-30 16:32:46 +02:00
Juan Batiz-Benet
59d6a9a19c fix swarm notif tests
they were failing intermittently

License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-06-27 00:41:19 -07:00
Juan Batiz-Benet
f796615e10 mock: fix notif test
License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-06-27 00:18:12 -07:00
Juan Batiz-Benet
e37fefdfd3 daemon option to optionally disable secio
This commit adds an option to turn off all encryption. This is a mode
used for tests, debugging, achieving protocol implementation interop,
learning about how the protocol works (nc ftw), and worst case
networks which _demand_ to be able to snoop on all the traffic.
(sadly, there are some private intranets like this...). (We should
consider at least _signing_ all this traffic.)

Because of the severity of this sort of thing, this is an
all-or-nothing deal. Either encryption is ON or OFF _fully_.
This way, partially unencrypted nodes cannot be accidentally left
running without the user's understanding. Nodes without encrypted
connections will simply not be able to speak to any of the global
bootstrap nodes, or anybody in the public network.

License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-06-26 23:36:43 -07:00
Jeromy
0bf6b39caf filter incoming connections and add a test of functionality
- add extra check to dialblock test
- move filter to separate package
- also improved tests
- sunk filters down into p2p/net/conn/listener

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-06-23 01:30:16 -07:00
Jeromy
fbab2a7273 broke filters out into a struct
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-06-23 01:29:29 -07:00
Jeromy
e01f8e4f22 add in basic address dial filtering
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-06-23 01:29:29 -07:00
rht
78b6cc5f2d Replace Critical{,f} with Error{,f}
Except when there is an explicit os.Exit(1) after the Critical line,
then replace with Fatal{,f}.
golang's log and logrus already call os.Exit(1) by default with Fatal.

License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-06-18 10:03:57 +07:00
Juan Batiz-Benet
500bb51759 p2p/net/identify: clump addr observers into groups
Different mutliaddrs is not enough. Nodes may share transports.
NAT port mappings will likely only work on the base IP/TCP port
pair. We go one step further, and require different root (IP)
addrs. Just in case some NATs group by IP. In practice, this is
what we want: use addresses only if hosts that are on different
parts of the network have seen this address.
2015-06-07 17:00:56 -07:00
Juan Batiz-Benet
96ed20bffe p2p/protocol/identify: dont double count observers
If the same peer observed the same address twice, it would be
double counted as different observations. This change adds a map
to make sure we're counting each observer once.

This is easily extended to require more than two observations,
but i have not yet encountered NATs for whom this is relevant.
2015-06-07 16:48:02 -07:00
rht
e671ab2f42 Swap all 'crypto/rand' rng in tests with 'math/rand' 2015-06-03 18:12:34 +07:00
Jeromy
ef294431d4 move util.Key into its own package under blocks 2015-06-01 16:10:08 -07:00
Juan Batiz-Benet
ecdf14962c Merge pull request #1294 from rht/cleanup-tour
Cleanup tour
2015-05-29 16:59:17 -07:00
Henry
13a7d27b4c mdns: use my fork of hashicorp/mdns
upstream didn't respond to the request to update their dependencies
2015-05-29 01:30:44 +02:00
rht
3547f7ae33 Replace 'var * bytes.Buffer' with '\1 := new(bytes.Buffer)' 2015-05-26 23:18:04 +07:00
rht
ac7edddb94 Run 'gofmt -s -w' on these files 2015-05-19 06:11:15 +07:00
Juan Batiz-Benet
b84fa2b493 net/p2p + secio: parallelize crypto handshake
We had a very nasty problem: handshakes were serial so incoming
dials would wait for each other to finish handshaking. this was
particularly problematic when handshakes hung-- nodes would not
recover quickly. This led to gateways not bootstrapping peers
fast enough.

The approach taken here is to do what crypto/tls does:
defer the handshake until Read/Write[1]. There are a number of
reasons why this is _the right thing to do_:
- it delays handshaking until it is known to be necessary (doing io)
- it "accepts" before the handshake, getting the handshake out of the
  critical path entirely.
- it defers to the user's parallelization of conn handling. users
  must implement this in some way already so use that, instead of
  picking constants surely to be wrong (how many handshakes to run
  in parallel?)

[0] http://golang.org/src/crypto/tls/conn.go#L886
2015-05-12 05:54:09 -04:00
Dominic Tarr
e89e83f49e make comments describe what code actually does. 2015-05-06 15:33:26 +12:00
Juan Batiz-Benet
b71b7271c8 Merge pull request #1181 from ipfs/fix/mega-read
quick fix for OOM panic that has been plaguing us
2015-05-05 00:58:15 -04:00
Jeromy
517e2d121f quick fix for OOM panic that has been plaguing us 2015-05-01 23:24:47 -07:00
Juan Batiz-Benet
ea06ca0265 Merge pull request #1160 from ipfs/fix/dial-error-hiding
Fix/dial error hiding
2015-05-01 03:27:11 -07:00
Juan Batiz-Benet
e5bca45df5 Merge pull request #1165 from ipfs/fix/mdns-addr
advertise multiple addresses over mdns
2015-05-01 01:20:43 -07:00
Jeromy Johnson
c43b5c921d Update swarm_dial.go 2015-04-30 13:19:56 -07:00
Jeromy
5ecc4e890b use ALL THE ADDRESSES! 2015-04-29 01:02:45 -07:00
Jeromy
04f773166f dont advertise loopback address over mdns 2015-04-28 22:08:46 -07:00
Jeromy
194dc2bf7b bring some errors that were being hidden in the dial sequence to the surface 2015-04-28 13:57:15 -07:00
Henry
5fff7742f3 godeps: move (go)goprotobuf to github location 2015-04-28 13:42:22 +02:00
Henry
bdad3bae1e protocolEOF: demoted EOF to Debug, kept the else as Warning 2015-04-28 10:32:55 +02:00
Henry
ba9778131a only warn about io.EOF from mux.ReaderHeaders (fixes #1143) 2015-04-28 10:32:55 +02:00
Jeromy
cf478af971 cleanup changes from PR 2015-04-22 01:25:22 -07:00
Jeromy
001b7ab714 implement a config option for mdns 2015-04-22 00:55:31 -07:00