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

52 Commits

Author SHA1 Message Date
c9ce2e724a Simplify Pinner interface by folding ManualPinner into Pinner
Pinner had method GetManual that returned a ManualPinner, so every
Pinner had to implement ManualPinner anyway.

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-12 08:17:17 -08:00
8ad1141436 fixup panic catching in http handler funcs
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-12-28 04:18:56 -08:00
a6eb32b77c Fix path parsing for add command
License: MIT
Signed-off-by: Dominic Della Valle <ddvpublic@gmail.com>
2015-12-22 10:59:17 -05:00
bdc1b27c51 hard code things
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-11-30 14:43:37 -08:00
021ef43418 gateway: add path prefix for directory listings
License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
2015-11-16 07:00:57 +01:00
c1847e9f69 putHandler: addressed CR from @jbenet
License: MIT
Signed-off-by: Henry <cryptix@riseup.net>
2015-10-31 01:37:37 +01:00
b8b4e45665 fixing putHandler for --writable http gateway
I disabled this a long time ago and never refactored it. About time.

License: MIT
Signed-off-by: Henry <cryptix@riseup.net>
2015-10-28 08:11:56 +01:00
rht
4b3a21eceb Humanize bytes in dir index listing
Fixes https://github.com/ipfs/dir-index-html/issues/3

License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-08-29 09:58:21 +07:00
rht
de5c0ceff0 Localize the scope of context.WithCancel for every DAG.Get
Instead put it inside of DAG.Get.
The fix is applied only in the case when the context.WithCancel
before a DAG.Get is also used later on in the scope.

License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-08-23 22:38:04 +07:00
09d7501724 gateway: make IPNSHostname complete
IPNSHostnameOption() touches the URL path only on the way in,
but not on the way out. This commit makes it complete by
touching the following URLs in responses:

- Heading, file links, back links in directory listings
- Redirecting /foo to /foo/ if there's an index.html link
- Omit Suborigin header

License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
2015-08-17 15:39:19 +02:00
39a23392c1 use rabin fingerprinting for a chunker
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

implement rabin fingerprinting as a chunker for ipfs

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

vendor correctly

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

refactor chunking interface a little

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

work chunking interface changes up into importer

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

move chunker type parsing into its own file in chunk

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-08-08 15:33:10 -07:00
4a571b099b implement arbitrary HTTP header support
this commit adds the ability to specify arbitrary HTTP headers
for either the Gateway or the API. simply set the desired headers
on the config:

    ipfs config --json API.HTTPHeaders.X-MyHdr '["meow :)"]'
    ipfs config --json Gateway.HTTPHeaders.X-MyHdr '["meow :)"]'

License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-07-28 23:08:10 -07:00
053e531dac http/index: fix indention and remove unused field
License: MIT
Signed-off-by: Henry <cryptix@riseup.net>
2015-07-04 00:51:42 +02:00
0ed49dbbfb http/gateway:
- First tab at integrating @krl's new index page

File icons are embedded in side icons.css (QmXB7PLRWH6bCiwrGh2MrBBjNkLv3mY3JdYXCikYZSwLED contains both the icons and bootstrap)

- Fix back links (..)  (fixes #1365)

Thanks @JasonWoof for the insight.  The back links now stop a t the root hash and work for links that do and dont end with a slash.

License: MIT
Signed-off-by: Henry <cryptix@riseup.net>
2015-07-04 00:51:42 +02:00
ef294431d4 move util.Key into its own package under blocks 2015-06-01 16:10:08 -07:00
dd928a2b1d change pinning to happen in a callback 2015-05-28 08:52:20 -07:00
4537311f59 http gw: disable PUT and writable tests - again... :( 2015-05-10 15:30:12 +02:00
87ce7abe47 unixfs/io: added NewEmptyDirectory()
some golinting along the way
2015-05-10 07:36:28 -04:00
31b83abfe4 http gw: remove newDagEmptyDir helper 2015-05-09 12:19:57 +02:00
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
1502f6bc71 http gw: removed ResolvePath() in favour of core.Resolve() 2015-05-09 12:19:57 +02:00
e633250c38 http gw: remove unused interface 2015-05-09 12:19:57 +02:00
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
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
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
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
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
89ca37d1d1 Fixes issue #924 2015-03-16 16:08:45 -04: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
872c64dd79 gateway: dont cache ipns paths
ipns paths are mutable and should not be cached. this error is
a byproduct of the currently messy gateway route. We should split
the /ipfs and /ipns routes up.
2015-02-07 10:10:05 -08:00
2d173c3a25 core/corehttp: Return 403 for blocked requests instead of 404 2015-02-04 18:46:59 -08:00
b1ca07d6c5 core/corehttp: Added gateway path whitelisting 2015-02-04 18:46:54 -08:00
262e78122a core/corehttp: Added Suborigin header to gateway responses 2015-02-04 16:53:24 -08:00
d50a7ff003 feat(corehttp) add a Gateway blocklist
use pointer

use func

comment on decider to clarify whether it allows or denies

fix set conf

gstw
2015-02-04 16:17:39 -08: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
295cc443da HTTP Gateway: add /ipns/ GET requests 2015-01-31 23:36:46 +01:00
7d09da3c8b Make gateway read-only by default and add option to make it writable 2015-01-31 23:36:45 +01:00
d221d55d85 HTTP: add handlers to allow object creation and modification 2015-01-31 20:47:34 +01:00
abb3c9c9c4 implement path type 2015-01-29 17:51:08 +00:00
c36e8dd04c gateway: reordered headers to avoid error
cc @mappum
2015-01-28 16:55:00 -08:00
cea68afa2e core/corehttp: Handle Etag for caching 2015-01-28 16:50:16 -08:00
fb986fd822 core/corehttp: Added cache headers to gatewayy requests 2015-01-28 16:48:07 -08:00
e4eb964f69 core/corehttp: Use consts for path prefixes 2015-01-28 16:43:45 -08:00
2759d1c126 core/corehttp: Added handling of /ipns/<hash>/x paths 2015-01-28 16:38:36 -08:00
950e492fc4 core/corehttp: Close DAGReaders when done 2015-01-28 16:01:42 -08:00
58d401c3b0 core/corehttp: gateway_handler: Redirect to path with trailing slash when showing a directory's index.html 2015-01-28 16:01:42 -08:00
b8fcece0e5 core/corehttp: Handle IPNS paths in gateway 2015-01-28 16:01:41 -08:00
d338a81eca core/corehttp: Support Range requests in gateway handler 2015-01-28 15:49:55 -08:00
26826bd55e implement seeking in the dagreader 2015-01-27 01:33:09 +00:00
6fedf259eb remove prefix logger 2015-01-24 00:30:56 -08:00