Commit Graph

3996 Commits

Author SHA1 Message Date
Christian Couder
ad67f18dc8 t0130: small improvements
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-04-26 17:26:51 +02:00
Juan Batiz-Benet
cb6c743545 Merge pull request #1137 from AtnNn/init
Mention correct key size in help for init
2015-04-24 22:16:08 -07:00
Etienne Laurin
930cd8ea5d Mention correct key size in help for init 2015-04-25 04:43:23 +00:00
Juan Batiz-Benet
31d64e6b26 Merge pull request #1133 from ipfs/fix/ipns-startup
Add timeout to ipns resolution at startup
2015-04-24 21:02:42 -07:00
Jeromy
93b06f3469 Add timeout to ipns resolution at startup 2015-04-24 11:47:56 -07:00
Juan Batiz-Benet
1d5f68cdc6 godep: vendor correctly.
I'm so sick of this absolute crap. It goes wrong all the time.
I want to get off godeps soon. But for now, let's **please**
setup a test on travis that exercises all sorts of godep things
to avoid merging anything that will break.

Maybe we can fail the build if any library is NOT vendored.
2015-04-23 13:30:42 -07:00
Jeromy Johnson
83ca01540a Merge pull request #1114 from ipfs/test/3node-sharness
add clone of 3node test using iptb instead of docker
2015-04-22 22:52:31 -07:00
Jeromy
89ff6dfdaa add clone of 3node test using iptb instead of docker
rename directory and update vendored dep

cleanup
2015-04-22 21:25:52 -07:00
Juan Batiz-Benet
0c4da2d561 Merge pull request #1124 from ipfs/fix/logging-stack
fix log callstack for log messages
2015-04-22 19:33:56 -07:00
Jeromy
5aea206734 fix log callstack for log messages 2015-04-22 17:11:53 -07:00
Jeromy Johnson
b207672480 Merge pull request #1115 from dylanPowers/completion-doc
Instructions for installing command completion
2015-04-22 14:27:18 -07:00
Dylan Powers
e21bd8e877 docs: Probably helpful to link to the completion script 2015-04-22 11:39:42 -07:00
Dylan Powers
08c15e4349 docs: Add completion instructions that don't require go 2015-04-22 11:35:31 -07:00
Dylan Powers
380ee4a535 docs: Command-completion additional refs section 2015-04-22 11:35:31 -07:00
Dylan Powers
d6d038bf3a docs: Check if GOPATH exists before sourcing command-completion 2015-04-22 11:35:31 -07:00
Dylan Powers
71e8919101 Instructions for installing command completion in Linux bash 2015-04-22 11:35:31 -07:00
Jeromy
94df8f07f9 version bump to 0.3.2 after mdns 2015-04-22 02:14:48 -07:00
Jeromy Johnson
fe3459cd4f Merge pull request #1117 from ipfs/feat/mdns
implement basic peer discovery using mdns
2015-04-22 02:07:04 -07: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
Juan Batiz-Benet
58d6d1e7b6 updated vendored mdns libs 2015-04-22 00:49:40 -07:00
Juan Batiz-Benet
73c3888812 vendored mdns deps 2015-04-21 23:57:48 -07:00
Juan Batiz-Benet
b223dc2d05 fix vendoring problems from migrations 2015-04-21 23:57:09 -07:00
Juan Batiz-Benet
960de83683 Merge pull request #1112 from ipfs/encapsulate_ipfs_mount
sharness: encapsulate ipfs mount
2015-04-21 22:24:49 -07:00
Juan Batiz-Benet
d881aab45b Merge pull request #1113 from ipfs/fix_umounting
test-lib.sh: fix umount calls
2015-04-21 22:22:49 -07:00
Jeromy
0917c1cb82 implement basic peer discovery using mdns 2015-04-21 21:34:54 -07:00
Christian Couder
14cd8634ef test-lib.sh: fix umount calls
As test directories contain a space, we need to
properly quote paths, otherwise we get errors like:

```
umount: /home/christian/gocode/src/github.com/ipfs/go-ipfs/test/sharness/trash is not mounted (according to mtab)
umount: /home/christian/gocode/src/github.com/ipfs/go-ipfs/test/sharness/trash is not mounted (according to mtab)
```

instead of:

```
umount: /home/christian/gocode/src/github.com/ipfs/go-ipfs/test/sharness/trash directory.t0030-mount.sh/ipfs is not mounted (according to mtab)
umount: /home/christian/gocode/src/github.com/ipfs/go-ipfs/test/sharness/trash directory.t0030-mount.sh/ipns is not mounted (according to mtab)
```

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-04-21 16:18:35 +02:00
Christian Couder
cc6eabf49f t0030: expect good ipfs mount output
As the ipfs mount call is now encapsulated in a
temporary function (see previous commit) its
output should not be tempered with by
test_must_fail.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-04-21 16:00:07 +02:00
Christian Couder
a7b0227029 t0030: encapsulate ipfs mount
As described in issue #1109 on OSX some output from
test_must_fail unfortunately goes into the "output"
file that we use to test the output from "ipfs mount".

This patch avoids the above by encapsulating the call
to "ipfs mount" into a temporary function.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-04-21 15:55:20 +02:00
Juan Batiz-Benet
b1adeef85c version bump to 0.3.1
This patch update fixes a few bugs:

* harden shutdown logic by @torarnv
* daemon locking fixes by @travisperson
* don't re-add entire dirs by @whyrusleeping
* tests now wait for graceful shutdown by @jbenet
* default key size is now 2048 by @jbenet

(experimenting with using semver)
2015-04-21 01:43:10 -07:00
Juan Batiz-Benet
c7d2d6090a Merge pull request #1111 from ipfs/init-lower-key-size
init: lower default rsa key size to 2048 for now
2015-04-21 01:37:04 -07:00
Juan Batiz-Benet
bafcaaeb61 Merge pull request #1110 from ipfs/graceful-exit-sharness
sharness: wait for graceful shutdown
2015-04-21 01:36:17 -07:00
Juan Batiz-Benet
16f56e1c9b init: lower default rsa key size to 2048 for now
I think we should lower the default rsa key size to 2048 for now -- until we have a proper focus on securing everything. It's always a pain for new users to get hung on 4096 rsa key gen, when we have not even made sure we're using the keys perfectly correctly yet. (And 2048 is still considered secure)
2015-04-21 01:18:52 -07:00
Juan Batiz-Benet
cf797d3d02 sharness: only send kill signal once - #1106
sharness should only send the kill signal once, as that is
what a graceful shutdown should do. in the event that doesn't
happen, we should send it again, and then kill -9 to prevent it
lingering and messing with other tests.
2015-04-21 01:15:22 -07:00
Juan Batiz-Benet
bd9e2c6edb sharness: t0030-mount output known breakage
The test_must_fail check fails on osx. (it does not seem to fail on
linux). See #1109
2015-04-21 01:15:14 -07:00
Juan Batiz-Benet
db56c0f16a Merge pull request #1037 from torarnv/harden-shutdown-logic
Harden shutdown logic
2015-04-21 00:58:49 -07:00
Juan Batiz-Benet
1bac12f922 Merge pull request #1103 from travisperson/bug/init-with-daemon
Check to see if the daemon is currently running
2015-04-21 00:58:35 -07:00
Travis Person
676fd50ca0 Correctly written test for ipfs init with daemon 2015-04-20 23:46:59 -07:00
Travis Person
e7756e45f9 Problem with initializing daemon on same port
At this point I think this test should be moved out of this file
2015-04-20 19:33:41 -07:00
Juan Batiz-Benet
33fab2290a Merge pull request #1101 from ipfs/fix/add-perf
don't readd entire directories recursively
2015-04-20 19:23:52 -07:00
Travis Person
cca5212e09 Add sharness test
This test to make sure we can't run `ipfs init` while a daemon is
currently running.
2015-04-20 18:35:42 -07:00
Travis Person
e1f8dfa25a Check to see if the daemon is currently running
If the daemon is running we do not want to proceed with an
an initialization.

Return a client error telling the user to kill the daemon
before proceeding with the command.
2015-04-20 17:21:13 -07:00
Jeromy
861f30cc12 don't readd entire directories recursively 2015-04-20 16:21:00 -07:00
Tor Arne Vestbø
bfd12114e7 Remove daemon InitDone guard in interrupt handler
Instead of just terminating right there and then, we cancel the
context, and let the daemon exit cleanly. This make take a few
seconds, as the node builder and its child processes do not
care too much about the context state while building nodes,
but this can be improved by injecting checks for ctx.Done()
before time-consuming steps.
2015-04-20 16:35:35 +02:00
Tor Arne Vestbø
cf6a268cd3 Handle ipfs command interruption by cancelling the command context
Instead of assuming the command is the daemon command and closing
the node, which resulted in bugs like #1053, we cancel the context
and let the context children detect the cancellation and gracefully
clean up after themselves.

The shutdown logging has been moved into the daemon command, where
it makes more sense, so that commands like ping will not print out
the same output on cancellation.
2015-04-20 16:35:35 +02:00
Tor Arne Vestbø
cc45e21e4c Teach http client to abort channel streaming on context cancellation
When the response includes the X-Chunked-Output header, we treat that
as channel output, and fire up a goroutine to decode the chunks. This
routine need to look for context cancellation so that it can exit
cleanly.
2015-04-20 16:35:35 +02:00
Tor Arne Vestbø
661fb0a4b5 Teach http client to cancel request on context cancellation
The context may be cancelled while a request is in flight. We need to
handle this and cancel the request. The code is based on the ideas
from https://blog.golang.org/context
2015-04-20 16:35:35 +02:00
Tor Arne Vestbø
3d05764262 Sync up request context with root context just before calling command
The context passed on from main() may change before we hit callCommand,
so setting it in Parse is a bit optimistic.
2015-04-20 16:35:35 +02:00
Tor Arne Vestbø
00a6e595ba main: wait for interrupt to finish before ending command invocation
If a command invocation such as 'daemon' is interrupted, the interrupt
handler asks the node to close. The closing of the node will result in
the command invocation finishing, and possibly returning from main()
before the interrupt handler is done. In particular, the info logging
that a graceful shutdown was completed may never reach reach stdout.

As the whole point of logging "Gracefully shut down." is to give
confidence when debugging that the shutdown was clean, this is
slightly unfortunate.

The interrupt handler needs to be set up in main() instead of Run(),
so that we can defer the closing of the interrupt handler until just
before returning from main, not when Run() returns with a streaming
result reader.
2015-04-20 16:35:30 +02:00
Juan Batiz-Benet
d7c91992a4 Merge pull request #1099 from ipfs/fix-randperm
core: bugfix: bootstrap random permutation
2015-04-20 06:13:36 -07:00