1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-08-06 19:44:01 +08:00

3302 Commits

Author SHA1 Message Date
7b750664fb Revert last change (the default is now printed twice) 2020-04-04 05:34:56 +02:00
3b30e8e2b0 ipfs files cp: improve docstring with better words.
And align capitalization.
2020-04-02 20:46:31 +02:00
b5aaf75e25 Fix #4996: Improve help text for "ipfs files cp" 2020-04-01 12:08:48 +02:00
06ba6d0fc2 fix: remove internal relay discovery
This logic collects a list of known relays by testing every new connection.

It exists so we can dial /p2p-circuit/p2p/QmFoobar addresses (circuit addresses
that don't specify the relay). However, this kind of address is useless outside
of basic demos as a random relay is practically guaranteed to not be connected
to the target peer. Picking a random relay to connect to some peer is almost
_never_ the desired behavior.
2020-03-31 12:24:55 -07:00
efdb8db276 fix: get rid of shutdown errors
Instead of feeding through the top-level context, feed through a cancel-free
context (that still carries the same context values). Then, when the top-level
context is canceled, call `stop` to shut everything down in-order. Finally,
cancel the inner context to make sure everything has been cleaned up.

Ideally, we just wouldn't use contexts for this. But this is strictly better
than what we have.
2020-03-29 20:48:43 -07:00
f28b8fce66 feat: tls by default
Switches to TLS as the default security transports.
2020-03-29 19:12:54 -07:00
ad543f0724 feat: update go-libp2p & go-bitswap
Uses the new libp2p AutoNAT option.
2020-03-24 14:54:09 -07:00
b5ad3be060 feat: improve key lookup
* Support peer IDs encoded as CIDs.
* Support looking up the identity key by peer ID.
2020-03-23 15:40:48 -07:00
62de9ba9d3 feat(file-ignore): add ignore opts to add cmd
- add the `gitignore` or `ignore options to the add command
2020-03-20 09:22:04 -07:00
f9567a0a0f fix(gateway): curl without redirect on localhost
When request is sent to http://localhost:8080/ipfs/$cid response has
HTTP 301 status code and "Location" header with redirect destination at
$cid.ipfs.localhost:8080

Redirect is followed by browsersi, but not by commandline tools.
Status 301 is ignored by curl in default mode: it will print response
and won't follow redirect, user needs to add -L for that.

To fix curl, we return correct payload in body of HTTP 301 response,
but set Clear-Site-Data header to ensure Origin sandbox can't be abused.

This requires a surgical workaround:
If Location header is present in ResponseWriter's Header map,
we ensure http.ServeContent() returns HTTP 301

Context: https://github.com/ipfs/go-ipfs/pull/6982

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
2020-03-18 08:50:40 -07:00
3ecccd6e1d feat(gateway): subdomain and proxy gateway
License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
2020-03-18 08:50:38 -07:00
72490f7ed0 gateway: simplify/improve dnslink rewrite handling
Instead of adding a new fake header (that could be spoofed by the client...),
just read the original request URI from the request object.

This also removes support for suborigins. They have never been implemented in
browsers and it looks like efforts have stalled. We can add support back if we
need it but, well, maintaining support was going to be more trouble than it was
worth.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2020-03-17 19:34:44 -07:00
11c229bb14 rename ProxyOption to P2PProxyOption
(we're implementing an _actual_ proxy)

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2020-03-17 19:34:44 -07:00
53782d439c update to new private network interfaces 2020-03-09 19:39:06 -07:00
1ae69862bc Merge pull request #6602 from ipfs/feat/coreapi-mount
mount: switch over to the CoreAPI
2020-03-06 22:30:12 -08:00
fef5e8d780 doc(commands): document that dht put takes a file
Turns out that our CLI help text doesn't indicate whether or not a command takes
a file.
2020-03-06 13:49:57 -08:00
8643d949f3 cmds/tar: use the coreapi 2020-03-02 09:22:58 -08:00
0ddc2751a4 docs: fix typo
Co-Authored-By: Johnny <9611008+johnnymatthews@users.noreply.github.com>
2020-03-02 15:57:04 +00:00
885e1125b8 docs: fix example for files.write
* Adds the `--parents` optiont to the first command so that it is runnable
* Updates the description to specifies the option to use if you _do_ want nonexistant intermediate directories created
2020-03-02 10:36:13 +00:00
46d26af0b6 feat(graphsync): mount the graphsync libp2p protocol
This won't fetch files from graphsync but will serve them.

fixes #6830
2020-02-26 09:11:15 -08:00
bddd8287d4 doc(add): document hash stability
fixes #4318
2020-02-11 09:29:30 -08:00
effbc0a542 docs(commands): fix mfs wording 2020-02-07 07:27:27 -08:00
38ca2fbde2 core/commands/files: MFS docs, minor improvements after user feedback 2020-02-07 15:35:33 +01:00
e05ddfab23 /mfs/path -> /some/path
Co-Authored-By: Moritz <13287984+mohe2015@users.noreply.github.com>
2020-02-07 15:19:37 +01:00
10194de133 core/commands/files: log.Error -> flog.Error
This seems like a tiny leftover.
2020-02-07 14:55:16 +01:00
da584b8679 Fix #6878: Improve MFS Cli documentation 2020-02-07 14:55:01 +01:00
26c5e38571 fix: use the correct protocol name for ipfs swarm addrs local --id 2020-02-05 07:46:37 -08:00
3b5a6bda59 fix: fix id addr format
Instead of manually creating multiaddr strings, use the multiaddr logic to
format them. We were still using `/ipfs` multiaddrs instead of `/p2p` multiaddrs.
2020-02-05 07:39:08 -08:00
4bdd03d2f3 Help text update for 'ipfs key gen'
Add info about the default key type
2020-02-04 13:58:05 +01:00
33861b0d40 fix: make rsa the default key type
It's already the default when initializing the node, we might as well make it
the default when creating new keys.

fixes #6861
2020-02-03 18:10:21 -08:00
906f45edd9 fix(tracing): remove event tracing
We've deprecated this system and have yet to move to a new system. We might as
well remove everything, switch to a new system, then deliberately trace the
entire system.
2020-01-28 21:31:12 -08:00
a53d48059b fix: migrate from deprecated warning function 2020-01-28 21:20:21 -08:00
98d2fef6ec fix: use pre-defined relays for autorelay
Unfortunately, we don't currently have any way to pick out good relays from bad.
That means we keep searching, trying bad relays, searching some more, trying
_the same relays_, etc. until we randomly find 3 good stable relays. In
practice, this means we just keep searching forever and keep thrashing the DHT.

see https://github.com/libp2p/go-libp2p/issues/694
2020-01-17 06:28:23 -08:00
725e6844ee gateway: cleanup logic
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2020-01-10 10:19:13 +01:00
5eea0a4ba0 http: use Method* constants
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2020-01-10 10:19:08 +01:00
e58a32ab1e feat(commands/cid): add a flag for setting the codec
This will be useful when testing `refs local, `repo gc`, and `repo verify`
commands once we store blocks by multihash instead of by CID. At that point,
these commands will return raw v1 CIDs as the blockstore won't actually remember
the codec used to store the block.

Flags choice:

* Ideally, we'd use the `-f, --format` flags like every other command but we're
  already using `-f` (format) for the format string.
* Alternatively, I'd like to use `-c`. However, we're using _that_ for a global
  `--config` flag (bit of a waste given that it doesn't work...).

`--codec` will have to do for now.
2020-01-07 19:32:16 -06:00
f8adc3ebdd fix(commands/cid): always use base58 for CIDv0 unless otherwise specified 2020-01-07 19:20:21 -06:00
c64eb11992 test(gateway): test the lazy seeker 2020-01-05 16:43:45 -08:00
6cb03d4dfd fix(gateway): fix seek read length typo 2020-01-05 16:43:45 -08:00
453b78962b chore(gateway): remove dead code 2020-01-05 16:43:45 -08:00
1a06fb6e2f fix(gateway): correct symlink content type
We should be _resolving_ symlinks (sometimes, still need to figure out when to
do this WRT IPNS). However, that's a larger feature.
2020-01-05 16:43:44 -08:00
3859f08bf7 fix(gateway): better seeking/sized
1. Require files to have known sizes. We can add support for unknown sizes
_later_ but we can't use ServeContent for those files.
2. Replace the `sizeReadSeeker` with a `lazySeeker`. This one makes no
assumptions about how it's used so we're less likely to run into weird bugs.
2020-01-05 16:43:44 -08:00
e8a6c0c050 fix(gateway): gracefully handle files with unknown sizes in directory listings 2020-01-05 16:43:44 -08:00
62451039ec fix(gateway): serve the index with serveFile 2020-01-05 16:43:44 -08:00
07cbba7c40 Fix Typos 2019-12-25 03:12:41 +00:00
3c95f65b21 Merge pull request #6785 from ipfs/feat/async-ds
Support Asynchronous Datastores
2019-12-19 11:45:00 +01:00
3a0d0e817a support async datastores 2019-12-19 00:59:31 -05:00
115b2ba6cd fix: limit SW registration to content root
Introduces hardening proposed in:
https://github.com/ipfs/go-ipfs/issues/4025#issuecomment-342250616

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
2019-12-17 02:20:40 +01:00
8f3b274080 fix: move away from deprecated peer ID functions 2019-12-14 19:48:31 +01:00
15c35a5a95 doc: update documentation for /ipfs -> /p2p multiaddr switch
See: https://github.com/libp2p/libp2p/issues/79
2019-12-14 19:39:59 +01:00