Commit Graph

3401 Commits

Author SHA1 Message Date
Kevin Wallace
084cdc3ed8 gateway: attempt to resolve hostname to ipfs path
This allows someone to host a static site by pointing a TXT record at their
content in IPFS, and a CNAME record at an IPFS gateway.

Note that such a setup technically violates RFC1912 (section 2.4; "A CNAME
record is not allowed to coexist with any other data."), but tends to work in
practice.

We may want to consider changing the DNS->IPFS resolution scheme to allow this
scenario to be RFC-compliant (e.g. store the mapping on a well-known subdomain
to allow CNAME records on the domain itself).

License: MIT
Signed-off-by: Kevin Wallace <kevin@pentabarf.net>
2015-02-08 11:27:06 -08:00
Kevin Wallace
fbd76ebb5b corehttp: ServeOption supports chaining muxes
Each option now additionally returns the mux to be used by future options. If
every options returns the mux it was passed, the current behavior is unchanged.

However, if the option returns an a new mux, it can mediate requests to handlers
provided by future options:

    return func(n *core.IpfsNode, mux *http.ServeMux) (*http.ServeMux, error) {
      childMux := http.NewServeMux()
      mux.Handle("/", handlerThatDelegatesToChildMux)
      return childMux, nil
    }

License: MIT
Signed-off-by: Kevin Wallace <kevin@pentabarf.net>
2015-02-08 11:27:06 -08:00
Juan Batiz-Benet
3e635e57af Merge pull request #763 from jbenet/update-multihash
go-multihash update
2015-02-07 12:59:41 -08:00
Juan Batiz-Benet
a4c522bcd4 go-multihash update 2015-02-07 12:53:10 -08:00
Juan Batiz-Benet
757a71f2bf Merge pull request #762 from jbenet/ipns-gateway-fix
gateway: dont cache ipns paths
2015-02-07 12:11:07 -08:00
Juan Batiz-Benet
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
Juan Batiz-Benet
03c910f97a Merge pull request #755 from jbenet/fix-ratelimiter-use
ratelimiter: fixing rate limiter use
2015-02-06 11:57:24 -08:00
Juan Batiz-Benet
91a79bc203 ratelimiter: fixing rate limiter use
Use of the ratelimiter should be conscious of the ratelimiter's
potential closing. any loops that add work to ratelimiter
should (a) only do so if the rate limiter is not closed,
or (b) prevent limiter while work is added
(i.e. use limiter.Go(addWorkHere))
2015-02-06 10:59:03 -08:00
Brian Tiger Chow
8558838d00 fix(core) check nil for _all_ owned resources
since construction can fail, and construction is non-trivial, it's
probably safer to never assume resource exists.

cc @jbenet @whyrusleeping
2015-02-06 11:22:43 -07:00
Brian Tiger Chow
bbcb670ef2 rename binary 2015-02-06 08:28:53 -08:00
Brian Tiger Chow
1d01c0354f refactor(cmd/daemon) more compact representation!
exposed the Decider to make configuration nicer @mappum
2015-02-06 08:14:14 -08:00
Brian Tiger Chow
db644fe1b7 allow access to the field for convenience
decalarative configuration is superior. the thread-safety because
important during normal operation
2015-02-06 08:13:15 -08:00
Brian Tiger Chow
4bc2713a28 more compact respresentation 2015-02-06 08:13:15 -08:00
Juan Batiz-Benet
94c64c577b Merge pull request #751 from jbenet/fix-webui-history
corehttp: allow all webui paths we published.
2015-02-06 07:41:10 -08:00
Juan Batiz-Benet
64a4c27913 corehttp: allow all webui paths we published.
Otherwise we break users links! cc @mappum
2015-02-06 07:30:42 -08:00
Juan Batiz-Benet
28079bdc26 Merge pull request #747 from jbenet/obs-addr-natfix
p2p/protocol/identity: smarter tracking observed addrs
2015-02-05 10:20:44 -08:00
Juan Batiz-Benet
ee4a9a2711 p2p/protocol/identity: smarter tracking observed addrs
- time them out (already was doing that with addrbook)
- keep count to counter symmetric nats
2015-02-05 10:15:16 -08:00
Juan Batiz-Benet
3448b4c18f Merge pull request #746 from jbenet/kbucket-race
routing/kbucket: fix data race
2015-02-05 06:42:40 -08:00
Juan Batiz-Benet
e92a33f442 routing/kbucket: cleaner "public" interface for bucket 2015-02-05 06:22:44 -08:00
Juan Batiz-Benet
be2be853c7 kbucket: fix data race 2015-02-05 04:53:23 -08:00
Juan Batiz-Benet
0de13b071d Merge pull request #743 from jbenet/misc-2-2
Gateway Changes
2015-02-05 00:05:43 -08:00
Matt Bell
0195c03664 core/corehttp: Updated WebUI hash 2015-02-04 23:51:06 -08:00
Juan Batiz-Benet
739abea36b Merge pull request #647 from chriscool/ipfs_test_lib
Add ipfs-test-lib.sh
2015-02-04 19:31:23 -08:00
Matt Bell
2d173c3a25 core/corehttp: Return 403 for blocked requests instead of 404 2015-02-04 18:46:59 -08:00
Matt Bell
09e4224aa7 test/sharness: Fixed gateway tests 2015-02-04 18:46:59 -08:00
Matt Bell
e8bbf1dcdf commands/http: Made command HTTP API only accept requests from referers on the same server 2015-02-04 18:46:59 -08:00
Matt Bell
b1ca07d6c5 core/corehttp: Added gateway path whitelisting 2015-02-04 18:46:54 -08:00
Brian Tiger Chow
6599756168 Merge pull request #741 from jbenet/feat/blocklist
add blocklist to gateway executable
2015-02-04 18:44:03 -08:00
Matt Bell
a16e0bba2f repo/config: Added default gateway address to initial config 2015-02-04 16:53:24 -08:00
Matt Bell
262e78122a core/corehttp: Added Suborigin header to gateway responses 2015-02-04 16:53:24 -08:00
Matt Bell
a7de81b818 commands: URL escape filenames in multipart files, resolves #654 2015-02-04 16:53:24 -08:00
Brian Tiger Chow
9c489c37a4 feat(gateway-fs) use blocklist in gateway binary
log

fix main
2015-02-04 16:17:40 -08:00
Brian Tiger Chow
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
Brian Tiger Chow
4c920d0281 Revert "run make vendor (removes go-humanize)"
This reverts commit bbcc86b78e.

humanize is required for sharness. doh!
2015-02-04 15:38:38 -08:00
Brian Tiger Chow
bbcc86b78e run make vendor (removes go-humanize) 2015-02-04 15:32:16 -08:00
Brian Tiger Chow
bbcdeb74d2 fix: vendor 2015-02-04 15:32:49 -08:00
Jeromy Johnson
4e4070b444 Merge pull request #729 from jbenet/feat/metadata
implement metadata node for unixfs and other
2015-02-04 15:13:17 -08:00
Jeromy
2501a7c7b7 update UI from PR comments 2015-02-04 23:07:13 +00:00
Jeromy
4770c5e142 only expose IpfsNode as param 2015-02-04 23:07:13 +00:00
Jeromy
b79fffc965 implement metadata node for unixfs and other 2015-02-04 23:07:12 +00:00
Jeromy Johnson
adb7ad9fcd Merge pull request #713 from jbenet/feat/trickledag
implement trickledag for faster unixfs operations
2015-02-04 15:04:57 -08:00
Jeromy
1e93ee00c0 clean up benchmarks, implement WriterTo on DAGReader, and optimize DagReader 2015-02-04 21:59:51 +00:00
Jeromy
414bdc78c0 fix benchmarks 2015-02-04 21:59:51 +00:00
Jeromy
bc79ae17a1 refactor importer package with trickle and balanced dag generation 2015-02-04 21:59:51 +00:00
Jeromy
b3e74fabb5 implement trickledag for faster unixfs operations 2015-02-04 21:59:50 +00:00
Christian Couder
bbb6196d12 Delete test/bin/fsh
It has been replaced with test_fsh().

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-02-04 22:01:03 +01:00
Christian Couder
fa13afa5ca Replace fsh with test_fsh in sharness tests
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-02-04 21:53:19 +01:00
Christian Couder
65cbbdff84 Add ipfs-test-lib.sh and source it in sharness test-lib.sh
The new ipfs-test-lib.sh file contains generic test
functions.
We also start replacing fsh with a shell function named
test_fsh() in ipfs-test-lib.sh.
And we move our custom test_cmp in ipfs-test-lib.sh.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-02-04 21:50:07 +01:00
Juan Batiz-Benet
1afb281dfd Merge pull request #739 from jbenet/gc-query-queues
gc query queues
2015-02-04 04:24:28 -08:00
Brian Tiger Chow
75ffca6b72 Merge pull request #742 from jbenet/fix/repo-config-validation
when setting config keys, validate against struct before writing to disk
2015-02-03 18:15:02 -08:00