Commit Graph

780 Commits

Author SHA1 Message Date
Vitor Baptista
5d1a25bbb9 core/commands: pin ls: display types by default
If you want to get only the hashes (i.e. the previous behaviour), you can use
the `--quiet` flag.
2015-04-28 19:15:15 +01:00
Jeromy
ea2375e8b4 let wantlist command show other peers wantlists 2015-04-28 01:51:30 -07:00
Juan Batiz-Benet
196c6aa4a6 Merge pull request #1127 from wking/add-single-reader
core/commands/add: Change add() to only accept a single reader
2015-04-27 02:38:59 -07:00
Jeromy
6da12b5398 address comments from CR 2015-04-26 22:32:12 -07:00
Jeromy
c1560befcd fix up core.Resolve a bit 2015-04-26 22:32:12 -07:00
Jeromy
e3255f46e1 address comments from CR 2015-04-26 22:32:12 -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
W. Trevor King
641c20b9dd core/coreunixs/add: Change add() to only accept a single reader
Catch up with core/commands/add.go.
2015-04-23 13:01:45 -07:00
W. Trevor King
c322a4eb0f core/commands/add: Change add() to only accept a single reader
The change to an array of readers comes from e096060b
(refactor(core/commands2/add) split loop, 2014-11-06), where it's used
to setup readers for each path in the argument list.  However, since
6faeee83 (cmds2/add: temp fix for -r. horrible hack, 2014-11-11) the
argument looping moved outside of add() and into Run(), so we can drop
the multiple-reader support from add().

Adding a file can create multiple nodes (e.g. the splitter can chunk
the file into several blocks), but:

1. we were only appending a single node per reader to our returned
   list, and
2. we are only using the final node in that returned list,

so this commit also adjusts add() to return a single node reference
instead on an array of nodes.
2015-04-23 09:41:59 -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
Jeromy
0917c1cb82 implement basic peer discovery using mdns 2015-04-21 21:34:54 -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
Jeromy
861f30cc12 don't readd entire directories recursively 2015-04-20 16:21:00 -07:00
Juan Batiz-Benet
ce7914063f core: bugfix: bootstrap random permutation
the random permutaton for bootstrap peers was not working as
intended, returning the first four bootstrap peers always.
this commit fixes it to be a random subset.
2015-04-20 06:00:42 -07:00
Tor Arne Vestbø
6fe85496f5 corehttp: disable HTTP keep-alive when shutting down server
Once the server is asked to shut down, we stop accepting new
connections, but the 'manners' graceful shutdown will wait for
all existing connections closed to close before finishing.

For keep-alive connections this will never happen unless the
client detects that the server is shutting down through the
ipfs API itself, and closes the connection in response.

This is a problem e.g. with the webui's connections visualization,
which polls the swarm/peers endpoint once a second, and never
detects that the API server was shut down.

We can mitigate this by telling the server to disable keep-alive,
which will add a 'Connection: close' header to the next HTTP
response on the connection. A well behaving client should then
treat that correspondingly by closing the connection.

Unfortunately this doesn't happen immediately in all cases,
presumably depending on the keep-alive timeout of the browser
that set up the connection, but it's at least a step in the
right direction.
2015-04-20 14:55:42 +02:00
Tor Arne Vestbø
c9d3084910 corehttp: ensure node closing/teardown waits for server termination
When closing a node, the node itself only takes care of tearing down
its own children. As corehttp sets up a server based on a node, it
needs to also ensure that the server is accounted for when determining
if the node has been fully closed.
2015-04-20 14:55:42 +02:00
Tor Arne Vestbø
cc830ff2ee corehttp: log when server takes a long time to shut down
The server may stay alive for quite a while due to waiting on
open connections to close before shutting down. We should
find ways to terminate these connections in a more controlled
manner, but in the meantime it's helpful to be able to see
why a shutdown of the ipfs daemon is taking so long.
2015-04-20 14:55:42 +02:00
Christian Couder
96a22c5bb1 config: change default config dir name to .ipfs
This changes .go-ipfs to .ipfs everywhere.
And by the way this defines a DefaultPathName const
for this name.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-04-20 02:25:41 -07:00
Juan Batiz-Benet
c79dddd3d3 core: resolve error + bounds check
- handle error on "/ipns/"
- bounds-check, otherwise might cause a panic
2015-04-20 01:49:22 -07:00
Juan Batiz-Benet
928581c9e7 Merge pull request #1071 from ipfs/add-err-fix
cmds/add: silent error fix
2015-04-20 01:48:54 -07:00
Juan Batiz-Benet
218aeeb77e cmds/add: silent error fix 2015-04-20 01:18:42 -07:00
gatesvp
31ff954539 Move IPNS resolutions into the core library
Move IPNS resolutions into the core library via the pathresolver.go
file. Fix the CLI commands to leverage this core component.
2015-04-20 01:04:30 -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
Etienne Laurin
233c39ff62 publish by path 2015-04-12 21:51:58 +00:00
Juan Batiz-Benet
69db1b4ec5 bugfix: add was not setting error 2015-04-12 07:53:04 -07:00
Juan Batiz-Benet
3c1d78c672 corehttp: added support for HEAD requests
This commit adds HEAD support to the IPFS Gateway.
Related: #840
2015-04-12 02:35:16 -07:00
Jeromy
f10c8282c7 handle error from GetClosestPeers 2015-04-06 00:08:28 -07:00
Jeromy
2c8cb9fc75 bandwidth metering on streams
humanize bandwidth output

instrument conn.Conn for bandwidth metrics

add poll command for continuous bandwidth reporting

move bandwidth tracking onto multiaddr net connections

another mild refactor of recording locations

address concerns from PR

lower mock nodes in race test due to increased goroutines per connection
2015-03-31 19:58:08 -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
13c489eca1 fix context respect through fuse reading 2015-03-24 12:23:01 -07:00
Henry
07008042f1 ipfs ls: added --headers option
- added tests for 'ipfs ls --headers'
- comments from CR (opts)
- sharness: fix ls test whitespace
2015-03-20 15:34:56 -07:00
Juan Batiz-Benet
8a3db7cbc4 testing: nofuse testing (for osx travis) 2015-03-18 01:44:36 -07:00
Jeromy
7ad8dd8523 ignore bootstrap failures in namesys initialization 2015-03-17 21:57:57 -07:00
Jeromy
f679127d83 comments! and cleanup 2015-03-17 20:57:21 -07:00
Jeromy
eb228eb615 remove addCloser 2015-03-17 20:57:21 -07:00
Jeromy
9ab59e44ad implement in memory model for ipns filesystem, to be used as backing for ipns fuse interface 2015-03-17 20:57:20 -07:00
Andy Leap
512171aa98 Fixing test failure(issue with looking for exact text) 2015-03-16 16:27:34 -04:00
Andy Leap
89ca37d1d1 Fixes issue #924 2015-03-16 16:08:45 -04: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
Henry
b688e72de0 ipfs object put: return error if object is empty (fixes #883) 2015-03-10 22:58:50 +01:00
Henry
759437e054 ls: introduce specific output types (removes IsDir from object plumbing commands) 2015-03-10 13:56:57 +01:00
Henry
d88ba19357 disabled 'ipfs update' command for now 2015-03-09 10:22:11 +01:00
Henry
e8403b1f11 removed dead code
- old http server (superseeded by core/corehttp)
- unused makeDatastore() helpers
2015-03-09 10:21:35 +01:00
anarcat
451222cf1d gc is actually repo gc, reflect in docs
not exactly elegant, but fixes #871 in the short term. in the mid term, unless more `repo` commands show up, i suggest just replacing `repo gc` simply by `gc`.
2015-03-08 18:05:42 -04:00
Juan Batiz-Benet
bff7f73068 Merge pull request #878 from jbenet/dontIgnoreCancelFuncs
context: Always call returned cancel funcs
2015-03-07 09:49:19 -08:00
Juan Batiz-Benet
1d5b903611 added cancel func calls previously ignored 2015-03-07 09:31:46 -08:00
Juan Batiz-Benet
dfe2b16763 cmds/id: use req context -- dont timeout unnecessarily
commands should last as long as the user keeps the cmd going
2015-03-07 09:24:15 -08:00
Henry
bc84ffafe3 enable stdin input for ipfs object put 2015-03-07 16:50:00 +01:00