1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-09-09 11:12:21 +08:00

85 Commits

Author SHA1 Message Date
d7dab3afea Use gx vendored go-ipfs-utils where possible
For the rest of the packages in util, move them to thirdparty
and update the references. util is gone!

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-02-12 17:21:40 -08:00
5a0b8023be Merge pull request #2256 from ipfs/feat/gx-libp2p
vendor libp2p with gx
2016-02-05 16:52:02 -08:00
b11abe283b Merge pull request #2267 from rht/wire/ctx-http-request-2
Directly wire ctx into http request
2016-02-04 10:24:26 -08:00
aaa6569f2c trivial: various superficial fixes
misc/completion/ipfs-completion.bash: add `ipfs stats` to BASH completion

core/commands/mount_unix.go: ensure error is not nil before printing it

contribute.md: fix bibliography indexing in example

core/commands/swarm.go: change tabs to spaces in USAGE message

*: 80-column readability improvements

License: MIT
Signed-off-by: Thomas Gardner <tmg@fastmail.com>
2016-02-03 15:46:28 +10:00
0e8a6700f9 correct go-log dep
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-30 09:34:10 -08:00
0e312f5caf initial vendoring of libp2p outside of the repo with gx
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-30 09:34:06 -08:00
rht
6f76129b87 Simplify context canceled err message
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2016-01-30 10:26:35 +07:00
0dd3735a45 run external commands client side
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-12-30 11:08:09 -08:00
rht
0123971118 Move api version check to header
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-12-28 03:48:50 -08:00
a23609fc4d improve conn refused error check
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

rewrite path to filepath in fsrepo

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

remove api file on repo close

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

update function to check normal net.OpErrors

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-11-08 16:09:47 -08:00
94bdce63a7 vendor logging lib update
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-11-05 15:57:21 -08:00
c023d187b5 update code to use new logging changes
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-10-27 11:04:56 -07:00
8f0623255d replace imports with absolute path instead of using symlink
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-10-03 14:30:50 -07:00
e5512b4115 make publish more configurable and add test for repub
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-09-30 11:03:44 -07:00
20908b3072 Detect connection refused errors during API test on Windows
The first run does not try to connect to API, as an address is not
yet saved in configuration. The second run did not recognize
corrently a refused connection.

Fixes #1661.

License: MIT
Signed-off-by: Marcin Janczyk <marcinjanczyk@gmail.com>
2015-09-25 08:37:10 +02:00
e5a2896c0e extract logging
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-09-14 17:35:50 -07:00
8c652907de Merge pull request #1598 from ipfs/check-for-api
check for API -- WIP
2015-08-29 06:20:59 +02:00
94000e6490 replace nodebuilder with a nicer interface
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

use NewNode instead of NewIPFSNode in most of the codebase

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

make mocknet work with node constructor better

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

finish cleanup of old construction method

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

blockservice.New doesnt return an error anymore

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

break up node construction into separate function

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

add error case to default filling on node constructor

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-08-27 08:43:10 -07:00
5040fee906 implement support for --api option
This commit adds support for the --api option, which allows users
to specify an API endpoint to run the cli command against. It enables
much easier control of remote daemons.

It also
- ensures the API server version matches the API client
- implements support for the $IPFS_PATH/api file

Still TODO:
- tests!
- multiaddr to support /dns/

License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-08-27 08:03:56 +02:00
bb3a75aa08 remove context from context
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-20 20:53:06 -07:00
f9f3c6a527 make offline commands respect timeout
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-20 14:34:16 -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
d51f28e895 Merge pull request #1254 from ipfs/fix/refs-fail
fix silent refs failure
2015-05-20 23:25:02 -04:00
002cf5128e fix silent refs failure 2015-05-20 09:46:22 -07:00
8ea502f1b3 clean up and fix init permissions handling 2015-05-20 09:46:09 -07:00
fc28ef401f Merge pull request #1149 from ipfs/fix/better-mem-prof
write memory profiles every 30 seconds when enabled
2015-05-02 12:12:22 -07:00
e78305546c gofmt 2015-04-28 16:18:26 -07:00
29c6a53e43 Merge pull request #1139 from AtnNn/flags
Improve command line parsing
2015-04-27 16:21:39 -07:00
dff606a347 write memory profiles every 30 seconds when enabled 2015-04-27 15:53:07 -07:00
f168539030 Improve command line parsing 2015-04-27 17:19:38 +00:00
db2acd9b8d gofmt 2015-04-25 19:00:30 -07:00
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
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
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
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
61efc4de1d Revert "fix ugly error message when killing commands"
This reverts commit f74e71f96545b14f5293c9851ce624aecddb68aa.

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
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
f74e71f965 fix ugly error message when killing commands 2015-04-12 14:49:45 -07:00
675e2c7f85 Unify shutdown message format string 2015-04-07 14:12:22 +02:00
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
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
01db359c0f Kill the daemon during its startup 2015-03-12 12:05:10 +02:00
d23bed5baa Rename ContextIsReadyToBeClosed to InitDone 2015-03-12 11:42:07 +02:00
afd497e194 Dirty hack to fix race conditions in the daemon 2015-03-09 16:39:41 +02:00
6e5217fd97 Move the comment back to where it belongs 2015-03-09 06:36:06 +02:00
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
0db1a94862 misc: suppress logs to Debug (from Info) 2015-02-14 14:13:53 -08:00
a549cf57d6 add space 2015-02-14 14:13:53 -08:00
140c70d772 document some packages 2015-02-10 22:59:10 +00:00
58f39687cf logs: removed all log.Errors unhelpful to users
Let's save log.Error for things the user can take action on.
Moved all our diagnostics to log.Debug. We can ideally reduce them
even further.
2015-02-03 01:06:07 -08:00