Commit Graph

534 Commits

Author SHA1 Message Date
Tommi Virtanen
e78305546c gofmt 2015-04-28 16:18:26 -07:00
Juan Batiz-Benet
29c6a53e43 Merge pull request #1139 from AtnNn/flags
Improve command line parsing
2015-04-27 16:21:39 -07:00
Etienne Laurin
f168539030 Improve command line parsing 2015-04-27 17:19:38 +00:00
Juan Batiz-Benet
c9bf470302 Merge pull request #1140 from ipfs/flatfs-rides-again
Fix flatfs on Windows
2015-04-26 23:12:59 -07:00
Jeromy
3d80b9d27d refactored ipns records to point to paths
Also changed the ipns dns resolution to use the "dnslink" format
2015-04-26 22:32:12 -07:00
Tommi Virtanen
db2acd9b8d gofmt 2015-04-25 19:00:30 -07:00
Etienne Laurin
930cd8ea5d Mention correct key size in help for init 2015-04-25 04:43:23 +00: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
db56c0f16a Merge pull request #1037 from torarnv/harden-shutdown-logic
Harden shutdown logic
2015-04-21 00:58:49 -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
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ø
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
Tor Arne Vestbø
61efc4de1d Revert "fix ugly error message when killing commands"
This reverts commit f74e71f965.

The 'Online' flag of the command context does not seem to be set in
any code paths, at least not when running commands such as 'ipfs daemon'
or 'ipfs ping'. The result after f74e71f9 is that we never shutdown
cleanly, as we'll always os.Exit(0) from the interrupt handler.

The os.Exit(0) itself is also dubious, as conceptually the interrupt
handler should ask whatever is stalling to stop stalling, so that
main() can return like normal. Exiting with -1 in error cases where
the interrupt handler is unable to stop the stall is fine, but the
normal case of interrupting cleanly should exit through main().
2015-04-20 14:55:41 +02:00
Jeromy
c419a489e1 make ipfs understand the new migration 2015-04-20 02:26:33 -07:00
Jeromy
f3fbedf312 no longer worry about moving key out of config file 2015-04-20 02:25:41 -07:00
Juan Batiz-Benet
140cd1fd1b remove debugerrors
We now consider debugerrors harmful: we've run into cases where
debugerror.Wrap() hid valuable error information (err == io.EOF?).
I've removed them from the main code, but left them in some tests.
Go errors are lacking, but unfortunately, this isn't the solution.

It is possible that debugerros.New or debugerrors.Errorf should
remain still (i.e. only remove debugerrors.Wrap) but we don't use
these errors often enough to keep.
2015-04-20 00:35:35 -07:00
Jeromy
0a6b880bee fix for #1008 and other pinning fixes
This commit adds a new set of sharness tests for pinning, and addresses
bugs that were pointed out by said tests.

test/sharness: added more pinning tests

Pinning is currently broken. See issue #1051. This commit introduces
a few more pinning tests. These are by no means exhaustive, but
definitely surface the present problems going on. I believe these
tests are correct, but not sure. Pushing them as failing so that
pinning is fixed in this PR.

make pinning and merkledag.Get take contexts

improve 'add' commands usage of pinning

FIXUP: fix 'pin lists look good'

ipfs-pin-stat simple script to help check pinning

This is a simple shell script to help check pinning.

We ought to strive towards making adding commands this easy.
The http api is great and powerful, but our setup right now
gets in the way. Perhaps we can clean up that area.

updated t0081-repo-pinning

- fixed a couple bugs with the tests
- made it a bit clearer (still a lot going on)
- the remaining tests are correct and highlight a problem with
  pinning. Namely, that recursive pinning is buggy. At least:
  towards the end of the test, $HASH_DIR4 and $HASH_FILE4 should
  be pinned indirectly, but they're not. And thus get gc-ed out.
  There may be other problems too.

cc @whyrusleeping

fix grep params for context deadline check

fix bugs in pin and pin tests

check for block local before checking recursive pin
2015-04-19 23:40:25 -07:00
Jeromy
f74e71f965 fix ugly error message when killing commands 2015-04-12 14:49:45 -07:00
Tor Arne Vestbø
675e2c7f85 Unify shutdown message format string 2015-04-07 14:12:22 +02:00
Juan Batiz-Benet
20b5f96e6a gobuilder improvements
- README.md
- install.sh script
- LICENSE
- trigger in main repo
2015-04-02 03:00:49 -07:00
Ho-Sheng Hsiao
bf22aeec0a Reorged imports from jbenet/go-ipfs to ipfs/go-ipfs
- Modified Godeps/Godeps.json by hand
- [TEST] Updated welcome docs hash to sharness
- [TEST] Updated contact doc
- [TEST] disabled breaking test (t0080-repo refs local)
2015-03-31 12:52:25 -07:00
Jeromy
c100b1be04 move keyspace init function into namesys 2015-03-17 16:19:39 -07:00
Tommi Virtanen
fdd1cd8dc0 Remove fsrepo.At, make Open a constructor function
Nobody calls At without immediately calling Open.

First step, a mechanical transformation. Cleanups will follow.
2015-03-13 20:19:03 -07:00
Konstantin Koroviev
01db359c0f Kill the daemon during its startup 2015-03-12 12:05:10 +02:00
Konstantin Koroviev
d23bed5baa Rename ContextIsReadyToBeClosed to InitDone 2015-03-12 11:42:07 +02:00
Konstantin Koroviev
afd497e194 Dirty hack to fix race conditions in the daemon 2015-03-09 16:39:41 +02:00
Henry
70819671d3 cleaned up 'ipfs init' 2015-03-09 10:22:12 +01:00
Konstantin Koroviev
6e5217fd97 Move the comment back to where it belongs 2015-03-09 06:36:06 +02:00
anarcat
5cdd8b5d61 expand the ports documentation
i took @jbenet's suggestion, but reorganised it a bit to *not* suggest what is actually warned against later. :)
2015-03-07 08:42:30 -05:00
anarcat
fb8a1ab161 document how to change daemon ports
this more clearly explains that the daemon is listening on the network. it also hints as to how to change the listening ports. this is also related to #874
2015-03-07 08:24:59 -05:00
Juan Batiz-Benet
25f042ce36 daemon: consolidate writable gway line 2015-03-04 08:17:54 -08:00
Henry
14090d4a11 moved pollEndpoint to thirdparty/ 2015-03-04 16:25:41 +01:00
Henry
3f932af14d removed crazy logging 2015-03-04 16:18:41 +01:00
Henry
56a32a306c using pollEndpoint to block in tests for 'daemon ready' (updates #844) 2015-03-04 14:50:17 +01:00
Henry
92d08db7a5 rewrote import paths of go.net/context to use golang.org/x/context
- updated go-ctxgroup and goprocess
ctxgroup: AddChildGroup was changed to AddChild. Used in two files:
- p2p/net/mock/mock_net.go
- routing/dht/dht.go

- updated context from hg repo to git
prev. commit in hg was ad01a6fcc8a19d3a4478c836895ffe883bd2ceab. (context: make parentCancelCtx iterative)
represents commit 84f8955a887232b6308d79c68b8db44f64df455c in git repo

- updated context to master (b6fdb7d8a4ccefede406f8fe0f017fb58265054c)

Aaron Jacobs (2):
net/context: Don't accept a context in the DoSomethingSlow example.
context: Be clear that users must cancel the result of WithCancel.

Andrew Gerrand (1):
go.net: use golang.org/x/... import paths

Bryan C. Mills (1):
net/context: Don't leak goroutines in Done example.

Damien Neil (1):
context: fix removal of cancelled timer contexts from parent

David Symonds (2):
context: Fix WithValue example code.
net: add import comments.

Sameer Ajmani (1):
context: fix TestAllocs to account for ints in interfaces
2015-02-25 11:58:19 +01:00
Jeromy
a0e5fc8294 add version and ipns serve options to bootstrapd 2015-02-20 12:20:29 -08:00
Jeromy
69e09d40c5 add version info endpoint to gateway 2015-02-20 11:49:48 -08:00
Brian Tiger Chow
bbcc824f8e feat(routingd) lose the mutex. the S3 datastore is threadsafe 2015-02-15 04:45:13 -08:00
Brian Tiger Chow
6ff1d3c844 better error 2015-02-15 04:41:19 -08:00
Brian Tiger Chow
b1fb213ad1 fix(ipfs_routingd) ttl documentation 2015-02-15 04:41:19 -08:00
Brian Tiger Chow
f3e141b3cf feat(routingd) add support for redis 2015-02-15 04:41:18 -08:00
Brian Tiger Chow
c0ca02486b fix(corerouting) pass transport addr 2015-02-15 04:41:18 -08:00
Brian Tiger Chow
2a322ad7fb feat(daemon) learns --routing=supernode 2015-02-15 04:41:18 -08:00
Brian Tiger Chow
8ef61e7704 fix(routingd) listen for interrupts 2015-02-15 04:41:18 -08:00
Brian Tiger Chow
974c4842fa fix(routingd) update port and servers 2015-02-15 04:41:17 -08:00
Brian Tiger Chow
bea4ed78d5 feat(cmd/daemon) add --gcr option to run GCR routing client 2015-02-15 04:41:17 -08:00
Brian Tiger Chow
68e63440da rename binaries 2015-02-15 04:41:16 -08:00
Brian Tiger Chow
19eb35137b refactor(routing) rename grandcentral to supernode
thanks @mappum

remove .go-ipfs
2015-02-15 04:41:10 -08:00