Commit Graph

827 Commits

Author SHA1 Message Date
Juan Batiz-Benet
4e71ce3cc7 Merge pull request #1272 from Luzifer/fix/dnslink
Fix: dnslink domain resolving was broken; Add: no caching for those
2015-05-24 18:47:54 +02:00
Juan Batiz-Benet
c8cb8d9c39 Merge pull request #1278 from ipfs/fix/bs-cmd-offline
make bitswap commands error out properly offline
2015-05-22 22:54:51 +02:00
Travis Person
2c71c54823 Named error for no components
Update the previous `invalid path` error to match the error returned
from `SplitAbsPath`.
2015-05-22 09:18:49 -07:00
Travis Person
d96246c622 Fixed tests to actually test for the error we are seeking
Cleaned the tests, and actually test for the error.
2015-05-22 08:56:33 -07:00
Travis Person
dcc4da0b37 Replaced old logic to check for valid path
Added the original logic to check for a invalid path and a simple test.
2015-05-22 08:56:33 -07:00
Travis Person
42289d4f21 Daemon panics if no path is given
If no path after `/ipfs/` or `/ipns/` is given, then the daemon will
panic with a slice bounds out of range error. This checks to see if we
have anything after `ipfs` or `ipns`.
2015-05-22 08:56:33 -07:00
Jeromy
648526d8f0 make bitswap commands error out properly offline 2015-05-21 22:41:44 -07:00
Jeromy
60ac59139c fix offline full path resolution bug 2015-05-21 14:45:30 -07:00
Knut Ahlers
8df8737f6a removed requirement of path package 2015-05-21 08:51:18 +02:00
Knut Ahlers
373260d373 Fix: dnslink domain resolving was broken; Add: no caching for those
fixes #1234
fixes #1267
2015-05-21 08:44:17 +02:00
Jeromy
f6fadc4c91 do http server properly so daemon can shut down 2015-05-20 22:42:54 -07:00
Juan Batiz-Benet
9b4b2c6879 Merge pull request #1235 from Luzifer/fix/dnslink-issues
Fix: Using the `dnslink` feature led to infinite redirects
2015-05-20 23:59:01 -04:00
Knut Ahlers
1b3797474f Fix: Using the dnslink feature led to infinite redirects
fixes #1233
2015-05-20 19:42:28 +02:00
Jeromy
002cf5128e fix silent refs failure 2015-05-20 09:46:22 -07:00
W. Trevor King
1e6594d087 namesys/dns: Pluggable lookupTXT field
So we can attach a mock lookup function for testing.
2015-05-20 08:40:44 -07:00
W. Trevor King
e4447b3c96 core/commands/publish: Fix published message
Previously we had a confusing situation, with:

* single-arg doc: published name <name> to <value>
* double-arg doc: published name <value> to <name>
* implementation: Published name <name> to <value>

Now we have the uniform:

  Published to <name>: <value>

With the following goals:

1. It's clear that we're writing <value> to <name>'s IPNS slot in the
   DHT.
2. We preserve the order of arguments from the command-line
   invocation:

     $ ipfs name publish <name> <value>
     Published to <name>: <value>
2015-05-20 08:40:44 -07:00
W. Trevor King
416d454b42 core/commands: Make 'ipfs name resolve' IPNS-only
And add a generic 'ipfs resolve' to handle cross-protocol name
resolution.
2015-05-20 08:40:44 -07:00
W. Trevor King
e643f72c86 core/commands/dns: Add 'ipfs dns ...' for resolving DNS references
This lets users resolve (recursively or not) DNS links without pulling
in the other protocols.  That makes an easier, more isolated target
for alternative implemenations, since they don't need to understand
IPNS, proquint, etc. to handle these resolutions.
2015-05-20 08:40:44 -07:00
W. Trevor King
c2ff02850b core/commands/resolve: Add a -r / --recursive option
For explicitly enabling recursive behaviour (it was previously always
enabled).  That allows folks who are interested in understanding
layered indirection to step through the chain one link at a time.
2015-05-20 08:40:42 -07:00
W. Trevor King
3ead2443e5 namesys: Add recursive resolution
This allows direct access to the earlier protocol-specific Resolve
implementations.  The guts of each protocol-specific resolver are in
the internal resolveOnce method, and we've added a new:

  ResolveN(ctx, name, depth)

method to the public interface.  There's also:

  Resolve(ctx, name)

which wraps ResolveN using DefaultDepthLimit.  The extra API endpoint
is intended to reduce the likelyhood of clients accidentally calling
the more dangerous ResolveN with a nonsensically high or infinite
depth.  On IRC on 2015-05-17, Juan said:

15:34 <jbenet> If 90% of uses is the reduced API with no chance to
  screw it up, that's a huge win.
15:34 <wking> Why would those 90% not just set depth=0 or depth=1,
  depending on which they need?
15:34 <jbenet> Because people will start writing `r.Resolve(ctx, name,
  d)` where d is a variable.
15:35 <wking> And then accidentally set that variable to some huge
  number?
15:35 <jbenet> Grom experience, i've seen this happen _dozens_ of
  times. people screw trivial things up.
15:35 <wking> Why won't those same people be using ResolveN?
15:36 <jbenet> Because almost every example they see will tell them to
  use Resolve(), and they will mostly stay away from ResolveN.

The per-prodocol versions also resolve recursively within their
protocol.  For example:

  DNSResolver.Resolve(ctx, "ipfs.io", 0)

will recursively resolve DNS links until the referenced value is no
longer a DNS link.

I also renamed the multi-protocol ipfs NameSystem (defined in
namesys/namesys.go) to 'mpns' (for Multi-Protocol Name System),
because I wasn't clear on whether IPNS applied to the whole system or
just to to the DHT-based system.  The new name is unambiguously
multi-protocol, which is good.  It would be nice to have a distinct
name for the DHT-based link system.

Now that resolver output is always prefixed with a namespace and
unprefixed mpns resolver input is interpreted as /ipfs/,
core/corehttp/ipns_hostname.go can dispense with it's old manual
/ipfs/ injection.

Now that the Resolver interface handles recursion, we don't need the
resolveRecurse helper in core/pathresolver.go.  The pathresolver
cleanup also called for an adjustment to FromSegments to more easily
get slash-prefixed paths.

Now that recursive resolution with the namesys/namesys.go composite
resolver always gets you to an /ipfs/... path, there's no need for the
/ipns/ special case in fuse/ipns/ipns_unix.go.

Now that DNS links can be things other than /ipfs/ or DHT-link
references (e.g. they could be /ipns/<domain-name> references) I've
also loosened the ParsePath logic to only attempt multihash validation
on IPFS paths.  It checks to ensure that other paths have a
known-protocol prefix, but otherwise leaves them alone.

I also changed some key-stringification from .Pretty() to .String()
following the potential deprecation mentioned in util/key.go.
2015-05-20 08:40:05 -07:00
Juan Batiz-Benet
c561c0980b Merge pull request #1239 from rht/master
Add gofmt check
2015-05-19 04:03:23 -04:00
rht
ac7edddb94 Run 'gofmt -s -w' on these files 2015-05-19 06:11:15 +07:00
Juan Batiz-Benet
eea6921fcd Merge pull request #1242 from ipfs/perf/add
remove unnecessary flush, and buffer output channel
2015-05-18 18:39:19 -04:00
Juan Batiz-Benet
9c4135fe08 Merge pull request #1240 from vijayee/master
removed braintree/manners
2015-05-18 18:33:16 -04:00
Jeromy
a67af7d9c1 remove unnecessary flush, and buffer output channel 2015-05-18 14:55:58 -07:00
Vijayee Kulkaa
fcb8be5607 removed braintree/manners 2015-05-18 15:28:55 -04:00
Juan Batiz-Benet
88be96bc8c Merge pull request #1229 from timgws/tiny-doc-update
Fix documentation on swarm connect.
2015-05-14 21:52:20 -04:00
Juan Batiz-Benet
cb7c82845e Merge pull request #1220 from ipfs/travis-test-all-commits
Get travis to test all commits
2015-05-14 15:14:30 -04:00
Tim Groeneveld
26ba3e1f74 Issue #873. Thought I might do a small change first to get my feet wet. 2015-05-13 08:15:00 +10:00
Henry
4537311f59 http gw: disable PUT and writable tests - again... :( 2015-05-10 15:30:12 +02:00
Juan Batiz-Benet
6dd8aeb00a config set: allow arbitrary json input
This commit allows arbitrary json input to set.
It also tests this with sharness.
2015-05-10 08:28:35 -04:00
Henry
87ce7abe47 unixfs/io: added NewEmptyDirectory()
some golinting along the way
2015-05-10 07:36:28 -04:00
Henry
31b83abfe4 http gw: remove newDagEmptyDir helper 2015-05-09 12:19:57 +02:00
Henry
96846358cc http gw: some golinting and unexport unused symbols
- NewDagReader() used the wrong context
- Ip?sPathPrefix isn't used anywhere
- a little bit of error handling cleanup
2015-05-09 12:19:57 +02:00
Henry
1502f6bc71 http gw: removed ResolvePath() in favour of core.Resolve() 2015-05-09 12:19:57 +02:00
Henry
e633250c38 http gw: remove unused interface 2015-05-09 12:19:57 +02:00
Henry
f640ba0089 core: add context.Context param to core.Resolve()
commands/object: remove objectData() and objectLinks() helpers
resolver: added context parameters
sharness: $HASH carried the \r from the http protocol with
sharness: write curl output to individual files
http gw: break PUT handler until PR#1191
2015-05-08 03:14:32 +02:00
Juan Batiz-Benet
99596435a7 Merge pull request #1166 from ipfs/fix/bitswap-multisend
try harder to not send duplicate blocks
2015-05-05 00:07:53 -04:00
Jeromy
6f04302a48 remove logging of dup blocks, move to counters for bitswap stat 2015-05-04 03:12:17 -07:00
Jeromy Johnson
45b54c787f Merge pull request #1183 from wking/remove-core-commands-internal-slice_util
core/commands/internal/slice_util: Remove this unused package
2015-05-03 23:17:32 -07:00
W. Trevor King
efa4907565 core/corerepo/pinning: Add a package comment
Currently garbage collection is triggered manually and there are no
age-restrictions on the removal.  I expect we'll eventually follow Git
and auto-launch garbage collection when we hit some threshold of disk
consumption (gc.auto).  I expect we'll also follow Git and keep
unpinned or unreachable objects (gc.pruneexpire, etc.).  But we don't
seem to do either of those yet.
2015-05-02 08:55:43 -07:00
W. Trevor King
e02fc1ec6b core/corehttp/corehttp: Add a package comment
I'm not entirely clear on the role that this package is filling, but
this description seems like a reasonable guess based on a quick skim
through it's exported API.
2015-05-02 08:35:34 -07:00
W. Trevor King
6892eba511 core/commands/internal/slice_util: Remove this unused package
The last references to CastToReaders were commented out in 6faeee83
(cmds2/add: temp fix for -r. horrible hack, 2014-11-11) and then
removed completely in 032e9c29 (core/commands2: Updated 'add' command
for new file API, 2014-11-16).

The last references to CastToStrings was removed in a0bd29d5
(core/commands2: Fixed swarm command for new arguments API,
2014-11-18).
2015-05-02 08:30:32 -07:00
W. Trevor King
95ccdca9ec core/commands/commands: Add a package comment 2015-05-02 08:21:47 -07:00
W. Trevor King
81572ec236 core/core: Refer back to the main go-ipfs docs
So folks looking in core can figure out how it fits into the
repository as a whole.
2015-05-02 08:18:08 -07:00
W. Trevor King
d2a28300a2 core/core: Explain that subpackages are our low-level API
Discussion in [1].

[1]: https://github.com/ipfs/go-ipfs/issues/1158
2015-04-30 21:57:46 -07:00
Jeromy
9e6866f52f hotfix: dont use nodes context because it might not be set yet 2015-04-30 14:16:49 -07:00
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